Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/text.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2020-01-24 14:20:38 +0300
committerJulius Härtl <jus@bitgrid.net>2020-01-27 14:54:46 +0300
commit68d653cc5ff37a62e29b8fe2aecba1a4c5c922af (patch)
treee4b5b0f8e7edf7a1d30b63d205afcd51ff856561 /cypress
parentb70a8de6ec5adbc245f52530cb1a62db07e0d3a4 (diff)
Add test skeleton for folder link shares
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'cypress')
-rw-r--r--cypress/integration/share.spec.js31
1 files changed, 30 insertions, 1 deletions
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')
+ })
+ })
+ })
+
})