diff --git a/cypress/support/commands.js b/cypress/support/commands.js index 9a06d3bd14..65f76d6a8f 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -172,7 +172,7 @@ Cypress.Commands.add('openContextEditModal', (title) => { Cypress.Commands.add('clickOnTableThreeDotMenu', (optionName) => { cy.get('[data-cy="customTableAction"] button').click() - cy.get('[data-cy="dataTableExportBtn"]').contains(optionName).click({ force: true }) + cy.get('.v-popper__popper button, [role="menuitem"]').contains(optionName).click({ force: true }) }) Cypress.Commands.add('sortTableColumn', (columnTitle, mode = 'ASC') => { diff --git a/playwright/e2e/tables-export-csv.spec.ts b/playwright/e2e/tables-export-csv.spec.ts index 5f61e6fb93..3a10c47167 100644 --- a/playwright/e2e/tables-export-csv.spec.ts +++ b/playwright/e2e/tables-export-csv.spec.ts @@ -5,20 +5,46 @@ import { test, expect } from '../support/fixtures' import * as fs from 'fs' +import { type Page } from '@playwright/test' import { clickOnTableThreeDotMenu, getTutorialTableName, loadTable } from '../support/commands' -test.describe('Import csv', () => { +async function fillSearchInput(page: Page, value: string) { + // Scope to the NcTable container to avoid matching Nextcloud header search elements + const searchInput = page.locator('[data-cy="ncTable"]').getByRole('textbox', { name: 'Search' }) + await expect(searchInput).toBeVisible({ timeout: 10000 }) + await searchInput.fill(value) + await page.waitForTimeout(600) // debounce in SearchForm is 500 ms +} - test('Export csv', async ({ userPage: { page } }) => { +async function clickSelectionBarAction(page: Page, label: string) { + await expect(page.locator('.icon-loading').first()).toBeHidden({ timeout: 10000 }) + await expect(page.locator('.selected-rows-option')).toBeVisible({ timeout: 10000 }) + // NcActionButton does not forward data-cy to the DOM; match by button text content instead. + // With inline=2 the items render as plain