[Libreoffice-commits] online.git: cypress_test/data cypress_test/integration_tests cypress_test/Makefile.am
Tamás Zolnai (via logerrit)
logerrit at kemper.freedesktop.org
Mon Aug 3 16:20:24 UTC 2020
cypress_test/Makefile.am | 3
cypress_test/data/multiuser/slide_operations.odp |binary
cypress_test/integration_tests/multiuser/slide_operations_user1_spec.js | 38 ++++++++
cypress_test/integration_tests/multiuser/slide_operations_user2_spec.js | 45 ++++++++++
4 files changed, 85 insertions(+), 1 deletion(-)
New commits:
commit 036cc02d00d88e8e26db5e28da42e4fc67417e40
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Mon Aug 3 15:49:44 2020 +0200
Commit: Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Mon Aug 3 18:20:05 2020 +0200
cypress: add slide operations multi-user test.
Change-Id: I91a4a1ab581080d4b22c7b03224da4f48e157312
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/100006
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>
diff --git a/cypress_test/Makefile.am b/cypress_test/Makefile.am
index 0f7d95a02..ef91b4134 100644
--- a/cypress_test/Makefile.am
+++ b/cypress_test/Makefile.am
@@ -66,7 +66,8 @@ MULTIUSER_TESTS= \
paragraph_prop \
sidebar_visibility \
simultaneous_typing \
- sheet_operations
+ sheet_operations \
+ slide_operations
MOBILE_TEST_FILES_DONE= \
$(foreach test_file,$(MOBILE_TEST_FILES),$(MOBILE_TRACK_FOLDER)/$(test_file).done)
diff --git a/cypress_test/data/multiuser/slide_operations.odp b/cypress_test/data/multiuser/slide_operations.odp
new file mode 100644
index 000000000..81cee640e
Binary files /dev/null and b/cypress_test/data/multiuser/slide_operations.odp differ
diff --git a/cypress_test/integration_tests/multiuser/slide_operations_user1_spec.js b/cypress_test/integration_tests/multiuser/slide_operations_user1_spec.js
new file mode 100644
index 000000000..640102cd6
--- /dev/null
+++ b/cypress_test/integration_tests/multiuser/slide_operations_user1_spec.js
@@ -0,0 +1,38 @@
+/* global describe it cy beforeEach require afterEach */
+
+var helper = require('../common/helper');
+var impressHelper = require('../common/impress_helper');
+
+describe('Slide operations: user-1.', function() {
+ var testFileName = 'slide_operations.odp';
+
+ beforeEach(function() {
+ helper.beforeAll(testFileName);
+ });
+
+ afterEach(function() {
+ helper.afterAll(testFileName);
+ });
+
+ it('Insert/delete slide.', 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 slide by default
+ impressHelper.assertNumberOfSlidePreviews(1);
+
+ // Add one more slide
+ cy.get('#tb_presentation-toolbar_item_insertpage')
+ .click();
+
+ impressHelper.assertNumberOfSlidePreviews(2);
+
+ // then user-2 removes one of the slides
+ impressHelper.assertNumberOfSlidePreviews(1);
+ });
+
+});
diff --git a/cypress_test/integration_tests/multiuser/slide_operations_user2_spec.js b/cypress_test/integration_tests/multiuser/slide_operations_user2_spec.js
new file mode 100644
index 000000000..506cd080c
--- /dev/null
+++ b/cypress_test/integration_tests/multiuser/slide_operations_user2_spec.js
@@ -0,0 +1,45 @@
+/* global describe it cy beforeEach require afterEach */
+
+var helper = require('../common/helper');
+var impressHelper = require('../common/impress_helper');
+
+describe('Slide operations: user-2.', function() {
+ var testFileName = 'slide_operations.odp';
+
+ 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 slide.', 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 slide
+ impressHelper.assertNumberOfSlidePreviews(2);
+
+ // remove the second slide
+ cy.get('#slide-sorter .preview-frame:nth-of-type(3)')
+ .click();
+
+ cy.get('#slide-sorter .preview-frame:nth-of-type(3) .preview-img')
+ .should('have.class', 'preview-img-currentpart');
+
+ helper.clickOnIdle('#tb_presentation-toolbar_item_deletepage');
+
+ cy.get('.vex-dialog-form .vex-dialog-button-primary')
+ .click();
+
+ impressHelper.assertNumberOfSlidePreviews(1);
+ });
+});
More information about the Libreoffice-commits
mailing list