Skip to content
This repository was archived by the owner on Feb 20, 2019. It is now read-only.

Commit adcf080

Browse files
author
Daniel Khodaparast
committed
Updating for compatibility with Firefox 17.0.1 and Selenium Server 2.25.0.
1 parent b7c0c2a commit adcf080

File tree

5 files changed

+22
-12
lines changed

5 files changed

+22
-12
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Selenium-Saucelabs (S2) PHP Webdriver
22
=====================================
3-
This allows for the integration of PHP based unit tests with a [Selenium Server][selenium] or remote [Saucelabs][saucelabs] connection. The unit tests provided are currently compatible with Firefox [9.0][firefox] and Selenium Server [2.18][seleniumServer].
3+
This allows for the integration of PHP based unit tests with a [Selenium Server][selenium] or remote [Saucelabs][saucelabs] connection. The unit tests provided are currently compatible with Firefox [17.0.1][firefox] and Selenium Server [2.25][seleniumServer].
44

55
Getting Started
66
---------------
@@ -22,7 +22,7 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY
2222
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2323

2424
[bronto]:http://www.bronto.com
25-
[firefox]:ftp://ftp.mozilla.org/pub/firefox/releases/9.0
25+
[firefox]:ftp://ftp.mozilla.org/pub/firefox/releases/17.0.1/
2626
[saucelabs]:http://www.saucelabs.com
2727
[selenium]:http://www.seleniumhq.org
28-
[seleniumServer]:http://selenium.googlecode.com/files/selenium-server-standalone-2.18.0.jar
28+
[seleniumServer]:http://selenium.googlecode.com/files/selenium-server-standalone-2.25.0.jar

Test/Base.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class Test_Base extends PHPUnit_Framework_TestCase {
2929
$sessionSetup = array(
3030
// default browser to use when all else fails
3131
'browser' => 'firefox',
32-
'version' => '9.0',
32+
'version' => '17.0.1',
3333

3434
// default os/platform (ANY, XP, VISTA, or LINUX)
3535
'platform' => 'ANY',
@@ -62,7 +62,7 @@ public function setUp() {
6262
$capabilities = array(
6363
'name' => $this->getJobName(),
6464
'platform' => $setup['platform'],
65-
'selenium-version' => '2.18.0',
65+
'selenium-version' => '2.25.0',
6666
);
6767

6868
$setup['host'] = $setup['sauce']['user'] . ':' . $setup['sauce']['key'] . '@ondemand.saucelabs.com';
@@ -73,7 +73,7 @@ public function setUp() {
7373
$this->session = new WebDriver_Session($setup['host'], $setup['port']);
7474
$this->session->setBrowser($setup['browser'], $setup['version']);
7575

76-
if (!is_null($capabilities)) {
76+
if (isset($capabilities)) {
7777
foreach ($capabilities as $capability => $value) {
7878
$this->session->setCapability($capability, $value);
7979
}

Test/ElementTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public function testCss() {
7474
$this->assertEquals('48px', $elementImage->css('width'));
7575

7676
$elementDiv = $this->session->element('id', 'testContent');
77-
$this->assertEquals('rgb(206, 206, 206)', $elementDiv->css('background-color'));
77+
$this->assertEquals('rgba(206, 206, 206, 1)', $elementDiv->css('background-color'));
7878
$this->assertEquals('left', $elementDiv->css('text-align'));
7979
}
8080

Test/SessionTest.php

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,12 @@ public function testAlertText() {
7474
public function testBack() {
7575
$elementLink = $this->session->element('link text', 'Sauce Labs');
7676
$elementLink->click();
77+
sleep(3);
7778

78-
$this->assertEquals('http://saucelabs.com/', $this->session->url());
79+
$this->assertEquals('https://saucelabs.com/', $this->session->url());
7980
$this->session->back();
81+
sleep(3);
82+
8083
$this->assertEquals($this->testWebDriver, $this->session->url());
8184
}
8285

@@ -207,12 +210,17 @@ public function testDoubleclick() {
207210
public function testForward() {
208211
$elementLink = $this->session->element('link text', 'Sauce Labs');
209212
$elementLink->click();
213+
sleep(3);
210214

211-
$this->assertEquals('http://saucelabs.com/', $this->session->url());
215+
$this->assertEquals('https://saucelabs.com/', $this->session->url());
212216
$this->session->back();
217+
sleep(3);
218+
213219
$this->assertEquals($this->testWebDriver, $this->session->url());
214220
$this->session->forward();
215-
$this->assertEquals('http://saucelabs.com/', $this->session->url());
221+
sleep(3);
222+
223+
$this->assertEquals('https://saucelabs.com/', $this->session->url());
216224
}
217225

218226

@@ -283,6 +291,8 @@ public function testWindow() {
283291
$this->assertEquals(2, count($windows));
284292

285293
$this->session->window($windows[1]);
294+
sleep(5);
295+
286296
$this->assertEquals('http://www.google.com/', $this->session->url());
287297
$this->session->window();
288298

testWebDriver.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ <h3><a onclick="doSelenium(); doEvent(event);" href="javascript:void(0);">Seleni
134134
<p class="header">Example Links</p>
135135
<ul>
136136
<li><a href="http://seleniumhq.org">Selenium HQ</a></li>
137-
<li><a href="http://saucelabs.com">Sauce Labs</a></li>
137+
<li><a href="https://saucelabs.com">Sauce Labs</a></li>
138138
<li><a href="http://google.com" target="_blank">Google</a></li>
139139
</ul>
140140

@@ -188,4 +188,4 @@ <h3><a onclick="doSelenium(); doEvent(event);" href="javascript:void(0);">Seleni
188188

189189
<div id="testHidden"></div>
190190
</body>
191-
</html>
191+
</html>

0 commit comments

Comments
 (0)