From a531b8aeee82d7da80872dcb9307bab0e23b8d50 Mon Sep 17 00:00:00 2001 From: syuilo Date: Tue, 9 May 2023 07:49:53 +0900 Subject: [PATCH] refactor for e2e --- cypress/e2e/widgets.cy.js | 14 +++++++------- packages/frontend/src/components/MkWidgets.vue | 4 ++-- packages/frontend/src/ui/universal.widgets.vue | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/cypress/e2e/widgets.cy.js b/cypress/e2e/widgets.cy.js index a39ea85e1d..88e19030c1 100644 --- a/cypress/e2e/widgets.cy.js +++ b/cypress/e2e/widgets.cy.js @@ -19,26 +19,26 @@ describe('After user signed in', () => { }); it('widget edit toggle is visible', () => { - cy.get('.mk-widget-edit').should('be.visible'); + cy.get('[data-cy-widget-edit]').should('be.visible'); }); it('widget select should be visible in edit mode', () => { - cy.get('.mk-widget-edit').click(); - cy.get('.mk-widget-select').should('be.visible'); + cy.get('[data-cy-widget-edit]').click(); + cy.get('[data-cy-widget-select]').should('be.visible'); }); it('first widget should be removed', () => { - cy.get('.mk-widget-edit').click(); + cy.get('[data-cy-widget-edit]').click(); cy.get('[data-cy-customize-container]:first-child [data-cy-customize-container-remove]._button').click(); cy.get('[data-cy-customize-container]').should('have.length', 2); }); function buildWidgetTest(widgetName) { it(`${widgetName} widget should get added`, () => { - cy.get('.mk-widget-edit').click(); - cy.get('.mk-widget-select select').select(widgetName, { force: true }); + cy.get('[data-cy-widget-edit]').click(); + cy.get('[data-cy-widget-select] select').select(widgetName, { force: true }); cy.get('[data-cy-bg]._modalBg[data-cy-transparent]').click({ multiple: true, force: true }); - cy.get('.mk-widget-add').click({ force: true }); + cy.get('[data-cy-widget-add]').click({ force: true }); cy.get(`[data-cy-mkw-${widgetName}]`).should('exist'); }); } diff --git a/packages/frontend/src/components/MkWidgets.vue b/packages/frontend/src/components/MkWidgets.vue index d074fdd150..33e594acd8 100644 --- a/packages/frontend/src/components/MkWidgets.vue +++ b/packages/frontend/src/components/MkWidgets.vue @@ -2,11 +2,11 @@