2021-02-23 07:02:15 +00:00
|
|
|
import './commands';
|
2022-10-31 13:23:49 -07:00
|
|
|
|
2023-01-07 22:27:01 -08:00
|
|
|
Cypress.Commands.add('waitForEditorLoaded', () => {
|
|
|
|
// Wait editor ...
|
|
|
|
cy.get('svg > path').should('be.visible');
|
|
|
|
cy.get('[aria-label="vortex-loading"]', { timeout: 120000 }).should('not.exist');
|
|
|
|
cy.clearLocalStorage('welcome-xml');
|
|
|
|
|
|
|
|
// Wait for font ...
|
|
|
|
cy.document().its('fonts.status').should('equal', 'loaded');
|
|
|
|
});
|
|
|
|
|
|
|
|
Cypress.Commands.add('waitForPageLoaded', () => {
|
|
|
|
// Wait page be loaded...
|
|
|
|
cy.document().its('fonts.status').should('equal', 'loaded');
|
|
|
|
});
|
|
|
|
|
2022-10-31 13:23:49 -07:00
|
|
|
Cypress.on('window:before:load', (win) => {
|
|
|
|
cy.spy(win.console, 'error');
|
|
|
|
cy.spy(win.console, 'warn');
|
|
|
|
});
|
|
|
|
|
|
|
|
afterEach(() => {
|
|
|
|
cy.window().then((win) => {
|
|
|
|
expect(win.console.error).to.have.callCount(0);
|
2022-11-02 21:06:29 -07:00
|
|
|
expect(win.console.warn).to.have.callCount(0);
|
2022-10-31 13:23:49 -07:00
|
|
|
});
|
|
|
|
});
|