mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
Merge pull request #50025 from nextcloud/fix/flaky-cypress
This commit is contained in:
commit
99147b8747
4 changed files with 28 additions and 12 deletions
8
.github/workflows/cypress.yml
vendored
8
.github/workflows/cypress.yml
vendored
|
|
@ -142,12 +142,14 @@ jobs:
|
|||
SPLIT: ${{ matrix.total-containers }}
|
||||
SPLIT_INDEX: ${{ matrix.containers == 'component' && 0 || matrix.containers }}
|
||||
|
||||
- name: Upload snapshots
|
||||
- name: Upload snapshots and videos
|
||||
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
|
||||
if: always()
|
||||
with:
|
||||
name: snapshots_${{ matrix.containers }}
|
||||
path: cypress/snapshots
|
||||
name: snapshots_videos_${{ matrix.containers }}
|
||||
path: |
|
||||
cypress/snapshots
|
||||
cypress/videos
|
||||
|
||||
- name: Extract NC logs
|
||||
if: failure() && matrix.containers != 'component'
|
||||
|
|
|
|||
|
|
@ -34,8 +34,10 @@ export default defineConfig({
|
|||
// Needed to trigger `after:run` events with cypress open
|
||||
experimentalInteractiveRunEvents: true,
|
||||
|
||||
// disabled if running in CI but enabled in debug mode
|
||||
video: !process.env.CI || !!process.env.RUNNER_DEBUG,
|
||||
|
||||
// faster video processing
|
||||
video: !process.env.CI,
|
||||
videoCompression: false,
|
||||
|
||||
// Prevent elements to be scrolled under a top bar during actions (click, clear, type, etc). Default is 'top'.
|
||||
|
|
|
|||
|
|
@ -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