From 7e374c258e0cdb2b1e8cd17e5bdbe156d9963e07 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Wed, 3 Jul 2024 01:47:14 +0200 Subject: [PATCH] test: test:e2e --- src/pages/Entry/EntryBuysTableDialog.vue | 1 + src/pages/Entry/MyEntries.vue | 2 +- .../cypress/integration/entry/myEntry.spec.js | 20 +++++++++++++++++++ test/cypress/support/commands.js | 5 ++--- 4 files changed, 24 insertions(+), 4 deletions(-) create mode 100644 test/cypress/integration/entry/myEntry.spec.js diff --git a/src/pages/Entry/EntryBuysTableDialog.vue b/src/pages/Entry/EntryBuysTableDialog.vue index c6ab4033c..02976f9a0 100644 --- a/src/pages/Entry/EntryBuysTableDialog.vue +++ b/src/pages/Entry/EntryBuysTableDialog.vue @@ -88,6 +88,7 @@ const entriesTableColumns = computed(() => [ {
{ + beforeEach(() => { + cy.viewport(1920, 1080); + cy.login('developer'); + cy.visit(`/#/entry/my`, { + onBeforeLoad(win) { + cy.stub(win, 'open'); + }, + }); + cy.waitForElement('.q-page', 6000); + }); + + it('should create edit and remove new dms', () => { + cy.get( + '[to="/null/2"] > .q-card > .column > .q-btn > .q-btn__content > .q-icon' + ).click(); + cy.get('.q-card__actions > .q-btn').click(); + cy.window().its('open').should('be.called'); + }); +}); diff --git a/test/cypress/support/commands.js b/test/cypress/support/commands.js index 240a97908..4ed940ecd 100755 --- a/test/cypress/support/commands.js +++ b/test/cypress/support/commands.js @@ -50,8 +50,8 @@ Cypress.Commands.add('login', (user) => { }); }); -Cypress.Commands.add('waitForElement', (element) => { - cy.get(element, { timeout: 5000 }).should('be.visible'); +Cypress.Commands.add('waitForElement', (element, timeout = 5000) => { + cy.get(element, { timeout }).should('be.visible'); }); Cypress.Commands.add('getValue', (selector) => { @@ -241,4 +241,3 @@ Cypress.Commands.add('validateContent', (selector, expectedValue) => { Cypress.Commands.add('openActionsDescriptor', () => { cy.get('.descriptor > .header > .q-btn').click(); }); -// registerCommands();