File tree 4 files changed +90
-4
lines changed
main/java/com/saucelabs/visual/graphql
test/java/com/saucelabs/visual/integration
4 files changed +90
-4
lines changed Original file line number Diff line number Diff line change @@ -100,11 +100,11 @@ public CreateSnapshotFromWebDriverIn(
100
100
}
101
101
102
102
public void setTestName (String testName ) {
103
- this .testName = Optional .of (testName );
103
+ this .testName = Optional .ofNullable (testName );
104
104
}
105
105
106
106
public void setSuiteName (String suiteName ) {
107
- this .suiteName = Optional .of (suiteName );
107
+ this .suiteName = Optional .ofNullable (suiteName );
108
108
}
109
109
110
110
public void setCaptureDom (Boolean captureDom ) {
Original file line number Diff line number Diff line change @@ -74,8 +74,8 @@ public static void tearDown() {
74
74
driver .quit ();
75
75
}
76
76
77
- protected void sauceVisualCheck (String name ) {
78
- sauceVisualCheck (name , new CheckOptions ());
77
+ protected String sauceVisualCheck (String name ) {
78
+ return sauceVisualCheck (name , new CheckOptions ());
79
79
}
80
80
81
81
protected String sauceVisualCheck (String name , CheckOptions checkOptions ) {
Original file line number Diff line number Diff line change
1
+ package com .saucelabs .visual .integration ;
2
+
3
+ import au .com .origin .snapshots .Expect ;
4
+ import au .com .origin .snapshots .junit5 .SnapshotExtension ;
5
+ import com .saucelabs .visual .CheckOptions ;
6
+ import org .junit .jupiter .api .BeforeAll ;
7
+ import org .junit .jupiter .api .Test ;
8
+ import org .junit .jupiter .api .extension .ExtendWith ;
9
+
10
+ @ ExtendWith ({SnapshotExtension .class })
11
+ public class WithoutTestMetaIT extends IntegrationBase {
12
+ Expect expect ;
13
+
14
+ @ BeforeAll
15
+ public static void login () {
16
+ LoginPage loginPage = new LoginPage ();
17
+ loginPage .open ();
18
+ loginPage .login ();
19
+ InventoryLongPage inventoryPage = new InventoryLongPage ();
20
+ inventoryPage .open ();
21
+ }
22
+
23
+ @ Test
24
+ public void checkWithoutTestMeta () {
25
+ String id = sauceVisualCheck ("No Test Meta" );
26
+ String result = getSnapshotResult (id );
27
+ expect .toMatchSnapshot (result );
28
+ }
29
+
30
+ @ Test
31
+ public void checkSupplyingValuesManually () {
32
+ String id =
33
+ sauceVisualCheck (
34
+ "Manual Test Meta" ,
35
+ new CheckOptions .Builder ()
36
+ .withSuiteName ("Custom Suite Name" )
37
+ .withTestName ("Custom Test Name" )
38
+ .build ());
39
+ String result = getSnapshotResult (id );
40
+ expect .toMatchSnapshot (result );
41
+ }
42
+ }
Original file line number Diff line number Diff line change
1
+ com .saucelabs .visual .integration .WithoutTestMetaIT .checkSupplyingValuesManually = [
2
+ {
3
+ " snapshot" : {
4
+ " name" : " Manual Test Meta (Sauce)" ,
5
+ " suiteName" : " Custom Suite Name" ,
6
+ " testName" : " Custom Test Name" ,
7
+ " operatingSystem" : " WINDOWS" ,
8
+ " operatingSystemVersion" : " 10" ,
9
+ " device" : " Desktop (1384x1007)" ,
10
+ " devicePixelRatio" : 1 ,
11
+ " hasDom" : true ,
12
+ " diffs" : {
13
+ " nodes" : [ {
14
+ " status" : " EQUAL" ,
15
+ " diffClusters" : [ ]
16
+ } ]
17
+ },
18
+ " ignoreRegions" : [ ]
19
+ }
20
+ }
21
+ ]
22
+
23
+
24
+ com .saucelabs .visual .integration .WithoutTestMetaIT .checkWithoutTestMeta = [
25
+ {
26
+ " snapshot" : {
27
+ " name" : " No Test Meta (Sauce)" ,
28
+ " suiteName" : null ,
29
+ " testName" : null ,
30
+ " operatingSystem" : " WINDOWS" ,
31
+ " operatingSystemVersion" : " 10" ,
32
+ " device" : " Desktop (1384x1007)" ,
33
+ " devicePixelRatio" : 1 ,
34
+ " hasDom" : true ,
35
+ " diffs" : {
36
+ " nodes" : [ {
37
+ " status" : " EQUAL" ,
38
+ " diffClusters" : [ ]
39
+ } ]
40
+ },
41
+ " ignoreRegions" : [ ]
42
+ }
43
+ }
44
+ ]
You can’t perform that action at this time.
0 commit comments