@@ -2,6 +2,8 @@ const utf8ToB64 = (str) => {
2
2
return window . btoa ( unescape ( encodeURIComponent ( str ) ) ) ;
3
3
} ;
4
4
5
+ const batchId = 'mermid-batch' + new Date ( ) . getTime ( ) ;
6
+
5
7
export const mermaidUrl = ( graphStr , options , api ) => {
6
8
const obj = {
7
9
code : graphStr ,
@@ -50,9 +52,12 @@ export const imgSnapshotTest = (graphStr, _options, api = false, validation) =>
50
52
const name = ( options . name || cy . state ( 'runnable' ) . fullTitle ( ) ) . replace ( / \s + / g, '-' ) ;
51
53
52
54
if ( useAppli ) {
55
+ cy . log ( 'Opening eyes ' + Cypress . spec . name + ' --- ' + name ) ;
53
56
cy . eyesOpen ( {
54
57
appName : 'Mermaid' ,
55
58
testName : name ,
59
+ batchName : Cypress . spec . name ,
60
+ batchId : batchId + Cypress . spec . name ,
56
61
} ) ;
57
62
}
58
63
@@ -64,7 +69,9 @@ export const imgSnapshotTest = (graphStr, _options, api = false, validation) =>
64
69
// Default name to test title
65
70
66
71
if ( useAppli ) {
72
+ cy . log ( 'Check eyes' + Cypress . spec . name ) ;
67
73
cy . eyesCheckWindow ( 'Click!' ) ;
74
+ cy . log ( 'Closing eyes: ' + Cypress . spec . name ) ;
68
75
cy . eyesClose ( ) ;
69
76
} else {
70
77
cy . matchImageSnapshot ( name ) ;
@@ -100,9 +107,12 @@ export const urlSnapshotTest = (url, _options, api = false, validation) => {
100
107
const name = ( options . name || cy . state ( 'runnable' ) . fullTitle ( ) ) . replace ( / \s + / g, '-' ) ;
101
108
102
109
if ( useAppli ) {
110
+ cy . log ( 'Opening eyes 2' + Cypress . spec . name ) ;
103
111
cy . eyesOpen ( {
104
112
appName : 'Mermaid' ,
105
113
testName : name ,
114
+ batchName : Cypress . spec . name ,
115
+ batchId : batchId + Cypress . spec . name ,
106
116
} ) ;
107
117
}
108
118
@@ -112,7 +122,9 @@ export const urlSnapshotTest = (url, _options, api = false, validation) => {
112
122
// Default name to test title
113
123
114
124
if ( useAppli ) {
125
+ cy . log ( 'Check eyes 2' + Cypress . spec . name ) ;
115
126
cy . eyesCheckWindow ( 'Click!' ) ;
127
+ cy . log ( 'Closing eyes 2' + Cypress . spec . name ) ;
116
128
cy . eyesClose ( ) ;
117
129
} else {
118
130
cy . matchImageSnapshot ( name ) ;
0 commit comments