Skip to content

Commit ba7f830

Browse files
committed
Fixing applitools batches
1 parent 97a7f1f commit ba7f830

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

applitools.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ module.exports = defineConfig({
1515
// { deviceName: 'Pixel 2', screenOrientation: 'portrait' },
1616
],
1717
// set batch name to the configuration
18-
batchName: `Mermaid ${process.env.APPLI_BRANCH ?? "'no APPLI_BRANCH set'"}`,
18+
// batchName: `Mermaid ${process.env.APPLI_BRANCH ?? "'no APPLI_BRANCH set'"}`,
1919
});

cypress/helpers/util.js

+12
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ const utf8ToB64 = (str) => {
22
return window.btoa(unescape(encodeURIComponent(str)));
33
};
44

5+
const batchId = 'mermid-batch' + new Date().getTime();
6+
57
export const mermaidUrl = (graphStr, options, api) => {
68
const obj = {
79
code: graphStr,
@@ -50,9 +52,12 @@ export const imgSnapshotTest = (graphStr, _options, api = false, validation) =>
5052
const name = (options.name || cy.state('runnable').fullTitle()).replace(/\s+/g, '-');
5153

5254
if (useAppli) {
55+
cy.log('Opening eyes ' + Cypress.spec.name + ' --- ' + name);
5356
cy.eyesOpen({
5457
appName: 'Mermaid',
5558
testName: name,
59+
batchName: Cypress.spec.name,
60+
batchId: batchId + Cypress.spec.name,
5661
});
5762
}
5863

@@ -64,7 +69,9 @@ export const imgSnapshotTest = (graphStr, _options, api = false, validation) =>
6469
// Default name to test title
6570

6671
if (useAppli) {
72+
cy.log('Check eyes' + Cypress.spec.name);
6773
cy.eyesCheckWindow('Click!');
74+
cy.log('Closing eyes: ' + Cypress.spec.name);
6875
cy.eyesClose();
6976
} else {
7077
cy.matchImageSnapshot(name);
@@ -100,9 +107,12 @@ export const urlSnapshotTest = (url, _options, api = false, validation) => {
100107
const name = (options.name || cy.state('runnable').fullTitle()).replace(/\s+/g, '-');
101108

102109
if (useAppli) {
110+
cy.log('Opening eyes 2' + Cypress.spec.name);
103111
cy.eyesOpen({
104112
appName: 'Mermaid',
105113
testName: name,
114+
batchName: Cypress.spec.name,
115+
batchId: batchId + Cypress.spec.name,
106116
});
107117
}
108118

@@ -112,7 +122,9 @@ export const urlSnapshotTest = (url, _options, api = false, validation) => {
112122
// Default name to test title
113123

114124
if (useAppli) {
125+
cy.log('Check eyes 2' + Cypress.spec.name);
115126
cy.eyesCheckWindow('Click!');
127+
cy.log('Closing eyes 2' + Cypress.spec.name);
116128
cy.eyesClose();
117129
} else {
118130
cy.matchImageSnapshot(name);

0 commit comments

Comments
 (0)