Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ jobs:
matrix:
# Run multiple copies of the current job in parallel
# Please increase the number or runners as your tests suite grows
containers: ['1', '2', '3']
containers: ['1', '2']

name: runner ${{ matrix.containers }}

Expand Down Expand Up @@ -138,19 +138,21 @@ jobs:
CYPRESS_BUILD_ID: ${{ github.sha }}-${{ github.run_number }}
CYPRESS_GROUP: Run ${{ matrix.containers == 'component' && 'component' || 'E2E' }}

- name: Upload snapshots
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
- name: Upload snapshots and videos
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
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'
run: docker logs nextcloud-cypress-tests-${{ env.APP_NAME }} > nextcloud.log
run: docker logs nextcloud-cypress-tests_${{ env.APP_NAME }} > nextcloud.log

- name: Upload NC logs
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
if: failure() && matrix.containers != 'component'
with:
name: nc_logs_${{ matrix.containers }}
Expand Down
7 changes: 6 additions & 1 deletion cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ 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
videoCompression: false,

Expand Down Expand Up @@ -74,7 +77,9 @@ export default defineConfig({

// Remove container after run
on('after:run', () => {
stopNextcloud()
if (!process.env.CI) {
stopNextcloud()
}
})

// Before the browser launches
Expand Down
5 changes: 5 additions & 0 deletions cypress/e2e/filesUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,12 @@ export const triggerActionForFile = (filename: string, actionId: string) => {
}

export function renameFile(fileName: string, newName: string) {
// The file must exist and the preview loaded as it locks the file
getRowForFile(fileName)
.should('be.visible')
.find('.files-list__row-icon-preview--loaded')
.should('exist')

triggerActionForFile(fileName, 'rename')

// intercept the move so we can wait for it
Expand Down
1 change: 1 addition & 0 deletions cypress/e2e/sidebar.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ describe('Check activity listing in the sidebar', { testIsolation: true }, () =>

it('Has comment activity', () => {
addComment('welcome.txt', 'A comment')
cy.visit('/apps/files')

showActivityTab('welcome.txt')
cy.get('.comments-activity').first().should('contains.text', 'A comment')
Expand Down
4 changes: 3 additions & 1 deletion cypress/e2e/sidebarUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@ export function showActivityTab(fileName: string) {
cy.intercept('GET', '/ocs/v2.php/apps/activity/api/v2/activity/filter**').as('getActivities')

showSidebarForFile(fileName)

// {force: true} as it might be hidden behind toasts
cy.get('#app-sidebar-vue')
.findByRole('tab', { name: 'Activity' })
.click()
.click({ force: true })

cy.get('#app-sidebar-vue')
.findByRole('tabpanel', { name: 'Activity' })
Expand Down
Loading