From 823e7f5e141d879b17231844e6f03c3488d4aef5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Thu, 27 Jun 2024 09:32:43 +0200 Subject: [PATCH] fix cypress MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- cypress/e2e/column-number-progress.cy.js | 2 ++ cypress/e2e/column-selection-check.cy.js | 10 ++++------ cypress/e2e/tables-table.cy.js | 2 +- cypress/support/commands.js | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/cypress/e2e/column-number-progress.cy.js b/cypress/e2e/column-number-progress.cy.js index 69996690e..d634dab1f 100644 --- a/cypress/e2e/column-number-progress.cy.js +++ b/cypress/e2e/column-number-progress.cy.js @@ -8,6 +8,8 @@ describe('Test column progress', () => { cy.createRandomUser().then(user => { localUser = user cy.login(localUser) + cy.visit('apps/tables') + cy.createTable(tableTitle) }) }) diff --git a/cypress/e2e/column-selection-check.cy.js b/cypress/e2e/column-selection-check.cy.js index d0686022a..dbb018c6a 100644 --- a/cypress/e2e/column-selection-check.cy.js +++ b/cypress/e2e/column-selection-check.cy.js @@ -8,6 +8,8 @@ describe('Test column ' + columnTitle, () => { cy.createRandomUser().then(user => { localUser = user cy.login(localUser) + cy.visit('apps/tables') + cy.createTable(tableTitle) }) }) @@ -16,10 +18,6 @@ describe('Test column ' + columnTitle, () => { cy.visit('apps/tables') }) - it('Table and column setup', () => { - cy.createTable(tableTitle) - }) - it('Insert and test rows - default value unchecked', () => { cy.loadTable(tableTitle) cy.createSelectionCheckColumn(columnTitle, null, true) @@ -31,7 +29,7 @@ describe('Test column ' + columnTitle, () => { // insert row cy.get('button').contains('Create row').click() - cy.get('[data-cy="selectionCheckFormSwitch"]').first().click() + cy.get('[data-cy="selectionCheckFormSwitch"]').first().click({ force: true }) cy.get('button').contains('Save').click() cy.get('.custom-table table tr td div .material-design-icon.check-circle-outline-icon').should('be.visible') @@ -49,7 +47,7 @@ describe('Test column ' + columnTitle, () => { // insert row cy.get('button').contains('Create row').click() - cy.get('[data-cy="selectionCheckFormSwitch"]').first().click() + cy.get('[data-cy="selectionCheckFormSwitch"]').first().click({ force: true }) cy.get('button').contains('Save').click() cy.get('.custom-table table tr td div .material-design-icon.radiobox-blank-icon').should('be.visible') diff --git a/cypress/e2e/tables-table.cy.js b/cypress/e2e/tables-table.cy.js index fc4d6e54f..d358594f5 100644 --- a/cypress/e2e/tables-table.cy.js +++ b/cypress/e2e/tables-table.cy.js @@ -44,7 +44,7 @@ describe('Manage a table', () => { cy.get('.modal__content button').contains('Select from Files').click() cy.get('.file-picker__files').contains('test-import').click() - cy.get('.file-picker button span').contains('Choose test-import.csv').click() + cy.get('.file-picker button span').contains('Import').click() cy.get('.modal__content button').contains('Import').click() cy.get('[data-cy="importResultColumnsFound"]').should('contain.text', '4') cy.get('[data-cy="importResultColumnsMatch"]').should('contain.text', '0') diff --git a/cypress/support/commands.js b/cypress/support/commands.js index cee88c6d5..ea5a0581b 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -192,7 +192,7 @@ Cypress.Commands.add('createDatetimeDateColumn', (title, setNow, firstColumn) => cy.get('.modal-container').get('input[placeholder*="Enter a column title"]').clear().type(title) cy.get('.columnTypeSelection .vs__open-indicator').click({ force: true }) cy.get('.multiSelectOptionLabel').contains('Date and time').click({ force: true }) - cy.get('[data-cy="createColumnDateSwitch"]').contains('Date').click({ force: true }) + cy.get('[data-cy="createColumnDateSwitch"]').parent().contains('Date').click({ force: true }) if (setNow) { cy.get('[data-cy="datetimeDateFormTodaySwitch"]').click({ force: true }) @@ -209,7 +209,7 @@ Cypress.Commands.add('createDatetimeTimeColumn', (title, setNow, firstColumn) => cy.get('.modal-container').get('input[placeholder*="Enter a column title"]').clear().type(title) cy.get('.columnTypeSelection .vs__open-indicator').click({ force: true }) cy.get('.multiSelectOptionLabel').contains('Date and time').click({ force: true }) - cy.get('[data-cy="createColumnTimeSwitch"]').contains('Time').click({ force: true }) + cy.get('[data-cy="createColumnTimeSwitch"]').parent().contains('Time').click({ force: true }) if (setNow) { cy.get('[data-cy="datetimeTimeFormNowSwitch"]').click({ force: true })