summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTamás Zolnai <tamas.zolnai@collabora.com>2020-12-04 15:59:09 +0100
committerTamás Zolnai <zolnaitamas2000@gmail.com>2020-12-08 13:46:40 +0100
commitd7bb312776eb20fbb3346f9a5eb67805a15bb39e (patch)
tree159fca2da480d13f96ba9057cec394c43200e566
parentcypress: remove this workaround. (diff)
downloadonline-d7bb312776eb20fbb3346f9a5eb67805a15bb39e.tar.gz
online-d7bb312776eb20fbb3346f9a5eb67805a15bb39e.zip
cypress: use moveCursor() helper method in table tests.
Signed-off-by: Tamás Zolnai <tamas.zolnai@collabora.com> Change-Id: Ic24458ca4aa32c3a883e6cfc018ca0429071cb43
-rw-r--r--cypress_test/integration_tests/mobile/writer/table_properties_spec.js40
1 files changed, 21 insertions, 19 deletions
diff --git a/cypress_test/integration_tests/mobile/writer/table_properties_spec.js b/cypress_test/integration_tests/mobile/writer/table_properties_spec.js
index e4b82e53e9..b848012307 100644
--- a/cypress_test/integration_tests/mobile/writer/table_properties_spec.js
+++ b/cypress_test/integration_tests/mobile/writer/table_properties_spec.js
@@ -28,11 +28,11 @@ describe('Change table properties / layout via mobile wizard.', function() {
.should('be.visible');
}
- function selectFullTable() {
- helper.typeIntoDocument('{downarrow}{downarrow}{downarrow}{downarrow}');
-
- // TODO: solve this better.
- cy.wait(1000);
+ function selectFullTable(cursorMovementCount, checkCursorVisibility = true) {
+ // Move cursor out of the table.
+ for (var i = 0; i < cursorMovementCount; i++) {
+ helper.moveCursor('down', checkCursorVisibility);
+ }
writerHelper.selectAllTextOfDoc();
}
@@ -47,7 +47,7 @@ describe('Change table properties / layout via mobile wizard.', function() {
cy.get('.leaflet-marker-icon.table-row-resize-marker')
.should('have.length', 4);
- selectFullTable();
+ selectFullTable(3);
// Check rows / columns
cy.get('#copy-paste-container tr')
@@ -70,7 +70,7 @@ describe('Change table properties / layout via mobile wizard.', function() {
cy.get('.leaflet-marker-icon.table-row-resize-marker')
.should('have.length', 4);
- selectFullTable();
+ selectFullTable(4);
// Check rows / columns
cy.get('#copy-paste-container tr')
@@ -93,7 +93,7 @@ describe('Change table properties / layout via mobile wizard.', function() {
cy.get('.leaflet-marker-icon.table-column-resize-marker')
.should('have.length', 4);
- selectFullTable();
+ selectFullTable(3);
// Check rows / columns
cy.get('#copy-paste-container tr')
@@ -116,7 +116,7 @@ describe('Change table properties / layout via mobile wizard.', function() {
cy.get('.leaflet-marker-icon.table-column-resize-marker')
.should('have.length', 4);
- selectFullTable();
+ selectFullTable(3);
// Check rows / columns
cy.get('#copy-paste-container tr')
@@ -139,7 +139,7 @@ describe('Change table properties / layout via mobile wizard.', function() {
cy.get('.leaflet-marker-icon.table-row-resize-marker')
.should('have.length', 2);
- selectFullTable();
+ selectFullTable(2);
// Check rows / columns
cy.get('#copy-paste-container tr')
@@ -204,7 +204,7 @@ describe('Change table properties / layout via mobile wizard.', function() {
helper.clickOnIdle('#MergeCells');
- selectFullTable();
+ selectFullTable(2);
// Check rows / columns
cy.get('#copy-paste-container tr')
@@ -229,7 +229,7 @@ describe('Change table properties / layout via mobile wizard.', function() {
cy.get('#rowheight .spinfield')
.should('have.attr', 'value', '1.4');
- selectFullTable();
+ selectFullTable(3);
// Check row height
cy.get('#copy-paste-container td')
@@ -249,7 +249,7 @@ describe('Change table properties / layout via mobile wizard.', function() {
cy.get('#columnwidth .spinfield')
.should('have.attr', 'value', '1.6');
- selectFullTable();
+ selectFullTable(3);
// Check row height
cy.get('#copy-paste-container td')
@@ -265,7 +265,7 @@ describe('Change table properties / layout via mobile wizard.', function() {
helper.clickOnIdle('#SetMinimalRowHeight');
- selectFullTable();
+ selectFullTable(1);
// Check new row height
cy.get('#copy-paste-container td')
@@ -281,7 +281,7 @@ describe('Change table properties / layout via mobile wizard.', function() {
helper.clickOnIdle('#SetOptimalRowHeight');
- selectFullTable();
+ selectFullTable(1);
// Check new row height
cy.get('#copy-paste-container td')
@@ -307,7 +307,7 @@ describe('Change table properties / layout via mobile wizard.', function() {
helper.clickOnIdle('#DistributeRows');
- selectFullTable();
+ selectFullTable(1);
// Check new row height
cy.get('#copy-paste-container td')
@@ -333,7 +333,7 @@ describe('Change table properties / layout via mobile wizard.', function() {
helper.clickOnIdle('#SetMinimalColumnWidth');
- selectFullTable();
+ selectFullTable(1);
cy.get('#copy-paste-container td')
.should('have.attr', 'width', '24');
@@ -348,7 +348,8 @@ describe('Change table properties / layout via mobile wizard.', function() {
helper.clickOnIdle('#SetOptimalColumnWidth');
- selectFullTable();
+ // TODO: issue here, view is not moved with the cursor
+ selectFullTable(1, false);
cy.get('#copy-paste-container td:nth-of-type(1n)')
.should('have.attr', 'width', '324');
@@ -365,7 +366,8 @@ describe('Change table properties / layout via mobile wizard.', function() {
helper.clickOnIdle('#DistributeColumns');
- selectFullTable();
+ // TODO: issue here, view is not moved with the cursor
+ selectFullTable(1, false);
cy.get('#copy-paste-container td')
.should('have.attr', 'width', '323');