-
Notifications
You must be signed in to change notification settings - Fork 364
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
For #208 - Put automatic visual regression testing into junit tests s…
…o they run automatically at ci. Hopefully this works on travis.
- Loading branch information
Showing
5 changed files
with
92 additions
and
43 deletions.
There are no files selected for viewing
26 changes: 0 additions & 26 deletions
26
openhtmltopdf-examples/src/main/java/com/openhtmltopdf/visualtest/VisualTestRunner.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+927 Bytes
(180%)
openhtmltopdf-examples/src/main/resources/visualtest/expected/z-index-absolute.pdf
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
...-examples/src/test/java/com/openhtmltopdf/visualregressiontests/VisualRegressionTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package com.openhtmltopdf.visualregressiontests; | ||
|
||
import java.io.File; | ||
import static org.junit.Assert.assertTrue; | ||
import java.io.IOException; | ||
|
||
import org.junit.Before; | ||
import org.junit.Test; | ||
|
||
import com.openhtmltopdf.visualtest.VisualTester; | ||
|
||
public class VisualRegressionTest { | ||
private VisualTester vt; | ||
|
||
@Before | ||
public void configureTester() { | ||
File overrideDirectory = new File("target/test/visual-tests/user-override/"); | ||
File outputDirectory = new File("target/test/visual-tests/test-output/"); | ||
|
||
overrideDirectory.mkdirs(); | ||
outputDirectory.mkdirs(); | ||
|
||
vt = new VisualTester("/visualtest/html/", /* Resource path. */ | ||
new File("src/main/resources/visualtest/expected/"), /* Expected directory */ | ||
overrideDirectory, | ||
outputDirectory | ||
); | ||
} | ||
|
||
@Test | ||
public void testZIndexWithAbsolutePosition() throws IOException { | ||
assertTrue(vt.runTest("z-index-absolute")); | ||
} | ||
|
||
|
||
|
||
} |