diff options
author | Max <max@nextcloud.com> | 2022-02-24 17:03:11 +0300 |
---|---|---|
committer | Max <max@nextcloud.com> | 2022-03-02 10:19:29 +0300 |
commit | 8bd6b0c4d690662d1687261aaeebbed53696efa1 (patch) | |
tree | 139de8614c85999c675a7ae3cabaede5217dbfbf /cypress | |
parent | 3e40b7bce4b85e4d6d92a56a0323ce8600f8b897 (diff) |
test: workspace in public share
Also remove all the timeouts and error workarounds from share tests.
We increase the timeout in CI for all commands
and that works quite well so far.
Signed-off-by: Max <max@nextcloud.com>
Diffstat (limited to 'cypress')
-rw-r--r-- | cypress/integration/share.spec.js | 35 |
1 files changed, 14 insertions, 21 deletions
diff --git a/cypress/integration/share.spec.js b/cypress/integration/share.spec.js index 2fedf6c72..ffc9ffbb0 100644 --- a/cypress/integration/share.spec.js +++ b/cypress/integration/share.spec.js @@ -31,21 +31,14 @@ describe('Open test.md in viewer', function() { cy.nextcloudCreateUser(randUser, 'password') cy.login(randUser, 'password') - // FIXME: files app is thowing the following error for some reason - // Uncaught TypeError: Cannot read property 'protocol' of undefined - // Same for appswebroots setting in tests - cy.on('uncaught:exception', (err, runnable) => { - return false - }) - // Upload test files cy.createFolder('folder') cy.uploadFile('test.md', 'text/markdown', 'folder/test.md') + cy.uploadFile('test.md', 'text/markdown', 'folder/Readme.md') cy.uploadFile('test.md', 'text/markdown', 'test2.md') cy.uploadFile('test.md', 'text/markdown') - cy.wait(1000) cy.visit('/apps/files') - cy.get('#fileList tr[data-file="test.md"]', {timeout: 10000}) + cy.get('#fileList tr[data-file="test.md"]') .should('contain', 'test.md') }) beforeEach(function() { @@ -53,8 +46,8 @@ describe('Open test.md in viewer', function() { }) it('Shares the file as a public read only link', function () { - cy.visit('/apps/files', { timeout: 10000 }) - cy.get('#fileList tr[data-file="test.md"] a.action-share', { timeout: 10000 }) + cy.visit('/apps/files') + cy.get('#fileList tr[data-file="test.md"] a.action-share') .click({force: true}) cy.get('#app-sidebar-vue') .should('be.visible') @@ -67,7 +60,7 @@ describe('Open test.md in viewer', function() { cy.window().then(win => { win.OC.appswebroots['files_texteditor'] = true cy.wait(1000) - cy.get('#editor', { timeout: 4000 }).should('be.visible') + cy.get('#editor').should('be.visible') cy.get('#editor .ProseMirror').should('contain', 'Hello world') cy.get('#editor .ProseMirror h2').should('contain', 'Hello world') }) @@ -76,7 +69,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', {timeout: 10000}) + cy.get('#fileList tr[data-file="test2.md"] a.action-share') .click({force: true}) cy.get('#app-sidebar-vue') .should('be.visible') @@ -85,14 +78,14 @@ describe('Open test.md in viewer', function() { cy.get('#app-sidebar-vue .sharing-link-list .action-item__menutoggle').trigger('click') const checkboxAllowEditing = '.popover.open input[type=checkbox]' cy.get(checkboxAllowEditing).first().check({ force: true }) - cy.get(checkboxAllowEditing, { timeout: 4000 }).first().should('be.checked') + cy.get(checkboxAllowEditing).first().should('be.checked') cy.get('#app-sidebar-vue a.sharing-entry__copy') .should('have.attr', 'href').and('include', '/s/') .then((href) => { cy.visit(href) cy.window().then(win => { win.OC.appswebroots['files_texteditor'] = true - cy.get('#editor', {timeout: 10000}).should('be.visible') + cy.get('#editor').should('be.visible') cy.get('#editor .ProseMirror').should('contain', 'Hello world') cy.get('#editor .ProseMirror h2').should('contain', 'Hello world') cy.get('#editor .menubar .menubar-icons .icon-undo').should('be.visible') @@ -104,7 +97,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', {timeout: 10000}) + cy.get('#fileList tr[data-file="test2.md"] a.action-share') .click({force: true}) cy.get('#app-sidebar-vue') .should('be.visible') @@ -117,7 +110,7 @@ describe('Open test.md in viewer', function() { cy.window().then(win => { win.OC.appswebroots['files_texteditor'] = true cy.wait(1000) - cy.get('#editor', {timeout: 10000}).should('be.visible') + cy.get('#editor').should('be.visible') cy.get('#editor .ProseMirror').should('contain', 'Hello world') cy.get('#editor .ProseMirror h2').should('contain', 'Hello world') cy.get('#editor .menubar .menubar-icons .icon-undo').should('be.visible') @@ -128,8 +121,8 @@ describe('Open test.md in viewer', function() { }) it('Shares a folder as a public read only link', function () { - cy.visit('/apps/files', { timeout: 10000 }) - cy.get('#fileList tr[data-file="folder"] a.action-share', {timeout: 10000}) + cy.visit('/apps/files') + cy.get('#fileList tr[data-file="folder"] a.action-share') .click({force: true}) cy.get('#app-sidebar-vue') .should('be.visible') @@ -141,9 +134,9 @@ describe('Open test.md in viewer', function() { cy.visit(href) cy.window().then(win => { win.OC.appswebroots['files_texteditor'] = true - cy.wait(1000) + cy.get('#rich-workspace').should('contain', 'Hello world') cy.openFile('test.md') - cy.get('#editor-container', { timeout: 4000 }).should('be.visible') + cy.get('#editor-container').should('be.visible') cy.get('#editor .ProseMirror').should('contain', 'Hello world') cy.get('#editor .ProseMirror h2').should('contain', 'Hello world') }) |