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
14 changes: 12 additions & 2 deletions cypress/e2e/files/filesUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,19 @@ export const navigateToFolder = (dirPath: string) => {

}

export const closeSidebar = () => {
/**
* Close the sidebar
*/
export function closeSidebar() {
// {force: true} as it might be hidden behind toasts
cy.get('[data-cy-sidebar] .app-sidebar__close').click({ force: true })
cy.get('[data-cy-sidebar] .app-sidebar__close')
.click({ force: true })
cy.get('[data-cy-sidebar]')
.should('not.be.visible')
// eslint-disable-next-line cypress/no-unnecessary-waiting -- wait for the animation to finish
cy.wait(500)
cy.url()
.should('not.contain', 'opendetails')
}

export const clickOnBreadcrumbs = (label: string) => {
Expand Down
21 changes: 12 additions & 9 deletions cypress/e2e/files_versions/filesVersionsUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
* SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
/* eslint-disable jsdoc/require-jsdoc */
import type { User } from '@nextcloud/cypress'

import { basename } from '@nextcloud/paths'
import { addUserToGroup, createGroup, createGroupFolder, PERMISSION_DELETE, PERMISSION_READ, PERMISSION_WRITE } from '../groupfoldersUtils'
import { navigateToFolder } from '../files/filesUtils'
import { navigateToFolder, triggerActionForFile } from '../files/filesUtils'

type SetupInfo = {
dataSnapshot: string
Expand Down Expand Up @@ -69,13 +70,15 @@ export const uploadThreeVersions = (user: User, fileName: string) => {

export function openVersionsPanel(fileName: string) {
// Detect the versions list fetch
cy.intercept({ method: 'PROPFIND', times: 1, url: '**/dav/versions/*/versions/**' }).as('getVersions')

// Open the versions tab
cy.window().then(win => {
win.OCA.Files.Sidebar.setActiveTab('files_versions')
win.OCA.Files.Sidebar.open(`/${fileName}`)
})
cy.intercept('PROPFIND', '**/dav/versions/*/versions/**').as('getVersions')

triggerActionForFile(basename(fileName), 'details')
cy.get('[data-cy-sidebar]')
.as('sidebar')
.should('be.visible')
cy.get('@sidebar')
.find('[aria-controls="tab-files_versions"]')
.click()

// Wait for the versions list to be fetched
cy.wait('@getVersions')
Expand Down
Loading