Skip to content

Commit f8f0a30

Browse files
author
Nils Langner
committed
Merge pull request #25 from phmLabs/master
Some stuff
2 parents 9b2d58a + db6e209 commit f8f0a30

File tree

7 files changed

+31
-2708
lines changed

7 files changed

+31
-2708
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
@@ -158,6 +158,11 @@ private function getCoordinates ($elementId)
158158
private function getScreenshotName ($identifier)
159159
{
160160
$caseName = str_replace('Cept.php', '', $this->test->getFileName());
161+
162+
$search = array('/', '\\');
163+
$replace = array('.', '.');
164+
$caseName = str_replace($search, $replace, $caseName);
165+
161166
return $caseName . '.' . $identifier . '.png';
162167
}
163168

@@ -263,6 +268,8 @@ private function compare ($identifier)
263268
*/
264269
private function compareImages ($image1, $image2)
265270
{
271+
$this->debug("Trying to compare $image1 with $image2");
272+
266273
$imagick1 = new \Imagick($image1);
267274
$imagick2 = new \Imagick($image2);
268275

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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ public function seeVisualChanges (WebGuy $I, $scenario)
1919
public function dontSeeVisualChanges (WebGuy $I, $scenario)
2020
{
2121
$I->amOnPage("/VisualCeption/dontSeeVisualChanges.php");
22-
$I->dontSeeVisualChanges("block", "#theblock");
22+
$I->dontSeeVisualChanges("block2", "#theblock");
2323

2424
// the test has to be called twice for comparison on the travis server
2525
$I->amOnPage("/VisualCeption/dontSeeVisualChanges.php");
26-
$I->dontSeeVisualChanges("block", "#theblock");
26+
$I->dontSeeVisualChanges("block2", "#theblock");
2727
}
2828

2929
}

0 commit comments

Comments
 (0)