From e6b68bb5597ab5cb7208b8b31f3556d742151c54 Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Wed, 15 Jan 2025 10:53:09 +0100 Subject: [PATCH] fixup! feat(Templates): extend the tutorial table --- cypress/e2e/tables-export-csv.cy.js | 2 +- cypress/e2e/tables-favorite.cy.js | 8 ++++---- cypress/support/commands.js | 5 ----- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/cypress/e2e/tables-export-csv.cy.js b/cypress/e2e/tables-export-csv.cy.js index fa572fc60..14b45d978 100644 --- a/cypress/e2e/tables-export-csv.cy.js +++ b/cypress/e2e/tables-export-csv.cy.js @@ -19,7 +19,7 @@ describe('Import csv', () => { it('Export csv', () => { console.log('before table load') - cy.loadTutorialTable() + cy.loadTable('Welcome to Nextcloud Tables!')() console.log('before click') cy.clickOnTableThreeDotMenu('Export as CSV') const hour = new Date().getHours().toString().length < 2 ? '0' + new Date().getHours() : new Date().getHours().toString() diff --git a/cypress/e2e/tables-favorite.cy.js b/cypress/e2e/tables-favorite.cy.js index c61bc32fb..ccc9b853d 100644 --- a/cypress/e2e/tables-favorite.cy.js +++ b/cypress/e2e/tables-favorite.cy.js @@ -21,7 +21,7 @@ describe('Favorite tables/views', () => { it('can favorite tables', () => { cy.get('[data-cy="navigationTableItem"]').first().as('tutorialTable') - cy.get('@tutorialTable').should('contain.text', 'Welcome to ') + cy.get('@tutorialTable').should('contain.text', 'Welcome to Nextcloud Tables!') cy.get('@tutorialTable').find('[aria-haspopup="menu"]').first().click({ force: true }) cy.intercept({ method: 'POST', url: '**/ocs/v2.php/apps/tables/api/2/favorites/*/*'}).as('favoriteTableReq') @@ -34,7 +34,7 @@ describe('Favorite tables/views', () => { it('can remove favorite table', () => { cy.get('[data-cy="navigationTableItem"]').first().as('tutorialTable') - cy.get('@tutorialTable').should('contain.text', 'Welcome to ') + cy.get('@tutorialTable').should('contain.text', 'Welcome to Nextcloud Tables!') cy.get('@tutorialTable').find('[aria-haspopup="menu"]').first().click({ force: true }) cy.intercept({ method: 'DELETE', url: '**/ocs/v2.php/apps/tables/api/2/favorites/*/*' }).as('unfavoriteTableReq') @@ -45,7 +45,7 @@ describe('Favorite tables/views', () => { }) it('can favorite views', () => { - cy.loadTutorialTable + cy.loadTable('Welcome to Nextcloud Tables!') cy.get('[data-cy="navigationViewItem"]').first().as('testView') @@ -82,7 +82,7 @@ describe('Favorite tables/views', () => { cy.get('@testView').parent().should('contain.text', 'Favorites') - cy.get('@tutorialTable').should('contain.text', 'Welcome to ') + cy.get('@tutorialTable').should('contain.text', 'Welcome to Nextcloud Tables!') cy.get('@tutorialTable').find('[aria-haspopup="menu"]').first().click({ force: true }) cy.contains('Add to favorites').click({ force: true }) diff --git a/cypress/support/commands.js b/cypress/support/commands.js index 236fe08c8..13a02095d 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -145,11 +145,6 @@ Cypress.Commands.add('loadTable', (name) => { cy.get('[data-cy="navigationTableItem"] a[title="' + name + '"]').click({ force: true }) }) -// The name depends on the instance name, Nextcloud might be overwritten -Cypress.Commands.add('loadTutorialTable', () => { - cy.get('[data-cy="navigationTableItem"] a[title^="Welcome to"]').click({ force: true }) -}) - Cypress.Commands.add('getTutorialTableName', () => { return cy.get('[data-cy="navigationTableItem"] a[title^="Welcome to"]').invoke('attr', 'title').then((title) => { return cy.wrap(title)