Updating cypress tests

This commit is contained in:
Knut Sveidqvist
2019-09-18 18:25:06 +02:00
parent 23e6df04d4
commit 21622f575b
11 changed files with 175 additions and 116 deletions

View File

@@ -1,28 +1,28 @@
/* eslint-env jest */
import { Base64 } from 'js-base64'
import { Base64 } from 'js-base64';
export const mermaidUrl = (graphStr, options, api) => {
const obj = {
code: graphStr,
mermaid: options
}
const objStr = JSON.stringify(obj)
let url = 'http://localhost:9000/e2e.html?graph=' + Base64.encodeURI(objStr)
};
const objStr = JSON.stringify(obj);
let url = 'http://localhost:9000/e2e.html?graph=' + Base64.encodeURI(objStr);
if (api) {
url = 'http://localhost:9000/xss.html?graph=' + graphStr
url = 'http://localhost:9000/xss.html?graph=' + graphStr;
}
if (options.listUrl) {
cy.log(options.listId, ' ', url)
cy.log(options.listId, ' ', url);
}
return url
}
return url;
};
export const imgSnapshotTest = (graphStr, options, api) => {
const url = mermaidUrl(graphStr, options, api)
export const imgSnapshotTest = (graphStr, options, api) => {
const url = mermaidUrl(graphStr, options, api);
cy.visit(url);
cy.get('svg')
cy.percySnapshot()
}
cy.get('svg');
cy.percySnapshot();
};