cypress_test/integration_tests/desktop/calc/focus_spec.js |   12 ++++-------
 cypress_test/integration_tests/mobile/calc/focus_spec.js  |   15 ++++++--------
 2 files changed, 12 insertions(+), 15 deletions(-)

New commits:
commit fdf31909c99d342d85796443608d11c85ebff8b5
Author:     Tamás Zolnai <tamas.zol...@collabora.com>
AuthorDate: Mon Apr 27 12:17:54 2020 +0200
Commit:     Tamás Zolnai <tamas.zol...@collabora.com>
CommitDate: Mon Apr 27 15:33:17 2020 +0200

    cypress: remove some cy.wait() calls.
    
    The helper functions were improved in the meantime.
    
    Change-Id: Ie8ae8caf5b33567681010a7a0cfc45d2da061f8b
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92973
    Reviewed-by: Tamás Zolnai <tamas.zol...@collabora.com>
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>

diff --git a/cypress_test/integration_tests/desktop/calc/focus_spec.js 
b/cypress_test/integration_tests/desktop/calc/focus_spec.js
index aebef57f8..4c2982d0a 100644
--- a/cypress_test/integration_tests/desktop/calc/focus_spec.js
+++ b/cypress_test/integration_tests/desktop/calc/focus_spec.js
@@ -3,8 +3,6 @@
 var helper = require('../../common/helper');
 var calc = require('../../common/calc');
 
-var delayForEventsMs = 300; // The maximum roundrip time for an event to fire 
based on some action.
-
 describe('Calc focus tests', function() {
        beforeEach(function() {
                helper.beforeAllDesktop('focus.ods', 'calc');
@@ -30,7 +28,7 @@ describe('Calc focus tests', function() {
                // Type some text.
                var text1 = 'Hello from Calc';
                helper.typeText('textarea.clipboard', text1);
-               
cy.get('textarea.clipboard').type('{enter}').wait(delayForEventsMs);
+               cy.get('textarea.clipboard').type('{enter}');
 
                // Select the first cell to edit the same one.
                calc.clickOnFirstCell();
@@ -40,7 +38,7 @@ describe('Calc focus tests', function() {
                cy.get('textarea.clipboard').type('{ctrl}a');
                helper.expectTextForClipboard(text1);
                // End editing.
-               
cy.get('textarea.clipboard').type('{enter}').wait(delayForEventsMs);
+               cy.get('textarea.clipboard').type('{enter}');
 
                // Type some more text, at the end.
                cy.log('Appending text at the end.');
@@ -50,10 +48,10 @@ describe('Calc focus tests', function() {
                var text2 = ', this is a test.';
                helper.typeText('textarea.clipboard', text2);
                // Validate.
-               
cy.get('textarea.clipboard').type('{ctrl}a').wait(delayForEventsMs);
+               cy.get('textarea.clipboard').type('{ctrl}a');
                helper.expectTextForClipboard(text1 + text2);
                // End editing.
-               
cy.get('textarea.clipboard').type('{enter}').wait(delayForEventsMs);
+               cy.get('textarea.clipboard').type('{enter}');
 
                // Type some more text, in the middle.
                cy.log('Inserting text in the middle.');
@@ -63,7 +61,7 @@ describe('Calc focus tests', function() {
                var text3 = ' BAZINGA';
                helper.typeText('textarea.clipboard', text3);
                // Validate.
-               
cy.get('textarea.clipboard').type('{ctrl}a').wait(delayForEventsMs);
+               cy.get('textarea.clipboard').type('{ctrl}a');
                //NOTE: If this fails, it's probably because we clicked
                // at a different point in the text.
                helper.expectTextForClipboard(text1 + ', this is a' + text3 + ' 
test.');
diff --git a/cypress_test/integration_tests/mobile/calc/focus_spec.js 
b/cypress_test/integration_tests/mobile/calc/focus_spec.js
index 1836fb1b2..3e2b3c8b0 100644
--- a/cypress_test/integration_tests/mobile/calc/focus_spec.js
+++ b/cypress_test/integration_tests/mobile/calc/focus_spec.js
@@ -5,8 +5,6 @@ var mobileHelper = require('../../common/mobile_helper');
 var calc = require('../../common/calc');
 var calcHelper = require('./calc_helper');
 
-var delayForEventsMs = 300; // The maximum roundrip time for an event to fire 
based on some action.
-
 describe('Calc focus tests', function() {
        beforeEach(function() {
                mobileHelper.beforeAllMobile('focus.ods', 'calc');
@@ -103,7 +101,7 @@ describe('Calc focus tests', function() {
                // Type some text.
                var text1 = 'Hello from Calc';
                cy.get('textarea.clipboard').type(text1);
-               
cy.get('textarea.clipboard').type('{enter}').wait(delayForEventsMs);
+               cy.get('textarea.clipboard').type('{enter}');
 
                helper.assertNoKeyboardInput();
 
@@ -118,7 +116,8 @@ describe('Calc focus tests', function() {
                helper.expectTextForClipboard(text1);
 
                // Accept changes.
-               
cy.get('textarea.clipboard').type('{enter}').wait(delayForEventsMs);
+               cy.get('textarea.clipboard').type('{enter}');
+               helper.assertNoKeyboardInput();
 
                // Type some more text, at the end.
                cy.log('Appending text at the end.');
@@ -129,10 +128,10 @@ describe('Calc focus tests', function() {
                var text2 = ', this is a test.';
                cy.get('textarea.clipboard').type(text2);
                // Validate.
-               
cy.get('textarea.clipboard').type('{ctrl}a').wait(delayForEventsMs);
+               cy.get('textarea.clipboard').type('{ctrl}a');
                helper.expectTextForClipboard(text1 + text2);
                // End editing.
-               
cy.get('textarea.clipboard').type('{enter}').wait(delayForEventsMs);
+               cy.get('textarea.clipboard').type('{enter}');
                helper.assertNoKeyboardInput();
 
                // Type some more text, in the middle.
@@ -144,12 +143,12 @@ describe('Calc focus tests', function() {
                var text3 = ', BAZINGA';
                helper.typeText('textarea.clipboard', text3);
                // Validate.
-               
cy.get('textarea.clipboard').type('{ctrl}a').wait(delayForEventsMs);
+               cy.get('textarea.clipboard').type('{ctrl}a');
                //NOTE: If this fails, it's probably because we clicked
                // at a different point in the text.
                helper.expectTextForClipboard(text1 + text3 + text2);
                // End editing.
-               
cy.get('textarea.clipboard').type('{enter}').wait(delayForEventsMs);
+               cy.get('textarea.clipboard').type('{enter}');
                helper.assertNoKeyboardInput();
        });
 });
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to