Skip to content

Commit bf72df6

Browse files
committed
Add prefix to fileList selector
Signed-off-by: Vincent Petry <[email protected]>
1 parent 7cf75cf commit bf72df6

File tree

7 files changed

+37
-37
lines changed

7 files changed

+37
-37
lines changed

cypress/e2e/ImageView.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ describe('Image View', () => {
8585
})
8686

8787
it('with preview', () => {
88-
cy.get('.fileList tr[data-file="github.png"]')
88+
cy.get('.files-fileList tr[data-file="github.png"]')
8989
.should('have.attr', 'data-id')
9090
.then(imageId => {
9191
const fileName = `${Cypress.currentTest.title}.md`

cypress/e2e/files.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ describe('Files default view', function() {
2626
})
2727

2828
it('See the default files list', function() {
29-
cy.get('.fileList tr').should('contain', 'welcome.txt')
29+
cy.get('.files-fileList tr').should('contain', 'welcome.txt')
3030
})
3131

3232
it('Take screenshot', function() {

cypress/e2e/images.spec.js

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,9 @@ describe('Test all image insertion methods', () => {
147147
})
148148

149149
it('See test files in the list and display hidden files', () => {
150-
cy.get('.fileList tr[data-file="test.md"]', { timeout: 10000 })
150+
cy.get('.files-fileList tr[data-file="test.md"]', { timeout: 10000 })
151151
.should('contain', 'test.md')
152-
cy.get('.fileList tr[data-file="github.png"]', { timeout: 10000 })
152+
cy.get('.files-fileList tr[data-file="github.png"]', { timeout: 10000 })
153153
.should('contain', 'github.png')
154154

155155
cy.get('#app-settings-header', { timeout: 10000 })
@@ -228,7 +228,7 @@ describe('Test all image insertion methods', () => {
228228
it('test if image files are in the attachment folder', () => {
229229
// check we stored the image names/ids
230230

231-
cy.get('.fileList tr[data-file="test.md"]', { timeout: 10000 })
231+
cy.get('.files-fileList tr[data-file="test.md"]', { timeout: 10000 })
232232
.should('have.attr', 'data-id')
233233
.then((documentId) => {
234234
const files = attachmentFileNameToId[documentId]
@@ -239,7 +239,7 @@ describe('Test all image insertion methods', () => {
239239
cy.wait('@chdir')
240240
cy.screenshot()
241241
for (const name in files) {
242-
cy.get(`.fileList tr[data-file="${name}"]`, { timeout: 10000 })
242+
cy.get(`.files-fileList tr[data-file="${name}"]`, { timeout: 10000 })
243243
.should('exist')
244244
.should('have.attr', 'data-id')
245245
.should('eq', String(files[name]))
@@ -263,7 +263,7 @@ describe('Test all image insertion methods', () => {
263263
cy.openFile('subFolder')
264264
cy.wait('@chdir')
265265

266-
cy.get('.fileList tr[data-file="test.md"]', { timeout: 10000 })
266+
cy.get('.files-fileList tr[data-file="test.md"]', { timeout: 10000 })
267267
.should('exist')
268268
.should('have.attr', 'data-id')
269269
.then((documentId) => {
@@ -273,7 +273,7 @@ describe('Test all image insertion methods', () => {
273273
cy.wait('@chdir')
274274
cy.screenshot()
275275
for (const name in files) {
276-
cy.get(`.fileList tr[data-file="${name}"]`, { timeout: 10000 })
276+
cy.get(`.files-fileList tr[data-file="${name}"]`, { timeout: 10000 })
277277
.should('exist')
278278
.should('have.attr', 'data-id')
279279
.should('eq', String(files[name]))
@@ -289,7 +289,7 @@ describe('Test all image insertion methods', () => {
289289
cy.reloadFileList()
290290
cy.wait('@reload2')
291291

292-
cy.get('.fileList tr[data-file="testCopied.md"]', { timeout: 10000 })
292+
cy.get('.files-fileList tr[data-file="testCopied.md"]', { timeout: 10000 })
293293
.should('exist')
294294
.should('have.attr', 'data-id')
295295
.then((documentId) => {
@@ -300,7 +300,7 @@ describe('Test all image insertion methods', () => {
300300
cy.wait('@chdir')
301301
cy.screenshot()
302302
for (const name in files) {
303-
cy.get(`.fileList tr[data-file="${name}"]`, { timeout: 10000 })
303+
cy.get(`.files-fileList tr[data-file="${name}"]`, { timeout: 10000 })
304304
.should('exist')
305305
.should('have.attr', 'data-id')
306306
// these are new copied attachment files
@@ -311,7 +311,7 @@ describe('Test all image insertion methods', () => {
311311
})
312312

313313
it('test if attachment folder is deleted after having deleted a markdown file', () => {
314-
cy.get('.fileList tr[data-file="testCopied.md"]', { timeout: 10000 })
314+
cy.get('.files-fileList tr[data-file="testCopied.md"]', { timeout: 10000 })
315315
.should('exist')
316316
.should('have.attr', 'data-id')
317317
.then((documentId) => {
@@ -324,7 +324,7 @@ describe('Test all image insertion methods', () => {
324324
cy.wait('@reload3')
325325

326326
// cy.wait(2000)
327-
cy.get(`.fileList tr[data-file=".attachments.${documentId}"]`, { timeout: 10000 })
327+
cy.get(`.files-fileList tr[data-file=".attachments.${documentId}"]`, { timeout: 10000 })
328328
.should('not.exist')
329329
})
330330
// change the current user for next tests
@@ -333,9 +333,9 @@ describe('Test all image insertion methods', () => {
333333

334334
it('[share] check everything behaves correctly on the share target user side', () => {
335335
// check the file list
336-
cy.get('.fileList tr[data-file="test.md"]', { timeout: 10000 })
336+
cy.get('.files-fileList tr[data-file="test.md"]', { timeout: 10000 })
337337
.should('contain', 'test.md')
338-
cy.get('.fileList tr[data-file="github.png"]').should('not.exist')
338+
cy.get('.files-fileList tr[data-file="github.png"]').should('not.exist')
339339

340340
// show hidden files
341341
cy.get('#app-settings-header', { timeout: 10000 })
@@ -346,11 +346,11 @@ describe('Test all image insertion methods', () => {
346346
cy.wait('@showHidden')
347347

348348
// check the attachment folder is not there
349-
cy.get('.fileList tr[data-file="test.md"]', { timeout: 10000 })
349+
cy.get('.files-fileList tr[data-file="test.md"]', { timeout: 10000 })
350350
.should('exist')
351351
.should('have.attr', 'data-id')
352352
.then((documentId) => {
353-
cy.get(`.fileList tr[data-file=".attachments.${documentId}"]`, { timeout: 10000 })
353+
cy.get(`.files-fileList tr[data-file=".attachments.${documentId}"]`, { timeout: 10000 })
354354
.should('not.exist')
355355
})
356356

@@ -363,11 +363,11 @@ describe('Test all image insertion methods', () => {
363363
cy.reloadFileList()
364364
cy.wait('@reload')
365365

366-
cy.get('.fileList tr[data-file="testMoved.md"]', { timeout: 10000 })
366+
cy.get('.files-fileList tr[data-file="testMoved.md"]', { timeout: 10000 })
367367
.should('exist')
368368
.should('have.attr', 'data-id')
369369
.then((documentId) => {
370-
cy.get(`.fileList tr[data-file=".attachments.${documentId}"]`, { timeout: 10000 })
370+
cy.get(`.files-fileList tr[data-file=".attachments.${documentId}"]`, { timeout: 10000 })
371371
.should('not.exist')
372372
})
373373

@@ -379,7 +379,7 @@ describe('Test all image insertion methods', () => {
379379
cy.reloadFileList()
380380
cy.wait('@reload2')
381381

382-
cy.get('.fileList tr[data-file="testCopied.md"]', { timeout: 10000 })
382+
cy.get('.files-fileList tr[data-file="testCopied.md"]', { timeout: 10000 })
383383
.should('exist')
384384
.should('have.attr', 'data-id')
385385
.then((documentId) => {
@@ -390,7 +390,7 @@ describe('Test all image insertion methods', () => {
390390
cy.wait('@chdir')
391391
cy.screenshot()
392392
for (const name in files) {
393-
cy.get(`.fileList tr[data-file="${name}"]`, { timeout: 10000 })
393+
cy.get(`.files-fileList tr[data-file="${name}"]`, { timeout: 10000 })
394394
.should('exist')
395395
.should('have.attr', 'data-id')
396396
// these are new copied attachment files

cypress/e2e/share.spec.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ describe('Open test.md in viewer', function() {
3737
cy.uploadFile('test.md', 'text/markdown', 'test2.md')
3838
cy.uploadFile('test.md', 'text/markdown')
3939
cy.visit('/apps/files')
40-
cy.get('.fileList tr[data-file="test.md"]')
40+
cy.get('.files-fileList tr[data-file="test.md"]')
4141
.should('contain', 'test.md')
4242
})
4343
beforeEach(function() {
@@ -46,7 +46,7 @@ describe('Open test.md in viewer', function() {
4646

4747
it('Shares the file as a public read only link', function() {
4848
cy.visit('/apps/files')
49-
cy.get('.fileList tr[data-file="test.md"] a.action-share')
49+
cy.get('.files-fileList tr[data-file="test.md"] a.action-share')
5050
.click({ force: true })
5151
cy.get('#app-sidebar-vue')
5252
.should('be.visible')
@@ -68,7 +68,7 @@ describe('Open test.md in viewer', function() {
6868

6969
it('Shares the file as a public link with write permissions', function() {
7070
cy.visit('/apps/files')
71-
cy.get('.fileList tr[data-file="test2.md"] a.action-share')
71+
cy.get('.files-fileList tr[data-file="test2.md"] a.action-share')
7272
.click({ force: true })
7373
cy.get('#app-sidebar-vue')
7474
.should('be.visible')
@@ -99,7 +99,7 @@ describe('Open test.md in viewer', function() {
9999

100100
it('Opens the editor as guest', function() {
101101
cy.visit('/apps/files')
102-
cy.get('.fileList tr[data-file="test2.md"] a.action-share')
102+
cy.get('.files-fileList tr[data-file="test2.md"] a.action-share')
103103
.click({ force: true })
104104
cy.get('#app-sidebar-vue')
105105
.should('be.visible')
@@ -128,7 +128,7 @@ describe('Open test.md in viewer', function() {
128128

129129
it('Shares a folder as a public read only link', function() {
130130
cy.visit('/apps/files')
131-
cy.get('.fileList tr[data-file="folder"] a.action-share')
131+
cy.get('.files-fileList tr[data-file="folder"] a.action-share')
132132
.click({ force: true })
133133
cy.get('#app-sidebar-vue')
134134
.should('be.visible')

cypress/e2e/viewer.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ describe('Open test.md in viewer', function() {
3535
})
3636

3737
it('See test.md in the list', function() {
38-
cy.get('.fileList tr[data-file="test.md"]', { timeout: 10000 })
38+
cy.get('.files-fileList tr[data-file="test.md"]', { timeout: 10000 })
3939
.should('contain', 'test.md')
4040
})
4141

cypress/e2e/workspace.spec.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ describe('Workspace', function() {
4242
})
4343

4444
it('adds a Readme.md', function() {
45-
cy.get('.fileList').should('not.contain', 'Readme.md')
45+
cy.get('.files-fileList').should('not.contain', 'Readme.md')
4646
cy.openWorkspace()
4747
.type('Hello')
4848
.should('contain', 'Hello')
@@ -148,7 +148,7 @@ describe('Workspace', function() {
148148
it('takes README.md into account', function() {
149149
cy.uploadFile('test.md', 'text/markdown', `${Cypress.currentTest.title}/README.md`)
150150
cy.reload()
151-
cy.get('.fileList').should('contain', 'README.md')
151+
cy.get('.files-fileList').should('contain', 'README.md')
152152
cy.get('#rich-workspace .ProseMirror')
153153
.should('contain', 'Hello world')
154154
})
@@ -250,7 +250,7 @@ describe('Workspace', function() {
250250
cy.nextcloudUpdateUser(randUser, 'password', 'language', 'de_DE')
251251
cy.uploadFile('test.md', 'text/markdown', `${Cypress.currentTest.title}/Anleitung.md`)
252252
cy.reload()
253-
cy.get('.fileList').should('contain', 'Anleitung.md')
253+
cy.get('.files-fileList').should('contain', 'Anleitung.md')
254254
cy.get('#rich-workspace .ProseMirror')
255255
.should('contain', 'Hello world')
256256
})
@@ -259,7 +259,7 @@ describe('Workspace', function() {
259259
cy.nextcloudUpdateUser(randUser, 'password', 'language', 'fr')
260260
cy.uploadFile('test.md', 'text/markdown', `${Cypress.currentTest.title}/Anleitung.md`)
261261
cy.reload()
262-
cy.get('.fileList').should('contain', 'Anleitung.md')
262+
cy.get('.files-fileList').should('contain', 'Anleitung.md')
263263
cy.get('.empty-workspace').should('contain', 'Ajoutez des notes, listes ou liens')
264264
})
265265
})
@@ -321,9 +321,9 @@ const getSubmenuItem = (parent, item) => {
321321
}
322322

323323
const openSidebar = filename => {
324-
cy.get(`.fileList tr[data-file="${filename}"]`)
324+
cy.get(`.files-fileList tr[data-file="${filename}"]`)
325325
.should('contain', filename)
326-
cy.get(`.fileList tr[data-file="${filename}"] .icon-more`).click()
327-
cy.get(`.fileList tr[data-file="${filename}"] .icon-details`).click()
326+
cy.get(`.files-fileList tr[data-file="${filename}"] .icon-more`).click()
327+
cy.get(`.files-fileList tr[data-file="${filename}"] .icon-details`).click()
328328
cy.get('.app-sidebar-header').should('contain', filename)
329329
}

cypress/support/commands.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -209,18 +209,18 @@ Cypress.Commands.add('reloadFileList', () => cy.window()
209209
)
210210

211211
Cypress.Commands.add('openFile', (fileName, params = {}) => {
212-
cy.get(`.fileList tr[data-file="${fileName}"] a.name`).click(params)
212+
cy.get(`.files-fileList tr[data-file="${fileName}"] a.name`).click(params)
213213
// eslint-disable-next-line cypress/no-unnecessary-waiting
214214
cy.wait(250)
215215
})
216216

217217
Cypress.Commands.add('getFile', fileName => {
218-
return cy.get(`.fileList tr[data-file="${fileName}"]`)
218+
return cy.get(`.files-fileList tr[data-file="${fileName}"]`)
219219
})
220220

221221
Cypress.Commands.add('deleteFile', fileName => {
222-
cy.get(`.fileList tr[data-file="${fileName}"] a.name .action-menu`).click()
223-
cy.get(`.fileList tr[data-file="${fileName}"] a.name + .popovermenu .action-delete`).click()
222+
cy.get(`.files-fileList tr[data-file="${fileName}"] a.name .action-menu`).click()
223+
cy.get(`.files-fileList tr[data-file="${fileName}"] a.name + .popovermenu .action-delete`).click()
224224
})
225225

226226
Cypress.Commands.add('getEditor', () => {

0 commit comments

Comments
 (0)