Skip to content

Commit 01d81a2

Browse files
author
Neubert, Sebastian
committed
pull from upstream
2 parents 6fed121 + e1dbcfd commit 01d81a2

File tree

7 files changed

+46
-2710
lines changed

7 files changed

+46
-2710
lines changed

.travis.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,21 @@ php:
55
- 5.4
66
- 5.5
77

8+
env:
9+
- CODECEPT_VERSION="1"
10+
- CODECEPT_VERSION="2"
11+
12+
matrix:
13+
exclude:
14+
- php: 5.3
15+
env: CODECEPT_VERSION="2"
16+
817
before_script:
918
- printf "\n" | pecl install imagick
1019
- wget http://selenium.googlecode.com/files/selenium-server-standalone-2.35.0.jar
1120
- java -jar selenium-server-standalone-2.35.0.jar -port 4444 >/dev/null 2>&1 &
1221
- cd test/integration/
1322
- mkdir tests/_log
14-
- php codecept.phar build
23+
- php codecept${CODECEPT_VERSION}.phar build
1524

16-
script: php codecept.phar run -d
25+
script: php codecept${CODECEPT_VERSION}.phar run -d

module/VisualCeption.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,11 @@ private function getCoordinates ($elementId)
183183
private function getScreenshotName ($identifier)
184184
{
185185
$caseName = str_replace('Cept.php', '', $this->test->getFileName());
186+
187+
$search = array('/', '\\');
188+
$replace = array('.', '.');
189+
$caseName = str_replace($search, $replace, $caseName);
190+
186191
return $caseName . '.' . $identifier . '.png';
187192
}
188193

@@ -324,6 +329,8 @@ private function compare ($identifier)
324329
*/
325330
private function compareImages ($image1, $image2)
326331
{
332+
$this->debug("Trying to compare $image1 with $image2");
333+
327334
$imagick1 = new \Imagick($image1);
328335
$imagick2 = new \Imagick($image2);
329336

File renamed without changes.

test/integration/codecept2.phar

853 KB
Binary file not shown.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
3+
$I = new WebGuy($scenario);
4+
5+
$I->amOnPage("/VisualCeption/seeVisualChanges.php");
6+
$I->seeVisualChanges("SimpleBlock", "#theblock");
7+
8+
// the test has to be called twice for comparison on the travis server
9+
$I->wait(2);
10+
$I->amOnPage("/VisualCeption/seeVisualChanges.php");
11+
$I->seeVisualChanges("SimpleBlock", "#theblock");

test/integration/tests/acceptance/TimeComparisonCest.php

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ public function seeVisualChanges (WebGuy $I, $scenario)
1111
$I->amOnPage("/VisualCeption/seeVisualChanges.php");
1212
$I->seeVisualChanges("block", "#theblock");
1313

14+
$I->wait(1);
15+
1416
// the test has to be called twice for comparison on the travis server
1517
$I->amOnPage("/VisualCeption/seeVisualChanges.php");
1618
$I->seeVisualChanges("block", "#theblock");
@@ -19,11 +21,23 @@ public function seeVisualChanges (WebGuy $I, $scenario)
1921
public function dontSeeVisualChanges (WebGuy $I, $scenario)
2022
{
2123
$I->amOnPage("/VisualCeption/dontSeeVisualChanges.php");
22-
$I->dontSeeVisualChanges("block", "#theblock");
24+
$I->dontSeeVisualChanges("block2", "#theblock");
25+
26+
$I->wait(1);
2327

2428
// the test has to be called twice for comparison on the travis server
2529
$I->amOnPage("/VisualCeption/dontSeeVisualChanges.php");
26-
$I->dontSeeVisualChanges("block", "#theblock");
30+
$I->dontSeeVisualChanges("block2", "#theblock");
31+
}
32+
33+
public function seeVisualChangesAndHideElement (WebGuy $I, $scenario)
34+
{
35+
$I->amOnPage("/VisualCeption/seeVisualChanges.php");
36+
$I->seeVisualChanges("body", "body", "#intro");
37+
38+
// the test has to be called twice for comparison on the travis server
39+
$I->amOnPage("/VisualCeption/seeVisualChanges.php");
40+
$I->dontSeeVisualChanges("body", "body", array("#intro"));
2741
}
2842

2943
public function dontSeeVisualChangesAndHideElement (WebGuy $I, $scenario)
@@ -33,7 +47,6 @@ public function dontSeeVisualChangesAndHideElement (WebGuy $I, $scenario)
3347

3448
// the test has to be called twice for comparison on the travis server
3549
$I->amOnPage("/VisualCeption/seeVisualChanges.php");
36-
$I->dontSeeVisualChanges("body", "body", "#theblock");
50+
$I->dontSeeVisualChanges("body", "body", array("#theblock"));
3751
}
38-
3952
}

0 commit comments

Comments
 (0)