[Libreoffice-commits] online.git: Branch 'feature/cypress_integration' - 3 commits - cypress_test/integration_tests cypress_test/package.json
Tamás Zolnai (via logerrit)
logerrit at kemper.freedesktop.org
Fri Jan 17 18:12:53 UTC 2020
cypress_test/integration_tests/mobile/focus_spec.js | 2
cypress_test/integration_tests/mobile/mobile_wizard_state_spec.js | 167 ++++++++++
cypress_test/integration_tests/mobile/toolbar_spec.js | 15
cypress_test/package.json | 6
4 files changed, 170 insertions(+), 20 deletions(-)
New commits:
commit fb29fcb5f4cd707825560f1e50e0be16dafc27a3
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Fri Jan 17 19:10:45 2020 +0100
Commit: Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Fri Jan 17 19:10:45 2020 +0100
cypress: mobile: Add some tests about the state of mobile wizard.
Change-Id: I38869d7fcc03690610a19c7803a596cfebf75c7a
diff --git a/cypress_test/integration_tests/mobile/mobile_wizard_state_spec.js b/cypress_test/integration_tests/mobile/mobile_wizard_state_spec.js
new file mode 100644
index 000000000..e25fdb343
--- /dev/null
+++ b/cypress_test/integration_tests/mobile/mobile_wizard_state_spec.js
@@ -0,0 +1,167 @@
+/* global describe it cy Cypress beforeEach*/
+
+describe('Toolbar tests', function() {
+ beforeEach(function() {
+ // Get a clean test document
+ cy.task('copyFile', {
+ sourceDir: Cypress.env('DATA_FOLDER'),
+ destDir: Cypress.env('WORKDIR'),
+ fileName: 'empty.odt',
+ });
+
+ // Open test document
+ cy.viewport('iphone-3');
+ cy.visit('http://localhost:9980/loleaflet/fc04ba550/loleaflet.html?file_path=file://' +
+ Cypress.env('WORKDIR') + 'empty.odt');
+
+ // Wait for the document to fully load
+ cy.get('.leaflet-tile-loaded');
+ });
+
+ it('Open and close mobile wizard by toolbar item.', function() {
+ // Click on edit button
+ cy.get('#mobile-edit-button').click();
+
+ // Click on mobile wizard toolbar item
+ cy.get('#tb_actionbar_item_mobile_wizard')
+ .should('not.have.class', 'disabled')
+ .click();
+
+ // Mobile wizard is opened and it has any content
+ cy.get('#mobile-wizard-content')
+ .should('not.be.empty');
+ cy.get('#tb_actionbar_item_mobile_wizard table')
+ .should('have.class', 'checked');
+
+ // Toolbar button is checked
+ cy.get('#tb_actionbar_item_mobile_wizard table')
+ .should('have.class', 'checked');
+
+ cy.get('#tb_actionbar_item_mobile_wizard')
+ .click();
+
+ // Mobile wizard is closed
+ cy.get('#mobile-wizard')
+ .should('not.be.visible');
+
+ cy.get('#tb_actionbar_item_mobile_wizard table')
+ .should('not.have.class', 'checked');
+
+ // Open mobile wizard again
+ cy.get('#tb_actionbar_item_mobile_wizard')
+ .click();
+
+ // Mobile wizard is opened and it has any content
+ // TODO: fix this bug
+ /*cy.get('#mobile-wizard-content')
+ .should('not.be.empty'); */
+ cy.get('#tb_actionbar_item_mobile_wizard table')
+ .should('have.class', 'checked');
+ });
+
+ it('Close mobile wizard by hamburger menu.', function() {
+ // Click on edit button
+ cy.get('#mobile-edit-button').click();
+
+ // Click on mobile wizard toolbar item
+ cy.get('#tb_actionbar_item_mobile_wizard')
+ .should('not.have.class', 'disabled')
+ .click();
+
+ // Mobile wizard is opened and it has any content
+ cy.get('#mobile-wizard-content')
+ .should('not.be.empty');
+ cy.get('#tb_actionbar_item_mobile_wizard table')
+ .should('have.class', 'checked');
+
+ // Open hamburger menu
+ cy.get('#toolbar-hamburger').click();
+ cy.get('.ui-header.level-0.mobile-wizard.ui-widget .menu-entry-with-icon')
+ .contains('About');
+
+ // Close hamburger menu
+ cy.get('#toolbar-hamburger').click();
+ // Mobile wizard is closed
+ cy.get('#mobile-wizard')
+ .should('not.be.visible');
+
+ // Open mobile wizard again
+ cy.get('#tb_actionbar_item_mobile_wizard')
+ .click();
+
+ // TODO: fix this bug
+ //cy.get('#mobile-wizard-content')
+ // .should('not.be.empty');
+ cy.get('#tb_actionbar_item_mobile_wizard table')
+ .should('have.class', 'checked');
+ });
+
+ it('Close mobile wizard by back button.', function() {
+ // Click on edit button
+ cy.get('#mobile-edit-button').click();
+
+ // Click on mobile wizard toolbar item
+ cy.get('#tb_actionbar_item_mobile_wizard')
+ .should('not.have.class', 'disabled')
+ .click();
+
+ // Mobile wizard is opened and it has any content
+ cy.get('#mobile-wizard-content')
+ .should('not.be.empty');
+ cy.get('#tb_actionbar_item_mobile_wizard table')
+ .should('have.class', 'checked');
+
+ // Close mobile wizard by clicking on the back button
+ cy.get('#mobile-wizard-back').click();
+ cy.get('#mobile-wizard')
+ .should('not.be.visible');
+ cy.get('#tb_actionbar_item_mobile_wizard table')
+ .should('not.have.class', 'checked');
+
+ // Open mobile wizard again
+ cy.get('#tb_actionbar_item_mobile_wizard')
+ .click();
+
+ // TODO: fix this bug
+ //cy.get('#mobile-wizard-content')
+ // .should('not.be.empty');
+ cy.get('#tb_actionbar_item_mobile_wizard table')
+ .should('have.class', 'checked');
+ });
+
+ it('Close mobile wizard by context wizard.', function() {
+ // Click on edit button
+ cy.get('#mobile-edit-button').click();
+
+ // Click on mobile wizard toolbar item
+ cy.get('#tb_actionbar_item_mobile_wizard')
+ .should('not.have.class', 'disabled')
+ .click();
+
+ // Mobile wizard is opened and it has any content
+ cy.get('#mobile-wizard-content')
+ .should('not.be.empty');
+ cy.get('#tb_actionbar_item_mobile_wizard table')
+ .should('have.class', 'checked');
+
+ // Open context wizard by right click on document
+ cy.get('#document-container').rightclick();
+ cy.get('.ui-header.level-0.mobile-wizard.ui-widget .menu-entry-with-icon')
+ .contains('Paste');
+
+ // TODO: fix this bug
+ //cy.get('#tb_actionbar_item_mobile_wizard table')
+ // .should('not.have.class', 'checked');
+
+ // Open mobile wizard again
+ cy.get('#tb_actionbar_item_mobile_wizard')
+ .click();
+
+ // TODO: fix this bug
+ //cy.get('#mobile-wizard-content')
+ // .should('not.be.empty');
+ //cy.get('#tb_actionbar_item_mobile_wizard table')
+ // .should('have.class', 'checked');
+ });
+});
+
diff --git a/cypress_test/integration_tests/mobile/toolbar_spec.js b/cypress_test/integration_tests/mobile/toolbar_spec.js
index ec4658366..d284ee720 100644
--- a/cypress_test/integration_tests/mobile/toolbar_spec.js
+++ b/cypress_test/integration_tests/mobile/toolbar_spec.js
@@ -131,15 +131,6 @@ describe('Toolbar tests', function() {
cy.get('#tb_actionbar_item_mobile_wizard table')
.should('not.have.class', 'checked');
-
- // Open mobile wizard again
- cy.get('#tb_actionbar_item_mobile_wizard')
- .click();
-
- // Mobile wizard is opened and it has any content
- // TODO: fix this bug
- /*cy.get('#mobile-wizard-content')
- .should('not.be.empty'); */
});
it('Open and close insertion mobile wizard by toolbar item.', function() {
commit 29019dbfae29282a50113167cfe03f48dff2de23
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Fri Jan 17 17:42:23 2020 +0100
Commit: Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Fri Jan 17 17:42:23 2020 +0100
cypress: mobile: Fix mobile wizard id.
Change-Id: I171f98705e894f5a73afd7c92b489620f3bec4ac
diff --git a/cypress_test/integration_tests/mobile/focus_spec.js b/cypress_test/integration_tests/mobile/focus_spec.js
index 705bfc447..a02d4fa9a 100644
--- a/cypress_test/integration_tests/mobile/focus_spec.js
+++ b/cypress_test/integration_tests/mobile/focus_spec.js
@@ -107,7 +107,7 @@ describe('Focus tests', function() {
// Insert a field
cy.get('.ui-header.level-1.mobile-wizard.ui-widget .menu-entry-with-icon')
.contains('Page Number').click();
- cy.get('#mobile_wizard').should('not.be.visible');
+ cy.get('#mobile-wizard').should('not.be.visible');
// This fails here: the focus is not on the document body
// The document should have the focus again
diff --git a/cypress_test/integration_tests/mobile/toolbar_spec.js b/cypress_test/integration_tests/mobile/toolbar_spec.js
index 29f9a67bf..ec4658366 100644
--- a/cypress_test/integration_tests/mobile/toolbar_spec.js
+++ b/cypress_test/integration_tests/mobile/toolbar_spec.js
@@ -127,8 +127,7 @@ describe('Toolbar tests', function() {
.click();
// Mobile wizard is closed
- cy.get('#mobile_wizard')
- .should('not.be.visible');
+ cy.get('#mobile-wizard').should('not.be.visible');
cy.get('#tb_actionbar_item_mobile_wizard table')
.should('not.have.class', 'checked');
@@ -165,8 +164,7 @@ describe('Toolbar tests', function() {
.click();
// Mobile wizard is closed
- cy.get('#mobile_wizard')
- .should('not.be.visible');
+ cy.get('#mobile-wizard').should('not.be.visible');
cy.get('#tb_actionbar_item_insertion_mobile_wizard table')
.should('not.have.class', 'checked');
commit 085ae9c1b559074c4257f18becb6d75346cd7299
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Thu Jan 16 15:51:43 2020 +0100
Commit: Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Thu Jan 16 15:51:43 2020 +0100
cypress: Remove obsolete scripts.
These were replaced by make commands.
Change-Id: I98978b52801b44a36c09388cf5eb3ed5a09326c3
diff --git a/cypress_test/package.json b/cypress_test/package.json
index 70f7f46fe..fe33a789f 100644
--- a/cypress_test/package.json
+++ b/cypress_test/package.json
@@ -10,11 +10,5 @@
"repository": {
"type": "git",
"url": "git://gerrit.libreoffice.org/online.git"
- },
- "scripts": {
- "cyrun_desktop": "node_modules/cypress/bin/cypress run --browser chrome --config integrationFolder=integration_tests/desktop --headless",
- "cyrun_mobile": "node_modules/cypress/bin/cypress run --browser chrome --config integrationFolder=integration_tests/mobile,userAgent=\"cypress mobile test\" --headless",
- "cyopen_desktop": "node_modules/cypress/bin/cypress open --config integrationFolder=integration_tests/desktop",
- "cyopen_mobile": "node_modules/cypress/bin/cypress open --config integrationFolder=integration_tests/mobile,userAgent=\"cypress mobile test\""
}
}
More information about the Libreoffice-commits
mailing list