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
4 changes: 2 additions & 2 deletions cypress/e2e/ImageView.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { randHash } from '../utils/index.js'

const currentUser = randHash()

const refresh = () => cy.get('#controls .crumb:not(.hidden) a')
const refresh = () => cy.get('.files-controls .crumb:not(.hidden) a')
.last()
.click({ force: true })

Expand Down Expand Up @@ -85,7 +85,7 @@ describe('Image View', () => {
})

it('with preview', () => {
cy.get('#fileList tr[data-file="github.png"]')
cy.get('.files-fileList tr[data-file="github.png"]')
.should('have.attr', 'data-id')
.then(imageId => {
const fileName = `${Cypress.currentTest.title}.md`
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/files.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ describe('Files default view', function() {
})

it('See the default files list', function() {
cy.get('#fileList tr').should('contain', 'welcome.txt')
cy.get('.files-fileList tr').should('contain', 'welcome.txt')
})

it('Take screenshot', function() {
Expand Down
36 changes: 18 additions & 18 deletions cypress/e2e/images.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,9 @@ describe('Test all image insertion methods', () => {
})

it('See test files in the list and display hidden files', () => {
cy.get('#fileList tr[data-file="test.md"]', { timeout: 10000 })
cy.get('.files-fileList tr[data-file="test.md"]', { timeout: 10000 })
.should('contain', 'test.md')
cy.get('#fileList tr[data-file="github.png"]', { timeout: 10000 })
cy.get('.files-fileList tr[data-file="github.png"]', { timeout: 10000 })
.should('contain', 'github.png')
cy.showHiddenFiles()
})
Expand Down Expand Up @@ -222,7 +222,7 @@ describe('Test all image insertion methods', () => {
it('test if image files are in the attachment folder', () => {
// check we stored the image names/ids

cy.get('#fileList tr[data-file="test.md"]', { timeout: 10000 })
cy.get('.files-fileList tr[data-file="test.md"]', { timeout: 10000 })
.should('have.attr', 'data-id')
.then((documentId) => {
const files = attachmentFileNameToId[documentId]
Expand All @@ -231,7 +231,7 @@ describe('Test all image insertion methods', () => {
cy.openFolder('.attachments.' + documentId)
cy.screenshot()
for (const name in files) {
cy.get(`#fileList tr[data-file="${name}"]`, { timeout: 10000 })
cy.get(`.files-fileList tr[data-file="${name}"]`, { timeout: 10000 })
.should('exist')
.should('have.attr', 'data-id')
.should('eq', String(files[name]))
Expand All @@ -244,15 +244,15 @@ describe('Test all image insertion methods', () => {
cy.reloadFileList()
cy.moveFile('test.md', 'subFolder/test.md')
cy.openFolder('subFolder')
cy.get('#fileList tr[data-file="test.md"]', { timeout: 10000 })
cy.get('.files-fileList tr[data-file="test.md"]', { timeout: 10000 })
.should('exist')
.should('have.attr', 'data-id')
.then((documentId) => {
const files = attachmentFileNameToId[documentId]
cy.openFolder('.attachments.' + documentId)
cy.screenshot()
for (const name in files) {
cy.get(`#fileList tr[data-file="${name}"]`, { timeout: 10000 })
cy.get(`.files-fileList tr[data-file="${name}"]`, { timeout: 10000 })
.should('exist')
.should('have.attr', 'data-id')
.should('eq', String(files[name]))
Expand All @@ -264,7 +264,7 @@ describe('Test all image insertion methods', () => {
cy.copyFile('subFolder/test.md', 'testCopied.md')
cy.reloadFileList()

cy.get('#fileList tr[data-file="testCopied.md"]', { timeout: 10000 })
cy.get('.files-fileList tr[data-file="testCopied.md"]', { timeout: 10000 })
.should('exist')
.should('have.attr', 'data-id')
.then((documentId) => {
Expand All @@ -273,7 +273,7 @@ describe('Test all image insertion methods', () => {
cy.openFolder('.attachments.' + documentId)
cy.screenshot()
for (const name in files) {
cy.get(`#fileList tr[data-file="${name}"]`, { timeout: 10000 })
cy.get(`.files-fileList tr[data-file="${name}"]`, { timeout: 10000 })
.should('exist')
.should('have.attr', 'data-id')
// these are new copied attachment files
Expand All @@ -284,13 +284,13 @@ describe('Test all image insertion methods', () => {
})

it('test if attachment folder is deleted after having deleted a markdown file', () => {
cy.get('#fileList tr[data-file="testCopied.md"]', { timeout: 10000 })
cy.get('.files-fileList tr[data-file="testCopied.md"]', { timeout: 10000 })
.should('exist')
.should('have.attr', 'data-id')
.then((documentId) => {
cy.deleteFile('testCopied.md')
cy.reloadFileList()
cy.get(`#fileList tr[data-file=".attachments.${documentId}"]`, { timeout: 10000 })
cy.get(`.files-fileList tr[data-file=".attachments.${documentId}"]`, { timeout: 10000 })
.should('not.exist')
})
// change the current user for next tests
Expand All @@ -299,43 +299,43 @@ describe('Test all image insertion methods', () => {

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

// check the attachment folder is not there
cy.get('#fileList tr[data-file="test.md"]', { timeout: 10000 })
cy.get('.files-fileList tr[data-file="test.md"]', { timeout: 10000 })
.should('exist')
.should('have.attr', 'data-id')
.then((documentId) => {
cy.get(`#fileList tr[data-file=".attachments.${documentId}"]`, { timeout: 10000 })
cy.get(`.files-fileList tr[data-file=".attachments.${documentId}"]`, { timeout: 10000 })
.should('not.exist')
})

// move the file and check the attachment folder is still not there
cy.moveFile('test.md', 'testMoved.md')
cy.reloadFileList()
cy.get('#fileList tr[data-file="testMoved.md"]', { timeout: 10000 })
cy.get('.files-fileList tr[data-file="testMoved.md"]', { timeout: 10000 })
.should('exist')
.should('have.attr', 'data-id')
.then((documentId) => {
cy.get(`#fileList tr[data-file=".attachments.${documentId}"]`, { timeout: 10000 })
cy.get(`.files-fileList tr[data-file=".attachments.${documentId}"]`, { timeout: 10000 })
.should('not.exist')
})

// copy the file and check the attachment folder was copied
cy.copyFile('testMoved.md', 'testCopied.md')
cy.reloadFileList()
cy.get('#fileList tr[data-file="testCopied.md"]', { timeout: 10000 })
cy.get('.files-fileList tr[data-file="testCopied.md"]', { timeout: 10000 })
.should('exist')
.should('have.attr', 'data-id')
.then((documentId) => {
const files = attachmentFileNameToId[documentId]
cy.openFolder('.attachments.' + documentId)
cy.screenshot()
for (const name in files) {
cy.get(`#fileList tr[data-file="${name}"]`, { timeout: 10000 })
cy.get(`.files-fileList tr[data-file="${name}"]`, { timeout: 10000 })
.should('exist')
.should('have.attr', 'data-id')
// these are new copied attachment files
Expand Down
10 changes: 5 additions & 5 deletions cypress/e2e/share.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ describe('Open test.md in viewer', function() {
cy.uploadFile('test.md', 'text/markdown', 'test2.md')
cy.uploadFile('test.md', 'text/markdown')
cy.visit('/apps/files')
cy.get('#fileList tr[data-file="test.md"]')
cy.get('.files-fileList tr[data-file="test.md"]')
.should('contain', 'test.md')
})
beforeEach(function() {
Expand All @@ -46,7 +46,7 @@ describe('Open test.md in viewer', function() {

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

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

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

it('Shares a folder as a public read only link', function() {
cy.visit('/apps/files')
cy.get('#fileList tr[data-file="folder"] a.action-share')
cy.get('.files-fileList tr[data-file="folder"] a.action-share')
.click({ force: true })
cy.get('#app-sidebar-vue')
.should('be.visible')
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/viewer.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ describe('Open test.md in viewer', function() {
})

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

Expand Down
14 changes: 7 additions & 7 deletions cypress/e2e/workspace.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ describe('Workspace', function() {
})

it('adds a Readme.md', function() {
cy.get('#fileList').should('not.contain', 'Readme.md')
cy.get('.files-fileList').should('not.contain', 'Readme.md')
cy.openWorkspace()
.type('Hello')
.should('contain', 'Hello')
Expand Down Expand Up @@ -148,7 +148,7 @@ describe('Workspace', function() {
it('takes README.md into account', function() {
cy.uploadFile('test.md', 'text/markdown', `${Cypress.currentTest.title}/README.md`)
cy.reload()
cy.get('#fileList').should('contain', 'README.md')
cy.get('.files-fileList').should('contain', 'README.md')
cy.get('#rich-workspace .ProseMirror')
.should('contain', 'Hello world')
})
Expand Down Expand Up @@ -250,7 +250,7 @@ describe('Workspace', function() {
cy.nextcloudUpdateUser(randUser, 'password', 'language', 'de_DE')
cy.uploadFile('test.md', 'text/markdown', `${Cypress.currentTest.title}/Anleitung.md`)
cy.reload()
cy.get('#fileList').should('contain', 'Anleitung.md')
cy.get('.files-fileList').should('contain', 'Anleitung.md')
cy.get('#rich-workspace .ProseMirror')
.should('contain', 'Hello world')
})
Expand All @@ -259,7 +259,7 @@ describe('Workspace', function() {
cy.nextcloudUpdateUser(randUser, 'password', 'language', 'fr')
cy.uploadFile('test.md', 'text/markdown', `${Cypress.currentTest.title}/Anleitung.md`)
cy.reload()
cy.get('#fileList').should('contain', 'Anleitung.md')
cy.get('.files-fileList').should('contain', 'Anleitung.md')
cy.get('.empty-workspace').should('contain', 'Ajoutez des notes, listes ou liens')
})
})
Expand Down Expand Up @@ -321,9 +321,9 @@ const getSubmenuItem = (parent, item) => {
}

const openSidebar = filename => {
cy.get(`#fileList tr[data-file="${filename}"]`)
cy.get(`.files-fileList tr[data-file="${filename}"]`)
.should('contain', filename)
cy.get(`#fileList tr[data-file="${filename}"] .icon-more`).click()
cy.get(`#fileList tr[data-file="${filename}"] .icon-details`).click()
cy.get(`.files-fileList tr[data-file="${filename}"] .icon-more`).click()
cy.get(`.files-fileList tr[data-file="${filename}"] .icon-details`).click()
cy.get('.app-sidebar-header').should('contain', filename)
}
8 changes: 4 additions & 4 deletions cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,16 +217,16 @@ Cypress.Commands.add('openFolder', (name) => {
})

Cypress.Commands.add('openFile', (fileName, params = {}) => {
cy.get(`#fileList tr[data-file="${fileName}"] a.name`).click(params)
cy.get(`.files-fileList tr[data-file="${fileName}"] a.name`).click(params)
})

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

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

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