mirror of
https://github.com/nextcloud/server.git
synced 2026-06-04 14:24:59 -04:00
fix(cypress): flaky live photo test grid_view trigger issue
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
This commit is contained in:
parent
d4ce30764a
commit
43b3ad13e0
2 changed files with 20 additions and 8 deletions
|
|
@ -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')
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue