cypress_test/Makefile.am                                                |    3 
 cypress_test/data/multiuser/sheet_operations.ods                        |binary
 cypress_test/integration_tests/multiuser/sheet_operations_user1_spec.js |   46 
+++++++++
 cypress_test/integration_tests/multiuser/sheet_operations_user2_spec.js |   51 
++++++++++
 4 files changed, 99 insertions(+), 1 deletion(-)

New commits:
commit e65ae5de9304ef9bbc8a2421e2e7061af7d07137
Author:     Tamás Zolnai <tamas.zol...@collabora.com>
AuthorDate: Mon Aug 3 07:11:07 2020 +0200
Commit:     Tamás Zolnai <tamas.zol...@collabora.com>
CommitDate: Mon Aug 3 15:33:08 2020 +0200

    cypress: add sheet operations multi-user test.
    
    Change-Id: Iea31a01d5c85ada481711f771c3489c6aace6e61
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/99979
    Tested-by: Jenkins
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Tamás Zolnai <tamas.zol...@collabora.com>

diff --git a/cypress_test/Makefile.am b/cypress_test/Makefile.am
index 9d30d655d..0f7d95a02 100644
--- a/cypress_test/Makefile.am
+++ b/cypress_test/Makefile.am
@@ -65,7 +65,8 @@ DEKSTOP_TEST_FILES=$(subst 
$(DESKTOP_TEST_FOLDER)/,,$(wildcard $(DESKTOP_TEST_FO
 MULTIUSER_TESTS= \
        paragraph_prop \
        sidebar_visibility \
-       simultaneous_typing
+       simultaneous_typing \
+       sheet_operations
 
 MOBILE_TEST_FILES_DONE= \
        $(foreach 
test_file,$(MOBILE_TEST_FILES),$(MOBILE_TRACK_FOLDER)/$(test_file).done)
diff --git a/cypress_test/data/multiuser/sheet_operations.ods 
b/cypress_test/data/multiuser/sheet_operations.ods
new file mode 100644
index 000000000..a5ce9b2ac
Binary files /dev/null and b/cypress_test/data/multiuser/sheet_operations.ods 
differ
diff --git 
a/cypress_test/integration_tests/multiuser/sheet_operations_user1_spec.js 
b/cypress_test/integration_tests/multiuser/sheet_operations_user1_spec.js
new file mode 100644
index 000000000..c78f839fa
--- /dev/null
+++ b/cypress_test/integration_tests/multiuser/sheet_operations_user1_spec.js
@@ -0,0 +1,46 @@
+/* global describe it cy beforeEach require afterEach */
+
+var helper = require('../common/helper');
+
+describe('Sheet operations: user-1.', function() {
+       var testFileName = 'sheet_operations.ods';
+
+       beforeEach(function() {
+               helper.beforeAll(testFileName);
+       });
+
+       afterEach(function() {
+               helper.afterAll(testFileName);
+       });
+
+       it('Insert/delete sheet.', function() {
+               // user-2 loads the same document
+
+               cy.get('#tb_actionbar_item_userlist')
+                       .should('be.visible');
+
+               cy.get('#tb_actionbar_item_userlist .w2ui-tb-caption')
+                       .should('have.text', '2 users');
+
+               // We have one sheet by default
+               cy.get('.spreadsheet-tab')
+                       .should('have.length', 1);
+               cy.get('#spreadsheet-tab0')
+                       .should('have.text', 'Sheet1');
+
+               // Add one more sheet
+               cy.get('#tb_spreadsheet-toolbar_item_insertsheet')
+                       .click();
+               cy.get('.spreadsheet-tab')
+                       .should('have.length', 2);
+               cy.get('#spreadsheet-tab1')
+                       .should('have.text', 'Sheet2');
+
+               // user-2 remove the first sheet
+               cy.get('.spreadsheet-tab')
+                       .should('have.length', 1);
+               cy.get('#spreadsheet-tab0')
+                       .should('have.text', 'Sheet2');
+       });
+
+});
diff --git 
a/cypress_test/integration_tests/multiuser/sheet_operations_user2_spec.js 
b/cypress_test/integration_tests/multiuser/sheet_operations_user2_spec.js
new file mode 100644
index 000000000..10f032d50
--- /dev/null
+++ b/cypress_test/integration_tests/multiuser/sheet_operations_user2_spec.js
@@ -0,0 +1,51 @@
+/* global describe it cy beforeEach require afterEach */
+
+var helper = require('../common/helper');
+
+describe('Sheet operations: user-2.', function() {
+       var testFileName = 'sheet_operations.ods';
+
+       beforeEach(function() {
+               // Wait here, before loading the document.
+               // Opening two clients at the same time causes an issue.
+               cy.wait(5000);
+               helper.beforeAll(testFileName);
+       });
+
+       afterEach(function() {
+               helper.afterAll(testFileName);
+       });
+
+       it('Insert/delete sheet.', function() {
+               // user-1 loads the same document
+
+               cy.get('#tb_actionbar_item_userlist')
+                       .should('be.visible');
+
+               cy.get('#tb_actionbar_item_userlist .w2ui-tb-caption')
+                       .should('have.text', '2 users');
+
+               // user-1 inserts a new sheet
+               cy.get('.spreadsheet-tab')
+                       .should('have.length', 2);
+               cy.get('#spreadsheet-tab0')
+                       .should('have.text', 'Sheet1');
+               cy.get('#spreadsheet-tab1')
+                       .should('have.text', 'Sheet2');
+
+               // remove the first tab
+               cy.get('#spreadsheet-tab0')
+                       .rightclick();
+
+               cy.contains('.context-menu-link', 'Delete Sheet...')
+                       .click();
+
+               cy.get('.vex-dialog-form .vex-dialog-button-primary')
+                       .click();
+
+               cy.get('.spreadsheet-tab')
+                       .should('have.length', 1);
+               cy.get('#spreadsheet-tab0')
+                       .should('have.text', 'Sheet2');
+       });
+});
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to