[Libreoffice-commits] online.git: cypress_test/integration_tests cypress_test/package.json
Tamás Zolnai (via logerrit)
logerrit at kemper.freedesktop.org
Sun Apr 26 15:13:42 UTC 2020
cypress_test/integration_tests/mobile/calc/alignment_options_spec.js | 127 +++++-----
cypress_test/package.json | 1
2 files changed, 65 insertions(+), 63 deletions(-)
New commits:
commit 3a13984b6b95fb22f414322022bed5b72f3872a1
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Sun Apr 26 14:22:55 2020 +0200
Commit: Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Sun Apr 26 17:13:24 2020 +0200
cypress: remove cypress-wait-until package.
We can use should method everywhere with a callback function
parameter. When there is no a specific item, which this should
is connected to we can use 'body' or any other existing item.
Change-Id: I3e1c5ca930b28304e886971ee50201d93a086b45
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92931
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/calc/alignment_options_spec.js b/cypress_test/integration_tests/mobile/calc/alignment_options_spec.js
index af9c6a449..a3b5c0165 100644
--- a/cypress_test/integration_tests/mobile/calc/alignment_options_spec.js
+++ b/cypress_test/integration_tests/mobile/calc/alignment_options_spec.js
@@ -1,7 +1,5 @@
/* global describe it cy beforeEach require afterEach expect*/
-import 'cypress-wait-until';
-
var helper = require('../../common/helper');
var mobileHelper = require('../../common/mobile_helper');
var calcHelper = require('./calc_helper');
@@ -179,17 +177,18 @@ describe('Change alignment settings.', function() {
.click();
// We use the text position as indicator
- cy.waitUntil(function() {
- getTextPosForFirstCell();
-
- return cy.get('@currentTextPos')
- .then(function(currentTextPos) {
- cy.get('@originalTextPos')
- .then(function(originalTextPos) {
- return originalTextPos < currentTextPos;
- });
- });
- });
+ cy.get('body')
+ .should(function() {
+ getTextPosForFirstCell();
+
+ cy.get('@currentTextPos')
+ .then(function(currentTextPos) {
+ cy.get('@originalTextPos')
+ .then(function(originalTextPos) {
+ expect(originalTextPos).to.be.lessThan(currentTextPos);
+ });
+ });
+ });
helper.initAliasToNegative('originalTextPos');
@@ -206,17 +205,18 @@ describe('Change alignment settings.', function() {
.click();
// We use the text position as indicator
- cy.waitUntil(function() {
- getTextPosForFirstCell();
-
- return cy.get('@currentTextPos')
- .then(function(currentTextPos) {
- cy.get('@originalTextPos')
- .then(function(originalTextPos) {
- return originalTextPos > currentTextPos;
- });
- });
- });
+ cy.get('body')
+ .should(function() {
+ getTextPosForFirstCell();
+
+ cy.get('@currentTextPos')
+ .then(function(currentTextPos) {
+ cy.get('@originalTextPos')
+ .then(function(originalTextPos) {
+ expect(originalTextPos).to.be.greaterThan(currentTextPos);
+ });
+ });
+ });
});
it.skip('Change text indent via input field.', function() {
@@ -254,17 +254,18 @@ describe('Change alignment settings.', function() {
.type('20{enter}');
// We use the text position as indicator
- cy.waitUntil(function() {
- getTextPosForFirstCell();
-
- return cy.get('@currentTextPos')
- .then(function(currentTextPos) {
- cy.get('@originalTextPos')
- .then(function(originalTextPos) {
- return originalTextPos < currentTextPos;
- });
- });
- });
+ cy.get('body')
+ .should(function() {
+ getTextPosForFirstCell();
+
+ cy.get('@currentTextPos')
+ .then(function(currentTextPos) {
+ cy.get('@originalTextPos')
+ .then(function(originalTextPos) {
+ expect(originalTextPos).to.be.lessThan(currentTextPos);
+ });
+ });
+ });
});
it('Enable text wrapping.', function() {
@@ -289,17 +290,18 @@ describe('Change alignment settings.', function() {
.should('have.prop', 'checked', true);
// We use the text position as indicator
- cy.waitUntil(function() {
- getTextPosForFirstCell();
-
- return cy.get('@currentTextPos')
- .then(function(currentTextPos) {
- cy.get('@originalTextPos')
- .then(function(originalTextPos) {
- return originalTextPos > currentTextPos;
- });
- });
- });
+ cy.get('body')
+ .should(function() {
+ getTextPosForFirstCell();
+
+ cy.get('@currentTextPos')
+ .then(function(currentTextPos) {
+ cy.get('@originalTextPos')
+ .then(function(originalTextPos) {
+ expect(originalTextPos).to.be.greaterThan(currentTextPos);
+ });
+ });
+ });
});
it('Apply stacked option.', function() {
@@ -338,22 +340,23 @@ describe('Change alignment settings.', function() {
// Even after we get the cell row selection the merge cell options is still disabled
// So we open mobile wizard again and again until merge cells get the right state
mobileHelper.openMobileWizard();
- cy.waitUntil(function() {
- mobileHelper.closeMobileWizard();
- mobileHelper.openMobileWizard();
-
- cy.get('#ScAlignmentPropertyPanel')
- .click();
-
- cy.get('#AlignLeft')
- .should('be.visible');
-
- return cy.get('input#mergecells')
- .then(function(items) {
- expect(items).to.have.lengthOf(1);
- return !items[0].hasAttribute('disabled');
- });
- });
+ cy.get('body')
+ .should(function() {
+ mobileHelper.closeMobileWizard();
+ mobileHelper.openMobileWizard();
+
+ cy.get('#ScAlignmentPropertyPanel')
+ .click();
+
+ cy.get('#AlignLeft')
+ .should('be.visible');
+
+ cy.get('input#mergecells')
+ .then(function(items) {
+ expect(items).to.have.lengthOf(1);
+ expect(items[0]).to.not.have.attr('disabled');
+ });
+ });
// Click merge cells
cy.get('input#mergecells')
diff --git a/cypress_test/package.json b/cypress_test/package.json
index a49df3820..cfdad5618 100644
--- a/cypress_test/package.json
+++ b/cypress_test/package.json
@@ -6,7 +6,6 @@
"dependencies": {
"cypress": "4.3.0",
"cypress-failed-log": "2.6.2",
- "cypress-wait-until": "1.6.1",
"eslint": "6.8.0",
"get-port-cli": "2.0.0",
"wait-on": "4.0.0"
More information about the Libreoffice-commits
mailing list