diff options
author | Ferdinand Thiessen <opensource@fthiessen.de> | 2024-07-25 19:14:02 +0200 |
---|---|---|
committer | Ferdinand Thiessen <opensource@fthiessen.de> | 2024-07-25 19:33:28 +0200 |
commit | 2c0e2cc09e09e958770fd89553649646e897fc45 (patch) | |
tree | 9576ea89ca6c4b4e8500326bfb22a001c3b0ba2b /cypress/pages/FilesFilters.ts | |
parent | 1fc6b79f7c6c4dd2a0361abfe5c2632de0e2f131 (diff) | |
download | nextcloud-server-2c0e2cc09e09e958770fd89553649646e897fc45.tar.gz nextcloud-server-2c0e2cc09e09e958770fd89553649646e897fc45.zip |
test: Add cypress tests for file list filtering
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Diffstat (limited to 'cypress/pages/FilesFilters.ts')
-rw-r--r-- | cypress/pages/FilesFilters.ts | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/cypress/pages/FilesFilters.ts b/cypress/pages/FilesFilters.ts new file mode 100644 index 00000000000..036530f1e8a --- /dev/null +++ b/cypress/pages/FilesFilters.ts @@ -0,0 +1,34 @@ +/*! + * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors + * SPDX-License-Identifier: AGPL-3.0-or-later + */ + +/** + * Page object model for the files filters + */ +export class FilesFilterPage { + + filterContainter() { + return cy.get('[data-cy-files-filters]') + } + + activeFiltersList() { + return cy.findByRole('list', { name: 'Active filters' }) + } + + activeFilters() { + return this.activeFiltersList().findAllByRole('listitem') + } + + removeFilter(name: string | RegExp) { + const el = typeof name === 'string' + ? this.activeFilters().should('contain.text', name) + : this.activeFilters().should('match', name) + el.should('exist') + // click the button + el.findByRole('button', { name: 'Remove filter' }) + .should('exist') + .click({ force: true }) + } + +} |