Skip to content

Commit c67d791

Browse files
committed
cypress: do not use unstable id in Writer tests
Signed-off-by: Szymon Kłos <[email protected]> Change-Id: I6d7d82b502a604c18e415ca5fb554b2684a27a20
1 parent 17e450a commit c67d791

File tree

8 files changed

+15
-12
lines changed

8 files changed

+15
-12
lines changed

cypress_test/integration_tests/common/desktop_helper.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,8 +325,8 @@ function toggleComments(resolved = false) {
325325
var mode = Cypress.env('USER_INTERFACE');
326326
if (mode === 'notebookbar') {
327327
cy.cGet('#Review-tab-label').click();
328-
if (resolved) cy.cGet('#review-show-resolved-annotations').click();
329-
else cy.cGet('#showannotations').click();
328+
if (resolved) getNbIcon('ShowResolvedAnnotations', 'Review').click();
329+
else cy.cGet('.showannotations').click();
330330
// to avoid notebookbar collapse in subsequent calls to toggleComments.
331331
cy.cGet('#Home-tab-label').click();
332332
} else {

cypress_test/integration_tests/desktop/writer/image_operation_spec.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ describe(['tagdesktop'], 'Image Operation Tests', function() {
2626
insertImage();
2727
helper.assertImageSize(248, 63);
2828
cy.cGet('#test-div-shape-handle-3').should('exist');
29-
cy.cGet('#Crop').should('be.visible');
30-
cy.cGet('#Crop').click();
29+
desktopHelper.getNbIcon('Crop', 'Picture').click();
3130

3231
cy.cGet('#test-div-shape-handle-3').then(($handle) => {
3332
const rect = $handle[0].getBoundingClientRect();

cypress_test/integration_tests/desktop/writer/jsdialog_widgets_spec.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
/* global describe it cy require beforeEach */
22

33
var helper = require('../../common/helper');
4+
var desktopHelper = require('../../common/desktop_helper');
45

56
describe(['tagdesktop', 'tagnextcloud', 'tagproxy'], 'JSDialog widgets visual tests', function() {
67
beforeEach(function() {
78
helper.setupAndLoadDocument('writer/help_dialog.odt');
89
cy.cGet('#Help-tab-label').click();
9-
cy.cGet('#about-button').click();
10+
desktopHelper.getNbIcon('About', 'Help').click();
1011

1112
cy.cGet('#modal-dialog-about-dialog-box')
1213
.should('be.visible')

cypress_test/integration_tests/desktop/writer/manage_changes_dialog_spec.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/* global describe it cy beforeEach require */
22

33
var helper = require('../../common/helper');
4+
var desktopHelper = require('../../common/desktop_helper');
45

56
describe(['tagdesktop', 'tagnextcloud', 'tagscreenshot'], 'Manage Changes Dialog', function () {
67

@@ -10,8 +11,8 @@ describe(['tagdesktop', 'tagnextcloud', 'tagscreenshot'], 'Manage Changes Dialog
1011

1112
it('Manage changes dialog visual test', function () {
1213
cy.cGet('.notebookbar #Review-tab-label').click();
13-
cy.cGet('.notebookbar #overflow-button-review-tracking').click();
14-
cy.cGet('.notebookbar #review-accept-tracked-changes').click();
14+
desktopHelper.getNbIconArrow('TrackChanges', 'Review').click();
15+
desktopHelper.getNbIcon('AcceptTrackedChanges', 'Review').click();
1516
cy.cGet('#AcceptRejectChangesDialog').should('be.visible');
1617
cy.cGet('#writerchanges .ui-treeview-entry.ui-treeview-expandable[aria-level="1"] .ui-treeview-expander-column').click();
1718
cy.wait(100);

cypress_test/integration_tests/desktop/writer/notebookbar_spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ describe(['tagdesktop'], 'Notebookbar tests.', function() {
2121
it('Apply bold font from dropdown in Format tab', function() {
2222
helper.setDummyClipboardForCopy();
2323
cy.cGet('.notebookbar #Format-tab-label').click();
24-
cy.cGet('.notebookbar .unoFormatMenu .unoarrow').click();
24+
desktopHelper.getNbArrow('FormatMenu', 'Format').click();
2525
cy.cGet('#format-FormatMenu-dropdown').should('exist');
2626
cy.cGet('#format-FormatMenu-dropdown #format-FormatMenu-entry-0').click(); // Bold
2727
cy.cGet('#format-FormatMenu-dropdown').should('not.exist');

cypress_test/integration_tests/desktop/writer/replace_dialog_spec.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/* global describe it cy beforeEach require */
22

33
var helper = require('../../common/helper');
4+
var desktopHelper = require('../../common/desktop_helper');
45

56
describe(['tagdesktop', 'tagnextcloud', 'tagproxy'], 'Replace Dialog Tests', function() {
67
beforeEach(function() {
@@ -22,7 +23,7 @@ describe(['tagdesktop', 'tagnextcloud', 'tagproxy'], 'Replace Dialog Tests', fun
2223
it('Replace button should open search dialog with replace tab active', function() {
2324
cy.viewport(1920,1080);
2425
// Click the Replace button from the notebookbar
25-
cy.cGet('#home-search-dialog-button').click();
26+
desktopHelper.getNbIcon('SearchDialog', 'Home').click();
2627
cy.cGet('#FindReplaceDialog').should('be.visible');
2728

2829
// Verify that the replace tab is active
@@ -116,4 +117,4 @@ describe(['tagdesktop', 'tagnextcloud', 'tagproxy'], 'Replace Dialog Tests', fun
116117
// Verify it's unchecked
117118
cy.cGet('#matchcase-input').should('not.be.checked');
118119
});
119-
});
120+
});

cypress_test/integration_tests/desktop/writer/sign_spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ describe(['tagdesktop', 'tagnextcloud', 'tagproxy'], 'Sign operations.', functio
1212

1313
// When signing that document:
1414
cy.cGet('#File-tab-label').click();
15-
cy.cGet('#signature-button').click();
15+
desktopHelper.getNbIcon('Signature').click();
1616
// Without the accompanying fix in place, this test would have failed with:
1717
// This element `<button#sign.ui-pushbutton.jsdialog.hidden>` is not visible because it has CSS property: `display: none`
1818
cy.cGet('#DigitalSignaturesDialog #sign.ui-pushbutton-wrapper button').click();

cypress_test/integration_tests/desktop/writer/stylebar_spec.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/* global describe it cy beforeEach require */
22

33
var helper = require('../../common/helper');
4+
var desktopHelper = require('../../common/desktop_helper');
45

56
describe(['tagdesktop'], 'Test style sidebar', function() {
67

@@ -9,7 +10,7 @@ describe(['tagdesktop'], 'Test style sidebar', function() {
910
cy.viewport(1920,1080);
1011

1112
cy.cGet('#Format-tab-label').click();
12-
cy.cGet('#format-style-dialog').click();
13+
desktopHelper.getNbIcon('StyleDialog', 'Format').click();
1314
});
1415

1516
it('Style sidebar context menu on node with spaces', function() {

0 commit comments

Comments
 (0)