2019-11-23 13:02:51 +00:00
|
|
|
export const approveStorage = () => {
|
2021-12-28 14:02:29 +00:00
|
|
|
cy.get('#storage_ok').click()
|
|
|
|
}
|
2019-11-23 13:02:51 +00:00
|
|
|
|
2019-12-23 10:34:28 +00:00
|
|
|
export const visitAndApproveStorage = () => {
|
2021-12-28 14:02:29 +00:00
|
|
|
cy.visit('/instrumented/editor/index.html')
|
|
|
|
approveStorage()
|
|
|
|
}
|
2019-12-23 10:34:28 +00:00
|
|
|
|
2019-11-23 13:02:51 +00:00
|
|
|
export const openMainMenu = () => {
|
2021-12-28 14:02:29 +00:00
|
|
|
return cy.get('#main_button').click({ force: true })
|
|
|
|
}
|
2019-11-23 13:02:51 +00:00
|
|
|
|
|
|
|
export const openEditorPreferences = () => {
|
2021-12-28 14:02:29 +00:00
|
|
|
openMainMenu()
|
|
|
|
return cy.get('#tool_editor_prefs').click()
|
|
|
|
}
|
2019-12-23 10:34:28 +00:00
|
|
|
|
|
|
|
export const selectEnglish = () => {
|
2021-12-28 14:02:29 +00:00
|
|
|
openEditorPreferences()
|
|
|
|
cy.get('#lang_select').select('en')
|
|
|
|
cy.get('#tool_prefs_save').click()
|
|
|
|
}
|
2021-12-30 08:29:49 +00:00
|
|
|
|
|
|
|
export const testSnapshot = () => {
|
|
|
|
cy.window().then((win) => { // access to the remote Window so we can get the svgEditor variable
|
2021-12-30 10:38:10 +00:00
|
|
|
const svgString = win.svgEditor.svgCanvas.getSvgString()
|
|
|
|
const svgDom = new DOMParser().parseFromString(svgString, 'text/html').querySelector('body')
|
|
|
|
cy.wrap(svgDom).toMatchSnapshot()
|
2021-12-30 08:29:49 +00:00
|
|
|
})
|
|
|
|
}
|