[Libreoffice-commits] online.git: cypress_test/integration_tests
Tamás Zolnai (via logerrit)
logerrit at kemper.freedesktop.org
Mon Jun 15 12:44:38 UTC 2020
cypress_test/integration_tests/mobile/writer/hamburger_menu_spec.js | 226 ++++++++++
1 file changed, 226 insertions(+)
New commits:
commit f16e27c0490aee59bb1e67af3561e9fbaad8d1ff
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Mon Jun 15 13:21:33 2020 +0200
Commit: Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Mon Jun 15 14:44:19 2020 +0200
cypress: add tests for Edit menu items (writer, mobile).
Change-Id: Iec7c244f34f1c7c7bbf55c22db71d72278553cef
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/96329
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>
diff --git a/cypress_test/integration_tests/mobile/writer/hamburger_menu_spec.js b/cypress_test/integration_tests/mobile/writer/hamburger_menu_spec.js
index e42512c3d..c024c286b 100644
--- a/cypress_test/integration_tests/mobile/writer/hamburger_menu_spec.js
+++ b/cypress_test/integration_tests/mobile/writer/hamburger_menu_spec.js
@@ -18,6 +18,232 @@ describe('Trigger hamburger menu options.', function() {
helper.afterAll(testFileName);
});
+ it('Undo/redo.', function() {
+ // Type a new character
+ cy.get('textarea.clipboard')
+ .type('{q}');
+
+ writerMobileHelper.selectAllMobile();
+
+ cy.get('#copy-paste-container p')
+ .should('contain.text', 'q');
+
+ // Undo
+ mobileHelper.openHamburgerMenu();
+
+ cy.contains('.menu-entry-with-icon', 'Edit')
+ .click();
+
+ cy.contains('.menu-entry-with-icon', 'Undo')
+ .click();
+
+ writerMobileHelper.selectAllMobile();
+
+ cy.get('#copy-paste-container p')
+ .should('not.contain.text', 'q');
+
+ // Redo
+ mobileHelper.openHamburgerMenu();
+
+ cy.contains('.menu-entry-with-icon', 'Edit')
+ .click();
+
+ cy.contains('.menu-entry-with-icon', 'Redo')
+ .click();
+
+ writerMobileHelper.selectAllMobile();
+
+ cy.get('#copy-paste-container p')
+ .should('contain.text', 'q');
+ });
+
+ it('Repair.', function() {
+ // First change
+ cy.get('textarea.clipboard')
+ .type('{q}');
+
+ // Second change
+ cy.get('textarea.clipboard')
+ .type('{w}');
+
+ writerMobileHelper.selectAllMobile();
+
+ cy.get('#copy-paste-container p')
+ .should('contain.text', 'qw');
+
+ // Undo
+ mobileHelper.openHamburgerMenu();
+
+ cy.contains('.menu-entry-with-icon', 'Edit')
+ .click();
+
+ cy.contains('.menu-entry-with-icon', 'Undo')
+ .click();
+
+ writerMobileHelper.selectAllMobile();
+
+ cy.get('#copy-paste-container p')
+ .should('not.contain.text', 'w');
+
+ // Revert one undo step via Repair
+ mobileHelper.openHamburgerMenu();
+
+ cy.contains('.menu-entry-with-icon', 'Edit')
+ .click();
+
+ cy.contains('.menu-entry-with-icon', 'Repair')
+ .click();
+
+ cy.get('.leaflet-popup-content')
+ .should('be.visible');
+
+ cy.get('.leaflet-popup-content table tr:nth-of-type(2)')
+ .should('contain.text', 'Redo');
+
+ cy.get('.leaflet-popup-content table tr:nth-of-type(3)')
+ .should('contain.text', 'Undo');
+
+ cy.get('.leaflet-popup-content table tr:nth-of-type(2)')
+ .click();
+
+ cy.get('.leaflet-popup-content input[value=\'Jump to state\']')
+ .click();
+
+ writerMobileHelper.selectAllMobile();
+
+ cy.get('#copy-paste-container p')
+ .should('contain.text', 'qw');
+
+ // Revert to the initial state via Repair
+ mobileHelper.openHamburgerMenu();
+
+ cy.contains('.menu-entry-with-icon', 'Edit')
+ .click();
+
+ cy.contains('.menu-entry-with-icon', 'Repair')
+ .click();
+
+ cy.get('.leaflet-popup-content')
+ .should('be.visible');
+
+ cy.get('.leaflet-popup-content table tr:nth-of-type(2)')
+ .should('contain.text', 'Undo');
+
+ cy.get('.leaflet-popup-content table tr:nth-of-type(3)')
+ .should('contain.text', 'Undo');
+
+ cy.get('.leaflet-popup-content table tr:nth-of-type(3)')
+ .click();
+
+ cy.get('.leaflet-popup-content input[value=\'Jump to state\']')
+ .click();
+
+ writerMobileHelper.selectAllMobile();
+
+ cy.get('#copy-paste-container p')
+ .should('not.contain.text', 'q');
+
+ cy.get('#copy-paste-container p')
+ .should('not.contain.text', 'w');
+ });
+
+ it('Cut.', function() {
+ writerMobileHelper.selectAllMobile();
+
+ mobileHelper.openHamburgerMenu();
+
+ cy.contains('.menu-entry-with-icon', 'Edit')
+ .click();
+
+ cy.contains('.menu-entry-with-icon', 'Cut')
+ .click();
+
+ // TODO: cypress does not support clipboard operations
+ // so we get a warning dialog here.
+ cy.get('.vex-dialog-form')
+ .should('be.visible');
+
+ cy.get('.vex-dialog-message')
+ .should('have.text', 'Please use the copy/paste buttons on your on-screen keyboard.');
+
+ cy.get('.vex-dialog-button-primary.vex-dialog-button.vex-first')
+ .click();
+
+ cy.get('.vex-dialog-form')
+ .should('not.be.visible');
+ });
+
+ it('Copy.', function() {
+ writerMobileHelper.selectAllMobile();
+
+ mobileHelper.openHamburgerMenu();
+
+ cy.contains('.menu-entry-with-icon', 'Edit')
+ .click();
+
+ cy.contains('.menu-entry-with-icon', 'Copy')
+ .click();
+
+ // TODO: cypress does not support clipboard operations
+ // so we get a warning dialog here.
+ cy.get('.vex-dialog-form')
+ .should('be.visible');
+
+ cy.get('.vex-dialog-message')
+ .should('have.text', 'Please use the copy/paste buttons on your on-screen keyboard.');
+
+ cy.get('.vex-dialog-button-primary.vex-dialog-button.vex-first')
+ .click();
+
+ cy.get('.vex-dialog-form')
+ .should('not.be.visible');
+ });
+
+ it('Paste.', function() {
+ writerMobileHelper.selectAllMobile();
+
+ mobileHelper.openHamburgerMenu();
+
+ cy.contains('.menu-entry-with-icon', 'Edit')
+ .click();
+
+ cy.contains('.menu-entry-with-icon', 'Paste')
+ .click();
+
+ // TODO: cypress does not support clipboard operations
+ // so we get a warning dialog here.
+ cy.get('.vex-dialog-form')
+ .should('be.visible');
+
+ cy.get('.vex-dialog-message')
+ .should('have.text', 'Please use the copy/paste buttons on your on-screen keyboard.');
+
+ cy.get('.vex-dialog-button-primary.vex-dialog-button.vex-first')
+ .click();
+
+ cy.get('.vex-dialog-form')
+ .should('not.be.visible');
+ });
+
+ it('Select all.', function() {
+ cy.get('#copy-paste-container p')
+ .should('not.contain.text', 'xxxxxx');
+
+ mobileHelper.openHamburgerMenu();
+
+ cy.contains('.menu-entry-with-icon', 'Edit')
+ .click();
+
+ cy.contains('.menu-entry-with-icon', 'Select All')
+ .click();
+
+ cy.get('.leaflet-marker-icon')
+ .should('be.visible');
+
+ cy.get('#copy-paste-container p')
+ .should('contain.text', 'xxxxxx');
+ });
+
it('Enable track changes recording.', function() {
mobileHelper.openHamburgerMenu();
More information about the Libreoffice-commits
mailing list