aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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()
}
/**