From 23f079041319473a00ca3f67b306a092da8f3ba3 Mon Sep 17 00:00:00 2001 From: Rash419 Date: Tue, 15 Mar 2022 14:54:18 +0530 Subject: [PATCH] cypress: change template files tests to assert readOnly Signed-off-by: Rash419 Change-Id: Ib557424de7407346ca947bfe06289b772ec46d10 --- .../common/desktop_helper.js | 26 +++++++++++++++---- .../impress/open_different_file_types_spec.js | 14 +++------- .../writer/open_different_file_types_spec.js | 24 ++++------------- 3 files changed, 30 insertions(+), 34 deletions(-) diff --git a/cypress_test/integration_tests/common/desktop_helper.js b/cypress_test/integration_tests/common/desktop_helper.js index b54f4a499..f1fd546f9 100644 --- a/cypress_test/integration_tests/common/desktop_helper.js +++ b/cypress_test/integration_tests/common/desktop_helper.js @@ -1,6 +1,6 @@ /* global cy require Cypress expect */ -const { clickOnIdle, typeIntoDocument, waitUntilIdle } = require('./helper'); +var helper = require('./helper'); // Make the sidebar visible by clicking on the corresponding toolbar item. // We assume that the sidebar is hidden, when this method is called. @@ -213,7 +213,7 @@ function zoomOut() { function selectZoomLevel(zoomLevel) { makeZoomItemsVisible(); - clickOnIdle('#tb_actionbar_item_zoom'); + helper.clickOnIdle('#tb_actionbar_item_zoom'); cy.contains('.w2ui-drop-menu .menu-text', zoomLevel) .click(); @@ -256,9 +256,9 @@ function insertImage(docType) { } function deleteImage() { - typeIntoDocument('{del}'); + helper.typeIntoDocument('{del}'); - waitUntilIdle('.leaflet-pane.leaflet-overlay-pane'); + helper.waitUntilIdle('.leaflet-pane.leaflet-overlay-pane'); cy.get('.leaflet-pane.leaflet-overlay-pane svg g') .should('not.exist'); @@ -358,11 +358,26 @@ function assertScrollbarPosition(type, lowerBound, upperBound) { function pressKey(n, key) { for (let i=0; i