Skip to content

Commit

Permalink
Merge pull request #1325 from nextcloud/artonge/bump/cypress/13
Browse files Browse the repository at this point in the history
Bump cypress to v13
  • Loading branch information
artonge authored Sep 21, 2023
2 parents 67e556d + 7e386d5 commit e0e2532
Show file tree
Hide file tree
Showing 4 changed files with 355 additions and 145 deletions.
10 changes: 7 additions & 3 deletions cypress/e2e/filesUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
*/

export function renameFile(fileName: string, newName: string) {
cy.get(`[data-cy-files-list] [data-cy-files-list-row-name="${fileName}"] [data-cy-files-list-row-actions]`).click()
toggleMenuAction(fileName)
cy.get(`[data-cy-files-list] [data-cy-files-list-row-action="rename"]`).click()
cy.get(`[data-cy-files-list] [data-cy-files-list-row-name="${fileName}"] .files-list__row-rename input`).clear()
cy.get(`[data-cy-files-list] [data-cy-files-list-row-name="${fileName}"] .files-list__row-rename input`).type(`${newName}.txt`)
Expand All @@ -45,9 +45,13 @@ export function createFolder (dirName: string) {
}

export function moveFile (fileName: string, dirName: string) {
cy.get(`[data-cy-files-list] [data-cy-files-list-row-name="${fileName}"] [data-cy-files-list-row-actions]`).click()
toggleMenuAction(fileName)
cy.get(`[data-cy-files-list] [data-cy-files-list-row-action="movecopy]"`).click()
cy.get(`.oc-dialog tr[data-entryname="${dirName}"]`).click()
cy.contains(`Move to ${dirName}`).click()
cy.wait(500)
}
}

export function toggleMenuAction(fileName: string) {
cy.get(`[data-cy-files-list] [data-cy-files-list-row-name="${fileName}"] [data-cy-files-list-row-actions] .action-item__menutoggle`).click()
}
10 changes: 6 additions & 4 deletions cypress/e2e/sidebarUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@
*
*/

import { toggleMenuAction } from "./filesUtils"

function showSidebarForFile(fileName: string) {
closeSidebar()
cy.get(`[data-cy-files-list] [data-cy-files-list-row-name="${fileName}"] [data-cy-files-list-row-actions]`).click()
toggleMenuAction(fileName)
cy.contains('Open details').click()
cy.get('#app-sidebar-vue').contains('Activity').click()
}
Expand All @@ -42,19 +44,19 @@ export function showActivityTab(fileName: string) {
}

export function addToFavorites(fileName: string) {
cy.get(`[data-cy-files-list] [data-cy-files-list-row-name="${fileName}"] [data-cy-files-list-row-actions]`).click()
toggleMenuAction(fileName)
cy.contains('Add to favorites').click()
cy.get('.toast-close').click()
}

export function removeFromFavorites(fileName: string) {
cy.get(`[data-cy-files-list] [data-cy-files-list-row-name="${fileName}"] [data-cy-files-list-row-actions]`).click()
toggleMenuAction(fileName)
cy.contains('Remove from favorites').click()
cy.get('.toast-close').click()
}

export function createPublicShare(fileName: string) {
cy.get(`[data-cy-files-list] [data-cy-files-list-row-name="${fileName}"] [data-cy-files-list-row-actions]`).click()
toggleMenuAction(fileName)
cy.contains('Open details').click()
cy.get('#app-sidebar-vue').contains('Sharing').click()

Expand Down
Loading

0 comments on commit e0e2532

Please sign in to comment.