cypress_test/integration_tests/common/helper.js | 33 +++++----- cypress_test/integration_tests/multiuser/paragraph_prop_user2_spec.js | 2 cypress_test/integration_tests/multiuser/sheet_operations_user2_spec.js | 2 cypress_test/integration_tests/multiuser/sidebar_visibility_user2_spec.js | 2 cypress_test/integration_tests/multiuser/simultaneous_typing_user2_spec.js | 2 cypress_test/integration_tests/multiuser/slide_operations_user2_spec.js | 2 6 files changed, 23 insertions(+), 20 deletions(-)
New commits: commit f657321d2b5a8a3bdfc0af842aacbd609511f68e Author: Tamás Zolnai <tamas.zol...@collabora.com> AuthorDate: Tue Aug 4 17:40:28 2020 +0200 Commit: Tamás Zolnai <tamas.zol...@collabora.com> CommitDate: Tue Aug 4 19:04:56 2020 +0200 cypress: don't copy the test file by the second user. We use file copying to create a clean test document in the working directory. We don't need to do this twice, the first user will do it first, then the second user will open the same document. Change-Id: Ide01b162b0c6a2b3a694706848c3ce93758f3f22 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/100125 Tested-by: Jenkins Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Tamás Zolnai <tamas.zol...@collabora.com> diff --git a/cypress_test/integration_tests/common/helper.js b/cypress_test/integration_tests/common/helper.js index d7dc0862d..d35637a16 100644 --- a/cypress_test/integration_tests/common/helper.js +++ b/cypress_test/integration_tests/common/helper.js @@ -2,24 +2,27 @@ require('cypress-wait-until'); -function loadTestDoc(fileName, subFolder) { +function loadTestDoc(fileName, subFolder, noFileCopy) { cy.log('Loading test document - start.'); cy.log('Param - fileName: ' + fileName); cy.log('Param - subFolder: ' + subFolder); + cy.log('Param - noFileCopy: ' + noFileCopy); // Get a clean test document - if (subFolder === undefined) { - cy.task('copyFile', { - sourceDir: Cypress.env('DATA_FOLDER'), - destDir: Cypress.env('WORKDIR'), - fileName: fileName, - }); - } else { - cy.task('copyFile', { - sourceDir: Cypress.env('DATA_FOLDER') + subFolder + '/', - destDir: Cypress.env('WORKDIR') + subFolder + '/', - fileName: fileName, - }); + if (noFileCopy !== true) { + if (subFolder === undefined) { + cy.task('copyFile', { + sourceDir: Cypress.env('DATA_FOLDER'), + destDir: Cypress.env('WORKDIR'), + fileName: fileName, + }); + } else { + cy.task('copyFile', { + sourceDir: Cypress.env('DATA_FOLDER') + subFolder + '/', + destDir: Cypress.env('WORKDIR') + subFolder + '/', + fileName: fileName, + }); + } } doIfOnMobile(function() { @@ -156,8 +159,8 @@ function matchClipboardText(regexp) { }); } -function beforeAll(fileName, subFolder) { - loadTestDoc(fileName, subFolder); +function beforeAll(fileName, subFolder, noFileCop) { + loadTestDoc(fileName, subFolder, noFileCop); } function afterAll(fileName) { diff --git a/cypress_test/integration_tests/multiuser/paragraph_prop_user2_spec.js b/cypress_test/integration_tests/multiuser/paragraph_prop_user2_spec.js index 05cf43b65..0f2b05198 100644 --- a/cypress_test/integration_tests/multiuser/paragraph_prop_user2_spec.js +++ b/cypress_test/integration_tests/multiuser/paragraph_prop_user2_spec.js @@ -9,7 +9,7 @@ describe('Change paragraph properties: user-2.', function() { // Wait here, before loading the document. // Opening two clients at the same time causes an issue. cy.wait(5000); - helper.beforeAll(testFileName); + helper.beforeAll(testFileName, undefined, true); }); afterEach(function() { diff --git a/cypress_test/integration_tests/multiuser/sheet_operations_user2_spec.js b/cypress_test/integration_tests/multiuser/sheet_operations_user2_spec.js index 10f032d50..266a34965 100644 --- a/cypress_test/integration_tests/multiuser/sheet_operations_user2_spec.js +++ b/cypress_test/integration_tests/multiuser/sheet_operations_user2_spec.js @@ -9,7 +9,7 @@ describe('Sheet operations: user-2.', function() { // Wait here, before loading the document. // Opening two clients at the same time causes an issue. cy.wait(5000); - helper.beforeAll(testFileName); + helper.beforeAll(testFileName, undefined, true); }); afterEach(function() { diff --git a/cypress_test/integration_tests/multiuser/sidebar_visibility_user2_spec.js b/cypress_test/integration_tests/multiuser/sidebar_visibility_user2_spec.js index ea07c0abe..37c6b6e66 100644 --- a/cypress_test/integration_tests/multiuser/sidebar_visibility_user2_spec.js +++ b/cypress_test/integration_tests/multiuser/sidebar_visibility_user2_spec.js @@ -9,7 +9,7 @@ describe('Sidebar visibility: user-2.', function() { // Wait here, before loading the document. // Opening two clients at the same time causes an issue. cy.wait(5000); - helper.beforeAll(testFileName); + helper.beforeAll(testFileName, undefined, true); }); afterEach(function() { diff --git a/cypress_test/integration_tests/multiuser/simultaneous_typing_user2_spec.js b/cypress_test/integration_tests/multiuser/simultaneous_typing_user2_spec.js index cc23f9f46..4733949ef 100644 --- a/cypress_test/integration_tests/multiuser/simultaneous_typing_user2_spec.js +++ b/cypress_test/integration_tests/multiuser/simultaneous_typing_user2_spec.js @@ -9,7 +9,7 @@ describe('Simultaneous typing: user-2.', function() { // Wait here, before loading the document. // Opening two clients at the same time causes an issue. cy.wait(5000); - helper.beforeAll(testFileName); + helper.beforeAll(testFileName, undefined, true); }); afterEach(function() { diff --git a/cypress_test/integration_tests/multiuser/slide_operations_user2_spec.js b/cypress_test/integration_tests/multiuser/slide_operations_user2_spec.js index 506cd080c..476d26196 100644 --- a/cypress_test/integration_tests/multiuser/slide_operations_user2_spec.js +++ b/cypress_test/integration_tests/multiuser/slide_operations_user2_spec.js @@ -10,7 +10,7 @@ describe('Slide operations: user-2.', function() { // Wait here, before loading the document. // Opening two clients at the same time causes an issue. cy.wait(5000); - helper.beforeAll(testFileName); + helper.beforeAll(testFileName, undefined, true); }); afterEach(function() { _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits