Skip to content

Commit

Permalink
Merge pull request #1453 from nextcloud/artonge/test/re-enable-move_t…
Browse files Browse the repository at this point in the history
…ests_cy

Re-enable the move action in cy tests
  • Loading branch information
artonge authored Dec 7, 2023
2 parents c21a4b3 + 065bf5c commit 4873470
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
16 changes: 9 additions & 7 deletions cypress/e2e/filesUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,24 +31,26 @@ export function renameFile(fileName: string, newName: string) {
}

export function goToDir(dirName: string) {
cy.get(`.files-fileList tr[data-file="${dirName}"]`).click()
cy.get(`[data-cy-files-list] [data-cy-files-list-row-name="${dirName}"]`).click()
cy.wait(500)
}

export function createFolder (dirName: string) {
cy.get('.files-list__header .breadcrumb__actions button.action-item__menutoggle').click()
cy.get('v-popper__popper').contains('New folder').click()
cy.get('.files-list form.files-list__row-rename input[type="text"]').type(dirName)
cy.get('.v-popper__popper').contains('New folder').click()
cy.get('.files-list form.files-list__row-rename input[type="text"]').clear().type(`${dirName}{enter}`)
cy.log('Created folder', dirName)
cy.wait(500)
}

export function moveFile (fileName: string, dirName: string) {
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)
cy.get(`[data-cy-files-list] [data-cy-files-list-row-action="move-copy"]`).click()
cy.get('.file-picker').within(() => {
cy.get(`[data-filename="${dirName}"]`).click()
cy.contains(`Move to ${dirName}`).click()
cy.wait(500)
})
}

export function toggleMenuAction(fileName: string) {
Expand Down
3 changes: 1 addition & 2 deletions cypress/e2e/sidebar.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ describe('Check activity listing in the sidebar', { testIsolation: true }, () =>
cy.get('.activity-entry').first().should('contains.text', 'You renamed')
})

// Re-enable when move action is implement in F2V
xit('Has move activity', () => {
it('Has move activity', () => {
createFolder('Test folder')
moveFile('welcome.txt', 'Test folder')
goToDir('Test folder')
Expand Down

0 comments on commit 4873470

Please sign in to comment.