From a8a6e003abfa82dc934866da45e7bd3e01fb6b10 Mon Sep 17 00:00:00 2001 From: Max Date: Mon, 28 Aug 2023 08:20:27 +0200 Subject: [PATCH] fix(cy): use flexible selector for file list in Nextcloud 25-28 Signed-off-by: Max Signed-off-by: Jonas --- cypress/e2e/apps.spec.js | 2 +- cypress/e2e/collective.spec.js | 15 ++++++++------- cypress/e2e/settings.spec.js | 2 +- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/cypress/e2e/apps.spec.js b/cypress/e2e/apps.spec.js index 1dc94a4e0..eb5e1d6ce 100644 --- a/cypress/e2e/apps.spec.js +++ b/cypress/e2e/apps.spec.js @@ -51,7 +51,7 @@ describe('The apps', function() { it('Renders the default files list', function() { cy.login('jane', { route: 'apps/files' }) - cy.get('.files-fileList tr').should('contain', 'welcome.txt') + cy.get('.files-fileList tr, .files-list__tbody tr').should('contain', 'welcome.txt') }) }) diff --git a/cypress/e2e/collective.spec.js b/cypress/e2e/collective.spec.js index f74aa4118..c877a9070 100644 --- a/cypress/e2e/collective.spec.js +++ b/cypress/e2e/collective.spec.js @@ -46,15 +46,16 @@ describe('Collective', function() { cy.login('bob', { route: '/apps/files' }) }) it('has a matching folder', function() { - const fileListSelector = '.files-fileList' - const controlsSelector = '.files-controls' + const fileListSelector = '.files-fileList a, [data-cy-files-list-row] a' + const breadcrumbsSelector = '.files-controls .breadcrumb, [data-cy-files-content-breadcrumbs] a' cy.get(fileListSelector).should('contain', 'Collectives') - cy.get(`${fileListSelector} a`).contains('Collectives').click() - cy.get(`${controlsSelector} .breadcrumb`).should('contain', 'Collectives') + cy.get(fileListSelector).contains('Collectives').click() + cy.get(breadcrumbsSelector).should('contain', 'Collectives') cy.get(fileListSelector).should('contain', 'Preexisting Collective') - cy.get(`${fileListSelector} a`).contains('Preexisting Collective').click() - cy.get(`${controlsSelector} .breadcrumb`).should('contain', 'Preexisting Collective') - cy.get(fileListSelector).should('contain', 'Readme.md') + cy.get(fileListSelector).contains('Preexisting Collective').click() + cy.get(breadcrumbsSelector).should('contain', 'Preexisting Collective') + cy.get(fileListSelector).should('contain', 'Readme') + cy.get(fileListSelector).should('contain', '.md') cy.get('.filelist-collectives-wrapper') .should('contain', 'The content of this folder is best viewed in the Collectives app.') }) diff --git a/cypress/e2e/settings.spec.js b/cypress/e2e/settings.spec.js index b3a2c3b7d..688db6e62 100644 --- a/cypress/e2e/settings.spec.js +++ b/cypress/e2e/settings.spec.js @@ -65,7 +65,7 @@ describe('Settings', function() { .click() cy.get('input[name="userFolder"]') .click() - cy.get('[data-dir=""] > a') + cy.get('[data-dir=""] > a, a[title="Home"]') .click() cy.get('tr[data-entryname="Collectives"]') .click()