aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorskjnldsv <skjnldsv@protonmail.com>2025-01-03 10:24:30 +0100
committerskjnldsv <skjnldsv@protonmail.com>2025-01-03 10:24:30 +0100
commit43b3ad13e085f031a909c79c9d5cc368c1da923b (patch)
treedffc990f9fc128aa55f31c8f110dd7ffc57e4524
parentd4ce30764a7789725371f9978f292c52b3707c66 (diff)
downloadnextcloud-server-43b3ad13e085f031a909c79c9d5cc368c1da923b.tar.gz
nextcloud-server-43b3ad13e085f031a909c79c9d5cc368c1da923b.zip
fix(cypress): flaky live photo test grid_view trigger issue
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
-rw-r--r--cypress/e2e/files/FilesUtils.ts6
-rw-r--r--cypress/e2e/files/LivePhotosUtils.ts22
2 files changed, 20 insertions, 8 deletions
diff --git a/cypress/e2e/files/FilesUtils.ts b/cypress/e2e/files/FilesUtils.ts
index 932897918de..37c2b1eff7e 100644
--- a/cypress/e2e/files/FilesUtils.ts
+++ b/cypress/e2e/files/FilesUtils.ts
@@ -208,3 +208,9 @@ export const triggerFileListAction = (actionId: string) => {
cy.get(`button[data-cy-files-list-action="${CSS.escape(actionId)}"]`).last()
.should('exist').click({ force: true })
}
+
+export const reloadCurrentFolder = () => {
+ cy.intercept('PROPFIND', /\/remote.php\/dav\//).as('propfind')
+ cy.get('[data-cy-files-content-breadcrumbs]').findByRole('button', { description: 'Reload current directory' }).click()
+ cy.wait('@propfind')
+}
diff --git a/cypress/e2e/files/LivePhotosUtils.ts b/cypress/e2e/files/LivePhotosUtils.ts
index 6b0015affce..9b4f1dbbf3f 100644
--- a/cypress/e2e/files/LivePhotosUtils.ts
+++ b/cypress/e2e/files/LivePhotosUtils.ts
@@ -49,14 +49,20 @@ function setMetadata(user: User, fileName: string, requesttoken: string, metadat
* @param enable
*/
export function setShowHiddenFiles(enable: boolean) {
- cy.get('[data-cy-files-navigation-settings-button]').click()
- // Force:true because the checkbox is hidden by the pretty UI.
- if (enable) {
- cy.get('[data-cy-files-settings-setting="show_hidden"] input').check({ force: true })
- } else {
- cy.get('[data-cy-files-settings-setting="show_hidden"] input').uncheck({ force: true })
- }
- cy.get('[data-cy-files-navigation-settings]').type('{esc}')
+ cy.request('/csrftoken').then(({ body }) => {
+ const requestToken = body.token
+ const url = `${Cypress.config('baseUrl')}/apps/files/api/v1/config/show_hidden`
+ cy.request({
+ method: 'PUT',
+ url,
+ headers: {
+ 'Content-Type': 'application/json',
+ requesttoken: requestToken,
+ },
+ body: { value: enable },
+ })
+ })
+ cy.reload()
}
/**