mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-08-16 06:49:31 +02:00
Fixing applitools batches
This commit is contained in:
@@ -15,5 +15,5 @@ module.exports = defineConfig({
|
|||||||
// { deviceName: 'Pixel 2', screenOrientation: 'portrait' },
|
// { deviceName: 'Pixel 2', screenOrientation: 'portrait' },
|
||||||
],
|
],
|
||||||
// set batch name to the configuration
|
// set batch name to the configuration
|
||||||
batchName: `Mermaid ${process.env.APPLI_BRANCH ?? "'no APPLI_BRANCH set'"}`,
|
// batchName: `Mermaid ${process.env.APPLI_BRANCH ?? "'no APPLI_BRANCH set'"}`,
|
||||||
});
|
});
|
||||||
|
@@ -2,6 +2,8 @@ const utf8ToB64 = (str) => {
|
|||||||
return window.btoa(unescape(encodeURIComponent(str)));
|
return window.btoa(unescape(encodeURIComponent(str)));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const batchId = 'mermid-batch' + new Date().getTime();
|
||||||
|
|
||||||
export const mermaidUrl = (graphStr, options, api) => {
|
export const mermaidUrl = (graphStr, options, api) => {
|
||||||
const obj = {
|
const obj = {
|
||||||
code: graphStr,
|
code: graphStr,
|
||||||
@@ -49,9 +51,12 @@ export const imgSnapshotTest = (graphStr, _options, api = false, validation) =>
|
|||||||
const name = (options.name || cy.state('runnable').fullTitle()).replace(/\s+/g, '-');
|
const name = (options.name || cy.state('runnable').fullTitle()).replace(/\s+/g, '-');
|
||||||
|
|
||||||
if (useAppli) {
|
if (useAppli) {
|
||||||
|
cy.log('Opening eyes ' + Cypress.spec.name + ' --- ' + name);
|
||||||
cy.eyesOpen({
|
cy.eyesOpen({
|
||||||
appName: 'Mermaid',
|
appName: 'Mermaid',
|
||||||
testName: name,
|
testName: name,
|
||||||
|
batchName: Cypress.spec.name,
|
||||||
|
batchId: batchId + Cypress.spec.name,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -65,7 +70,9 @@ export const imgSnapshotTest = (graphStr, _options, api = false, validation) =>
|
|||||||
// Default name to test title
|
// Default name to test title
|
||||||
|
|
||||||
if (useAppli) {
|
if (useAppli) {
|
||||||
|
cy.log('Check eyes' + Cypress.spec.name);
|
||||||
cy.eyesCheckWindow('Click!');
|
cy.eyesCheckWindow('Click!');
|
||||||
|
cy.log('Closing eyes: ' + Cypress.spec.name);
|
||||||
cy.eyesClose();
|
cy.eyesClose();
|
||||||
} else {
|
} else {
|
||||||
cy.matchImageSnapshot(name);
|
cy.matchImageSnapshot(name);
|
||||||
@@ -101,9 +108,12 @@ export const urlSnapshotTest = (url, _options, api = false, validation) => {
|
|||||||
const name = (options.name || cy.state('runnable').fullTitle()).replace(/\s+/g, '-');
|
const name = (options.name || cy.state('runnable').fullTitle()).replace(/\s+/g, '-');
|
||||||
|
|
||||||
if (useAppli) {
|
if (useAppli) {
|
||||||
|
cy.log('Opening eyes 2' + Cypress.spec.name);
|
||||||
cy.eyesOpen({
|
cy.eyesOpen({
|
||||||
appName: 'Mermaid',
|
appName: 'Mermaid',
|
||||||
testName: name,
|
testName: name,
|
||||||
|
batchName: Cypress.spec.name,
|
||||||
|
batchId: batchId + Cypress.spec.name,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -115,7 +125,9 @@ export const urlSnapshotTest = (url, _options, api = false, validation) => {
|
|||||||
// Default name to test title
|
// Default name to test title
|
||||||
|
|
||||||
if (useAppli) {
|
if (useAppli) {
|
||||||
|
cy.log('Check eyes 2' + Cypress.spec.name);
|
||||||
cy.eyesCheckWindow('Click!');
|
cy.eyesCheckWindow('Click!');
|
||||||
|
cy.log('Closing eyes 2' + Cypress.spec.name);
|
||||||
cy.eyesClose();
|
cy.eyesClose();
|
||||||
} else {
|
} else {
|
||||||
cy.matchImageSnapshot(name);
|
cy.matchImageSnapshot(name);
|
||||||
|
Reference in New Issue
Block a user