svgedit/cypress/support/ui-test-helper.js

31 lines
788 B
JavaScript
Raw Normal View History

export const approveStorage = () => {
cy.get('#storage_ok').click()
}
export const visitAndApproveStorage = () => {
cy.visit('/instrumented/editor/index.html')
approveStorage()
}
export const openMainMenu = () => {
return cy.get('#main_button').click({ force: true })
}
export const openEditorPreferences = () => {
openMainMenu()
return cy.get('#tool_editor_prefs').click()
}
export const selectEnglish = () => {
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
const svgContent = win.svgEditor.svgCanvas.getSvgString()
cy.wrap(unescape(svgContent)).toMatchSnapshot()
})
}