[Libreoffice-commits] online.git: 2 commits - cypress_test/integration_tests
Tamás Zolnai (via logerrit)
logerrit at kemper.freedesktop.org
Fri Aug 14 18:38:05 UTC 2020
cypress_test/integration_tests/common/helper.js | 18 ++++---
cypress_test/integration_tests/mobile/impress/impress_mobile_helper.js | 25 ++++++----
2 files changed, 29 insertions(+), 14 deletions(-)
New commits:
commit 6d239a3a9f2d096477f3a58a66e559dba27f6b88
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Fri Aug 14 15:00:02 2020 +0200
Commit: Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Fri Aug 14 20:37:58 2020 +0200
cypress: improve selectTextOfShape() method.
Sometimes double clicking inside the shape does
not makes the shape to step into text editing mode.
To avoid this kind of issue, we can click more times
until we get the cursor.
Change-Id: I4a9671c299144bd8ca250b575665538ab14758ad
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/100755
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/integration_tests/mobile/impress/impress_mobile_helper.js b/cypress_test/integration_tests/mobile/impress/impress_mobile_helper.js
index 90702bd90..1f197e3ba 100644
--- a/cypress_test/integration_tests/mobile/impress/impress_mobile_helper.js
+++ b/cypress_test/integration_tests/mobile/impress/impress_mobile_helper.js
@@ -25,14 +25,23 @@ function selectTextShapeInTheCenter() {
function selectTextOfShape() {
// Double click onto the selected shape
- cy.get('svg g .leaflet-interactive')
- .then(function(items) {
- expect(items).to.have.length(1);
- var XPos = (items[0].getBoundingClientRect().left + items[0].getBoundingClientRect().right) / 2;
- var YPos = (items[0].getBoundingClientRect().top + items[0].getBoundingClientRect().bottom) / 2;
- cy.get('body')
- .dblclick(XPos, YPos);
- });
+ cy.waitUntil(function() {
+ cy.get('svg g .leaflet-interactive')
+ .then(function(items) {
+ expect(items).to.have.length(1);
+ var XPos = (items[0].getBoundingClientRect().left + items[0].getBoundingClientRect().right) / 2;
+ var YPos = (items[0].getBoundingClientRect().top + items[0].getBoundingClientRect().bottom) / 2;
+ cy.get('body')
+ .dblclick(XPos, YPos);
+ });
+
+ cy.wait(2000);
+
+ return cy.get('.leaflet-overlay-pane')
+ .then(function(overlay) {
+ return overlay.children('.leaflet-cursor-container').length !== 0;
+ });
+ });
cy.get('.leaflet-cursor.blinking-cursor')
.should('exist');
commit 0134d74b4532dc6514567c4ee37a1002e827314e
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Fri Aug 14 14:45:52 2020 +0200
Commit: Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Fri Aug 14 20:37:47 2020 +0200
cypress: improve typeIntoDocument() method.
Change-Id: I9e28a44a42596624c6c40984581e97679fad63b3
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/100754
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/integration_tests/common/helper.js b/cypress_test/integration_tests/common/helper.js
index 8596246bc..8113ee55e 100644
--- a/cypress_test/integration_tests/common/helper.js
+++ b/cypress_test/integration_tests/common/helper.js
@@ -509,17 +509,23 @@ function moveCursor(direction) {
}
function typeIntoDocument(text) {
- cy.get('textarea.clipboard')
- .focus();
+ cy.log('Typing into document - start.');
- cy.document().its('activeElement.tagName')
- .should('be.eq', 'TEXTAREA');
+ cy.document()
+ .then(function(doc) {
+ if (doc.activeElement.className !== 'clipboard') {
+ cy.get('textarea.clipboard')
+ .focus();
- cy.document().its('activeElement.className')
- .should('be.eq', 'clipboard');
+ cy.document().its('activeElement.className')
+ .should('be.eq', 'clipboard');
+ }
+ });
cy.get('textarea.clipboard')
.type(text, {force: true});
+
+ cy.log('Typing into document - end.');
}
module.exports.loadTestDoc = loadTestDoc;
More information about the Libreoffice-commits
mailing list