From 68d653cc5ff37a62e29b8fe2aecba1a4c5c922af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Fri, 24 Jan 2020 12:20:38 +0100 Subject: Add test skeleton for folder link shares MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- cypress/integration/share.spec.js | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) (limited to 'cypress') diff --git a/cypress/integration/share.spec.js b/cypress/integration/share.spec.js index 3e8fcde57..d0f5d4ed8 100644 --- a/cypress/integration/share.spec.js +++ b/cypress/integration/share.spec.js @@ -34,6 +34,8 @@ describe('Open test.md in viewer', function() { // Upload test files cy.uploadFile('test.md', 'text/markdown') cy.uploadFile('test.md', 'text/markdown', 'test2.md') + cy.createFolder('folder') + cy.uploadFile('test.md', 'text/markdown', 'folder/test.md') cy.visit('/apps/files') cy.get('#fileList tr[data-file="test.md"]', {timeout: 10000}) .should('contain', 'test.md') @@ -51,7 +53,8 @@ describe('Open test.md in viewer', function() { }) it('Shares the file as a public read only link', function () { - cy.visit('/apps/files') + cy.visit('/apps/files', { timeout: 10000 }) + cy.wait(1000) cy.get('#fileList tr[data-file="test.md"] a.action-share', {timeout: 10000}).trigger('click') cy.get('#app-sidebar') .should('be.visible') @@ -73,6 +76,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.wait(1000) cy.get('#fileList tr[data-file="test2.md"] a.action-share', {timeout: 10000}).trigger('click') cy.get('#app-sidebar') .should('be.visible') @@ -88,6 +92,7 @@ describe('Open test.md in viewer', function() { cy.window().then(win => { win.OC.appswebroots['files_texteditor'] = true cy.wait(1000) + cy.openFile('test.md') cy.get('#editor', {timeout: 10000}).should('be.visible') cy.get('#editor .ProseMirror').should('contain', 'Hello world') cy.get('#editor .ProseMirror h2').should('contain', 'Hello world') @@ -100,6 +105,7 @@ describe('Open test.md in viewer', function() { it('Opens the editor as guest', function () { cy.visit('/apps/files') + cy.wait(1000) cy.get('#fileList tr[data-file="test2.md"] a.action-share', {timeout: 10000}).trigger('click') cy.get('#app-sidebar') .should('be.visible') @@ -122,5 +128,28 @@ 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.wait(1000) + cy.get('#fileList tr[data-file="folder"] a.action-share', {timeout: 10000}).trigger('click') + cy.get('#app-sidebar') + .should('be.visible') + cy.get('#app-sidebar a#sharing').trigger('click') + cy.get('#app-sidebar button.new-share-link').trigger('click') + cy.get('#app-sidebar 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.wait(1000) + cy.openFile('test.md') + cy.get('#editor-container', { timeout: 4000 }).should('be.visible') + cy.get('#editor .ProseMirror').should('contain', 'Hello world') + cy.get('#editor .ProseMirror h2').should('contain', 'Hello world') + }) + }) + }) + }) -- cgit v1.2.3