From 635257401895feaa87b39bd07e36f0b4da0daa02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Zolnai?= Date: Wed, 13 Jan 2021 03:32:14 +0100 Subject: [PATCH] cypress: remove duplicate selectFirstColumn() helper method. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Now we have it in the general calc helper file. Signed-off-by: Tamás Zolnai Change-Id: Id7f12441b9612a630f6b348a9e6db6235f4b6c45 --- .../mobile/calc/calc_mobile_helper.js | 16 ---------------- .../integration_tests/mobile/calc/chart_spec.js | 4 ++-- .../mobile/calc/hamburger_menu_spec.js | 11 +++++------ 3 files changed, 7 insertions(+), 24 deletions(-) diff --git a/cypress_test/integration_tests/mobile/calc/calc_mobile_helper.js b/cypress_test/integration_tests/mobile/calc/calc_mobile_helper.js index 32df100b2..0a3292a60 100644 --- a/cypress_test/integration_tests/mobile/calc/calc_mobile_helper.js +++ b/cypress_test/integration_tests/mobile/calc/calc_mobile_helper.js @@ -21,20 +21,4 @@ function selectFirstRow() { .should('have.prop', 'value', 'A1:AMJ1'); } -function selectFirstColumn() { - cy.get('.spreadsheet-header-columns') - .then(function(items) { - expect(items).to.have.lengthOf(1); - - var XPos = items[0].getBoundingClientRect().left + 10; - var YPos = (items[0].getBoundingClientRect().top + items[0].getBoundingClientRect().bottom) / 2; - cy.get('body') - .click(XPos, YPos); - }); - - cy.get('input#addressInput') - .should('have.prop', 'value', 'A1:A1048576'); -} - module.exports.selectFirstRow = selectFirstRow; -module.exports.selectFirstColumn = selectFirstColumn; diff --git a/cypress_test/integration_tests/mobile/calc/chart_spec.js b/cypress_test/integration_tests/mobile/calc/chart_spec.js index 4ad9f5698..f798a283b 100644 --- a/cypress_test/integration_tests/mobile/calc/chart_spec.js +++ b/cypress_test/integration_tests/mobile/calc/chart_spec.js @@ -2,7 +2,7 @@ var helper = require('../../common/helper'); var mobileHelper = require('../../common/mobile_helper'); -var calcMobileHelper = require('./calc_mobile_helper'); +var calcHelper = require('../../common/calc_helper'); describe('Chart tests.', function() { var testFileName = 'chart.ods'; @@ -12,7 +12,7 @@ describe('Chart tests.', function() { mobileHelper.enableEditingMobile(); - calcMobileHelper.selectFirstColumn(); + calcHelper.selectFirstColumn(); insertChart(); }); diff --git a/cypress_test/integration_tests/mobile/calc/hamburger_menu_spec.js b/cypress_test/integration_tests/mobile/calc/hamburger_menu_spec.js index 3ebdabbf6..0cbace990 100644 --- a/cypress_test/integration_tests/mobile/calc/hamburger_menu_spec.js +++ b/cypress_test/integration_tests/mobile/calc/hamburger_menu_spec.js @@ -3,7 +3,6 @@ var helper = require('../../common/helper'); var calcHelper = require('../../common/calc_helper'); var mobileHelper = require('../../common/mobile_helper'); -var calcMobileHelper = require('./calc_mobile_helper'); describe('Trigger hamburger menu options.', function() { var testFileName = ''; @@ -467,7 +466,7 @@ describe('Trigger hamburger menu options.', function() { before('hamburger_menu_sort.ods'); // Sort the first column's data - calcMobileHelper.selectFirstColumn(); + calcHelper.selectFirstColumn(); mobileHelper.selectHamburgerMenuItem(['Data', 'Sort Ascending']); @@ -490,7 +489,7 @@ describe('Trigger hamburger menu options.', function() { before('hamburger_menu_sort.ods'); // Sort the first column's data - calcMobileHelper.selectFirstColumn(); + calcHelper.selectFirstColumn(); mobileHelper.selectHamburgerMenuItem(['Data', 'Sort Descending']); @@ -523,7 +522,7 @@ describe('Trigger hamburger menu options.', function() { .should('be.greaterThan', 0); // Group first - calcMobileHelper.selectFirstColumn(); + calcHelper.selectFirstColumn(); mobileHelper.selectHamburgerMenuItem(['Data', 'Group and Outline', 'Group...']); @@ -561,7 +560,7 @@ describe('Trigger hamburger menu options.', function() { .should('be.greaterThan', 0); // Group first - calcMobileHelper.selectFirstColumn(); + calcHelper.selectFirstColumn(); mobileHelper.selectHamburgerMenuItem(['Data', 'Group and Outline', 'Group...']); @@ -599,7 +598,7 @@ describe('Trigger hamburger menu options.', function() { .should('be.greaterThan', 0); // Group first - calcMobileHelper.selectFirstColumn(); + calcHelper.selectFirstColumn(); mobileHelper.selectHamburgerMenuItem(['Data', 'Group and Outline', 'Group...']);