summaryrefslogtreecommitdiffstats
path: root/cypress_test/integration_tests/desktop/calc
diff options
context:
space:
mode:
authorGökay Şatır <gokaysatir@collabora.com>2023-04-25 18:33:38 +0300
committerGökay ŞATIR <gokaysatir@gmail.com>2023-05-05 07:07:14 +0300
commitc9217176bb53ac8beeef4772058980fc5452dc2d (patch)
tree71d0e14075a5539ed7d3989ecb0a9cd83ecb1e2c /cypress_test/integration_tests/desktop/calc
parentjsdialog: don't create empty tabs container #6260 (diff)
downloadonline-c9217176bb53ac8beeef4772058980fc5452dc2d.tar.gz
online-c9217176bb53ac8beeef4772058980fc5452dc2d.zip
Update Cypress and make related changes.
Signed-off-by: Gökay Şatır <gokaysatir@collabora.com> Change-Id: Ie896ea22b5591ea5e7d574f2436ece7a31da4c0c Signed-off-by: Gökay Şatır <gokaysatir@collabora.com>
Diffstat (limited to 'cypress_test/integration_tests/desktop/calc')
-rw-r--r--cypress_test/integration_tests/desktop/calc/annotation_spec.js78
-rw-r--r--cypress_test/integration_tests/desktop/calc/autofilter_spec.js36
-rw-r--r--cypress_test/integration_tests/desktop/calc/open_different_file_types_spec.js6
-rw-r--r--cypress_test/integration_tests/desktop/calc/top_toolbar_spec.js2
4 files changed, 47 insertions, 75 deletions
diff --git a/cypress_test/integration_tests/desktop/calc/annotation_spec.js b/cypress_test/integration_tests/desktop/calc/annotation_spec.js
index 2cc1f9a2ac..ed079e8541 100644
--- a/cypress_test/integration_tests/desktop/calc/annotation_spec.js
+++ b/cypress_test/integration_tests/desktop/calc/annotation_spec.js
@@ -1,4 +1,5 @@
-/* global describe it cy require afterEach beforeEach */
+/* global describe it require cy afterEach beforeEach */
+
var helper = require('../../common/helper');
var { insertMultipleComment } = require('../../common/desktop_helper');
@@ -18,84 +19,67 @@ describe('Annotation Tests', function() {
it('Insert',function() {
insertMultipleComment('calc');
- cy.get('.cool-annotation').should('exist');
-
- cy.get('#comment-container-1').then(function (element) {
+ cy.cGet('.cool-annotation').should('exist');
+ cy.cGet('#comment-container-1').then(function (element) {
element[0].style.visibility = '';
element[0].style.display = '';
});
- cy.get('#comment-container-1').trigger('mouseover');
-
- cy.get('#annotation-content-area-1').should('contain','some text');
+ cy.cGet('#comment-container-1').trigger('mouseover');
+ cy.cGet('#annotation-content-area-1').should('contain','some text');
});
it('Modify',function() {
insertMultipleComment('calc');
- cy.get('#comment-container-1').should('exist');
+ cy.cGet('#comment-container-1').should('exist');
- cy.get('#comment-container-1').then(function (element) {
+ cy.cGet('#comment-container-1').then(function (element) {
element[0].style.visibility = '';
element[0].style.display = '';
});
- cy.get('#comment-container-1').trigger('mouseover');
-
- cy.get('#annotation-content-area-1').should('contain','some text');
-
- cy.get('#comment-annotation-menu-1').click();
-
- cy.contains('.context-menu-item','Modify').click();
-
- cy.get('#annotation-modify-textarea-1').type('some other text, ');
-
- cy.get('#annotation-save-1').click();
-
- cy.get('#comment-container-1').then(function (element) {
+ cy.cGet('#comment-container-1').trigger('mouseover');
+ cy.cGet('#annotation-content-area-1').should('contain','some text');
+ cy.cGet('#comment-annotation-menu-1').click();
+ cy.cGet('body').contains('.context-menu-item','Modify').click();
+ cy.cGet('#annotation-modify-textarea-1').type('some other text, ');
+ cy.cGet('#annotation-save-1').click();
+ cy.cGet('#comment-container-1').then(function (element) {
element[0].style.visibility = '';
element[0].style.display = '';
});
- cy.get('#annotation-content-area-1').trigger('mouseover');
-
- cy.get('#annotation-content-area-1').should('contain','some other text, some text');
-
- cy.get('#comment-container-1').should('exist');
+ cy.cGet('#annotation-content-area-1').trigger('mouseover');
+ cy.cGet('#annotation-content-area-1').should('contain','some other text, some text');
+ cy.cGet('#comment-container-1').should('exist');
});
it('Reply should not be possible', function() {
insertMultipleComment('calc');
- cy.get('#comment-container-1').should('exist');
+ cy.cGet('#comment-container-1').should('exist');
- cy.get('#comment-container-1').then(function (element) {
+ cy.cGet('#comment-container-1').then(function (element) {
element[0].style.visibility = '';
element[0].style.display = '';
});
- cy.get('#comment-container-1').trigger('mouseover');
-
- cy.get('#annotation-content-area-1').should('contain','some text');
-
- cy.get('#comment-annotation-menu-1').click();
-
- cy.get('.context-menu-list:visible .context-menu-item').should('not.have.text', 'Reply');
+ cy.cGet('#comment-container-1').trigger('mouseover');
+ cy.cGet('#annotation-content-area-1').should('contain','some text');
+ cy.cGet('#comment-annotation-menu-1').click();
+ cy.cGet('.context-menu-list:visible .context-menu-item').should('not.have.text', 'Reply');
});
it('Remove',function() {
insertMultipleComment('calc');
- cy.get('#comment-container-1').should('exist');
+ cy.cGet('#comment-container-1').should('exist');
- cy.get('#comment-container-1').then(function (element) {
+ cy.cGet('#comment-container-1').then(function (element) {
element[0].style.visibility = '';
element[0].style.display = '';
});
- cy.get('#comment-container-1').trigger('mouseover');
-
- cy.get('#annotation-content-area-1').should('contain','some text');
-
- cy.get('#comment-annotation-menu-1').click();
-
- cy.contains('.context-menu-item','Remove').click();
-
- cy.get('#comment-container-1').should('not.exist');
+ cy.cGet('#comment-container-1').trigger('mouseover');
+ cy.cGet('#annotation-content-area-1').should('contain','some text');
+ cy.cGet('#comment-annotation-menu-1').click();
+ cy.cGet('body').contains('.context-menu-item','Remove').click();
+ cy.cGet('#comment-container-1').should('not.exist');
});
});
diff --git a/cypress_test/integration_tests/desktop/calc/autofilter_spec.js b/cypress_test/integration_tests/desktop/calc/autofilter_spec.js
index 25865dd4a9..7c89eeaf99 100644
--- a/cypress_test/integration_tests/desktop/calc/autofilter_spec.js
+++ b/cypress_test/integration_tests/desktop/calc/autofilter_spec.js
@@ -24,9 +24,7 @@ describe('AutoFilter', function() {
function toggleAutofilter() {
//enable/disable autofilter
helper.clickOnIdle('#menu-data');
-
- cy.contains('#menu-data li', 'AutoFilter')
- .click();
+ cy.cGet('body').contains('#menu-data li', 'AutoFilter').click();
}
//If we select entire sheet , there is no data about table in copy-paste-container when autofilter
@@ -43,7 +41,7 @@ describe('AutoFilter', function() {
var tableData = [];
- cy.get('#copy-paste-container tbody').find('td').each(($el) => {
+ cy.cGet('#copy-paste-container tbody').find('td').each(($el) => {
cy.wrap($el)
.invoke('text')
.then(text => {
@@ -64,13 +62,12 @@ describe('AutoFilter', function() {
if (secondColumn) {
x += 105;
}
- cy.get('#map')
+ cy.cGet('#map')
.then(function(items) {
expect(items).to.have.lengthOf(1);
var XPos = items[0].getBoundingClientRect().left + x;
var YPos = items[0].getBoundingClientRect().top + 10;
- cy.get('body')
- .click(XPos, YPos);
+ cy.cGet('body').click(XPos, YPos);
});
}
@@ -79,16 +76,10 @@ describe('AutoFilter', function() {
//filter by pass
openAutoFilterMenu(true);
- cy.get('.autofilter .vertical').should('be.visible');
-
- cy.get('.autofilter .ui-treeview-checkbox').eq(0)
- .uncheck();
-
- cy.get('.autofilter .ui-treeview-checkbox').eq(1)
- .uncheck();
-
- cy.get('.autofilter .ui-button-box-right #ok')
- .click();
+ cy.cGet('.autofilter .vertical').should('be.visible');
+ cy.cGet('.autofilter .ui-treeview-checkbox').eq(0).uncheck();
+ cy.cGet('.autofilter .ui-treeview-checkbox').eq(1).uncheck();
+ cy.cGet('.autofilter .ui-button-box-right #ok').click();
assertDataOnFilter(['Cypress Test', 'Status', 'Test 1', 'Pass', 'Test 3', 'Pass']);
@@ -105,8 +96,7 @@ describe('AutoFilter', function() {
openAutoFilterMenu();
//sort by descending order
- cy.contains('.autofilter', 'Sort Descending')
- .click();
+ cy.cGet('body').contains('.autofilter', 'Sort Descending').click();
helper.waitUntilIdle('#copy-paste-container tbody');
@@ -116,8 +106,7 @@ describe('AutoFilter', function() {
//sort by ascending order
openAutoFilterMenu();
- cy.contains('.autofilter', 'Sort Ascending')
- .click();
+ cy.cGet('body').contains('.autofilter', 'Sort Ascending').click();
// Without this the copy-paste-container doesn't seem to get updated although the table
// has correct values.
@@ -133,10 +122,9 @@ describe('AutoFilter', function() {
//empty
openAutoFilterMenu(true);
- cy.get('#check_list_box > tbody > ul > li:nth-child(1) > span > input')
- .click();
+ cy.cGet('#check_list_box > tbody > ul > li:nth-child(1) > span > input').click();
- cy.get('#ok').click();
+ cy.cGet('#ok').click();
assertDataOnFilter(['Cypress Test', 'Status', 'Test 1', 'Pass', 'Test 2', 'Fail', 'Test 3', 'Pass', 'Test 5', 'Fail']);
});
diff --git a/cypress_test/integration_tests/desktop/calc/open_different_file_types_spec.js b/cypress_test/integration_tests/desktop/calc/open_different_file_types_spec.js
index e94d67e35b..cca65dc09c 100644
--- a/cypress_test/integration_tests/desktop/calc/open_different_file_types_spec.js
+++ b/cypress_test/integration_tests/desktop/calc/open_different_file_types_spec.js
@@ -1,4 +1,4 @@
-/* global describe it cy require Cypress afterEach */
+/* global describe it cy require Cypress afterEach expect isCanvasWhite */
var helper = require('../../common/helper');
var calcHelper = require('../../common/calc_helper');
const { insertImage } = require('../../common/desktop_helper');
@@ -19,7 +19,7 @@ describe('Open different file types', function () {
//check doc is loaded
cy.get('.leaflet-canvas-container canvas', {timeout : Cypress.config('defaultCommandTimeout') * 2.0});
- helper.canvasShouldNotBeFullWhite('.leaflet-canvas-container canvas');
+ expect(isCanvasWhite(cy.cGet('#document-canvas'))).to.be.false;
cy.get('#PermissionMode').should('be.visible')
.should('have.text', ' Read-only ');
@@ -77,7 +77,7 @@ describe('Open different file types', function () {
//check doc is loaded
cy.get('.leaflet-canvas-container canvas', {timeout : Cypress.config('defaultCommandTimeout') * 2.0});
- helper.canvasShouldNotBeFullWhite('.leaflet-canvas-container canvas');
+ expect(isCanvasWhite(cy.cGet('#document-canvas'))).to.be.false;
cy.get('#mobile-edit-button')
.should('be.visible')
diff --git a/cypress_test/integration_tests/desktop/calc/top_toolbar_spec.js b/cypress_test/integration_tests/desktop/calc/top_toolbar_spec.js
index 5d15cef093..241f9669a7 100644
--- a/cypress_test/integration_tests/desktop/calc/top_toolbar_spec.js
+++ b/cypress_test/integration_tests/desktop/calc/top_toolbar_spec.js
@@ -33,7 +33,7 @@ describe('Top toolbar tests.', function() {
cy.get('#tb_editbar_item_save')
.click();
- Cypress.Commands.overwrite('get', function(originalFn, selector, options) {
+ Cypress.Commands.overwriteQuery('get', function(originalFn, selector, options) {
return originalFn(selector, options);
});