Skip to content

Commit 965c5cb

Browse files
committed
chore: Stop using default platforms and versions in IT tests
Also update reference screenshot names to match the current CI environment, and remove outdated PhantomJS screenshots.
1 parent 3b9ac5a commit 965c5cb

File tree

10 files changed

+25
-65
lines changed

10 files changed

+25
-65
lines changed
1.34 KB
Loading
Binary file not shown.
Binary file not shown.
Binary file not shown.

vaadin-testbench-integration-tests/src/test/java/com/vaadin/tests/elements/ElementScreenCompareIT.java

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,14 @@
1212

1313
import static org.junit.Assert.assertTrue;
1414

15+
import java.io.IOException;
16+
1517
import org.junit.Test;
1618

1719
import com.vaadin.testUI.ElementQueryUI;
1820
import com.vaadin.testbench.By;
1921
import com.vaadin.testbench.TestBenchElement;
22+
import com.vaadin.testbench.screenshot.ReferenceNameGenerator;
2023

2124
public class ElementScreenCompareIT extends MultiBrowserTest {
2225

@@ -33,10 +36,27 @@ public void elementCompareScreen() throws Exception {
3336
TestBenchElement button4 = (TestBenchElement) findElements(
3437
By.className("v-button")).get(4);
3538

36-
assertTrue(button4.compareScreen("button4"));
39+
compareScreen(button4, "button4");
3740
TestBenchElement layout = (TestBenchElement) button4
3841
.findElement(By.xpath("../.."));
39-
assertTrue(layout.compareScreen("layout"));
42+
compareScreen(layout, "layout");
43+
}
44+
45+
private void compareScreen(TestBenchElement element, String referenceId)
46+
throws IOException {
47+
assertTrue(errorMessage(element, referenceId),
48+
element.compareScreen(referenceId));
49+
}
50+
51+
private String errorMessage(TestBenchElement element,
52+
String referenceId) {
53+
ReferenceNameGenerator referenceNameGenerator = element
54+
.getCommandExecutor().getReferenceNameGenerator();
55+
return String.format(
56+
"Screenshot comparison failed. Comparison file: "
57+
+ "%s.png (number, if any, may vary)",
58+
referenceNameGenerator.generateName(referenceId,
59+
getDesiredCapabilities()));
4060
}
4161

4262
}

vaadin-testbench-integration-tests/src/test/java/com/vaadin/tests/elements/PrivateTB5Configuration.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import com.vaadin.testbench.annotations.RunLocally;
2727
import com.vaadin.testbench.annotations.RunOnHub;
2828
import com.vaadin.testbench.parallel.Browser;
29+
import com.vaadin.testbench.parallel.DefaultBrowserFactory;
2930

3031
/**
3132
* Provides values for parameters which depend on where the test is run.
@@ -35,7 +36,7 @@
3536
* @author Vaadin Ltd
3637
*/
3738

38-
@BrowserFactory(VaadinBrowserFactory.class)
39+
@BrowserFactory(DefaultBrowserFactory.class)
3940
@RunOnHub("tb5-hub.intra.itmill.com")
4041
public abstract class PrivateTB5Configuration extends AbstractTB5Test {
4142
private static final String HOSTNAME_PROPERTY = "deployment.hostname";
@@ -72,7 +73,7 @@ public abstract class PrivateTB5Configuration extends AbstractTB5Test {
7273
}
7374

7475
protected static DesiredCapabilities getRunLocallyCapabilities() {
75-
VaadinBrowserFactory factory = new VaadinBrowserFactory();
76+
DefaultBrowserFactory factory = new DefaultBrowserFactory();
7677

7778
try {
7879
if (properties.containsKey(RUN_LOCALLY_PROPERTY)) {

vaadin-testbench-integration-tests/src/test/java/com/vaadin/tests/elements/VaadinBrowserFactory.java

Lines changed: 0 additions & 61 deletions
This file was deleted.

0 commit comments

Comments
 (0)