Skip to content

Commit 689cbdf

Browse files
committed
test: adjust FilePicker tests to new dialogs version
Signed-off-by: Ferdinand Thiessen <[email protected]>
1 parent a387134 commit 689cbdf

File tree

4 files changed

+15
-6
lines changed

4 files changed

+15
-6
lines changed

cypress/e2e/files/FilesUtils.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,10 @@ export const moveFile = (fileName: string, dirPath: string) => {
120120

121121
if (dirPath === '/') {
122122
// select home folder
123-
cy.get('button[title="Home"]').should('be.visible').click()
123+
cy.get('.breadcrumb')
124+
.findByRole('button', { name: 'All files' })
125+
.should('be.visible')
126+
.click()
124127
// click move
125128
cy.contains('button', 'Move').should('be.visible').click()
126129
} else if (dirPath === '.') {
@@ -151,7 +154,10 @@ export const copyFile = (fileName: string, dirPath: string) => {
151154

152155
if (dirPath === '/') {
153156
// select home folder
154-
cy.get('button[title="Home"]').should('be.visible').click()
157+
cy.get('.breadcrumb')
158+
.findByRole('button', { name: 'All files' })
159+
.should('be.visible')
160+
.click()
155161
// click copy
156162
cy.contains('button', 'Copy').should('be.visible').click()
157163
} else if (dirPath === '.') {

cypress/e2e/files/files-copy-move.cy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ describe('Files: Move or copy files', { testIsolation: true }, () => {
7878
getRowForFile('original folder').should('not.exist')
7979
})
8080

81-
it('Can move a file to its parent folder', () => {
81+
it.only('Can move a file to its parent folder', () => {
8282
cy.mkdir(currentUser, '/new-folder')
8383
cy.uploadContent(currentUser, new Blob(), 'text/plain', '/new-folder/original.txt')
8484
cy.login(currentUser)

cypress/e2e/files_sharing/files-copy-move.cy.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,10 @@ export const moveFileForbidden = (fileName: string, dirPath: string) => {
4040
cy.intercept('MOVE', /\/(remote|public)\.php\/dav\/files\//).as('moveFile')
4141

4242
// select home folder
43-
cy.get('button[title="Home"]').should('be.visible').click()
43+
cy.get('.breadcrumb')
44+
.findByRole('button', { name: 'All files' })
45+
.should('be.visible')
46+
.click()
4447

4548
const directories = dirPath.split('/')
4649
directories.forEach((directory) => {

cypress/e2e/theming/user-settings_background.cy.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ describe('User select a custom background', function() {
222222
// Pick background
223223
cy.get('[data-user-theming-background-custom]').click()
224224
cy.get('.file-picker__files tr').contains(image).click()
225-
cy.get('.dialog__actions .button-vue--vue-primary').click()
225+
cy.findByRole('button', { name: 'Select background' }).click()
226226

227227
// Wait for background to be set
228228
cy.wait('@setBackground')
@@ -260,7 +260,7 @@ describe('User changes settings and reload the page', function() {
260260
// Pick background
261261
cy.get('[data-user-theming-background-custom]').click()
262262
cy.get('.file-picker__files tr').contains(image).click()
263-
cy.get('.dialog__actions .button-vue--vue-primary').click()
263+
cy.findByRole('button', { name: 'Select background' }).click()
264264

265265
// Wait for background to be set
266266
cy.wait('@setBackground')

0 commit comments

Comments
 (0)