[Libreoffice-commits] online.git: cypress_test/integration_tests
Tamás Zolnai (via logerrit)
logerrit at kemper.freedesktop.org
Tue Apr 14 14:45:50 UTC 2020
cypress_test/integration_tests/common/helper.js | 22 ------
cypress_test/integration_tests/common/mobile_helper.js | 4 -
cypress_test/integration_tests/desktop/copy_paste_spec.js | 2
cypress_test/integration_tests/mobile/calc/apply_font_spec.js | 4 -
cypress_test/integration_tests/mobile/calc/insertion_wizard_spec.js | 14 ++--
cypress_test/integration_tests/mobile/calc/number_format_spec.js | 4 -
cypress_test/integration_tests/mobile/calc/spellchecking_spec.js | 14 ++--
cypress_test/integration_tests/mobile/impress/spellchecking_spec.js | 14 ++--
cypress_test/integration_tests/mobile/writer/apply_font_spec.js | 6 -
cypress_test/integration_tests/mobile/writer/focus_spec.js | 6 -
cypress_test/integration_tests/mobile/writer/insert_field_spec.js | 16 ++---
cypress_test/integration_tests/mobile/writer/insert_formatting_mark_spec.js | 16 ++---
cypress_test/integration_tests/mobile/writer/insert_object_spec.js | 32 +++++-----
cypress_test/integration_tests/mobile/writer/mobile_wizard_state_spec.js | 4 -
cypress_test/integration_tests/mobile/writer/shape_properties_spec.js | 4 -
cypress_test/integration_tests/mobile/writer/spellchecking_spec.js | 30 ++++-----
cypress_test/integration_tests/mobile/writer/writer_helper.js | 5 -
17 files changed, 87 insertions(+), 110 deletions(-)
New commits:
commit e73c240dd58633f3e8a16349a4194294a464d64b
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Tue Apr 14 16:09:22 2020 +0200
Commit: Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Tue Apr 14 16:45:31 2020 +0200
cypress: selectItemByContent() -> cy.contains()
This helper method was introduced as a reliable
alternative of cy.get(<selector>).contains(<content>).
However we can have the same result using contains()
differently: cy.contains(<selector>, <content>), which
works reliable.
Change-Id: I11553f7d280a0f3a94a8f353410308113dd1c825
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92194
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>
diff --git a/cypress_test/integration_tests/common/helper.js b/cypress_test/integration_tests/common/helper.js
index 6b2ad80c1..61237c81a 100644
--- a/cypress_test/integration_tests/common/helper.js
+++ b/cypress_test/integration_tests/common/helper.js
@@ -160,27 +160,6 @@ function afterAll(fileName) {
cy.log('Waiting for closing the document - end.');
}
-// There is no css selector for filtering based on
-// the content of an item. cypress has Contains()
-// method for that, but it sometimes behaves unexpectedly
-// because it selects the elements first and waits until
-// the existing items gets the specified text, instead of
-// waiting for an item with the right content.
-function selectItemByContent(selector, content) {
- cy.log('Selecting item by content - start.');
- cy.log('Param - selector: ' + selector);
- cy.log('Param - content: ' + content);
-
- // Wait for the content to appear
- cy.get(selector)
- .should('contain.text', content);
-
- cy.log('Selecting item by content - end.');
-
- // Select the right item (selector can point to more items)
- return cy.get(selector).contains(content.replace('\u00a0', ' '));
-}
-
module.exports.loadTestDoc = loadTestDoc;
module.exports.assertCursorAndFocus = assertCursorAndFocus;
module.exports.assertNoKeyboardInput = assertNoKeyboardInput;
@@ -190,4 +169,3 @@ module.exports.clearAllText = clearAllText;
module.exports.getTextForClipboard = getTextForClipboard;
module.exports.expectTextForClipboard = expectTextForClipboard;
module.exports.afterAll = afterAll;
-module.exports.selectItemByContent = selectItemByContent;
diff --git a/cypress_test/integration_tests/common/mobile_helper.js b/cypress_test/integration_tests/common/mobile_helper.js
index 1c67b85ef..55639460c 100644
--- a/cypress_test/integration_tests/common/mobile_helper.js
+++ b/cypress_test/integration_tests/common/mobile_helper.js
@@ -34,7 +34,7 @@ function detectLOCoreVersion() {
openHamburgerMenu();
// Open about dialog
- helper.selectItemByContent('.ui-header.level-0 .menu-entry-with-icon', 'About')
+ cy.contains('.ui-header.level-0 .menu-entry-with-icon', 'About')
.click();
cy.get('.vex-content')
@@ -172,7 +172,7 @@ function executeCopyFromContextMenu(XPos, YPos) {
longPressOnDocument(XPos, YPos);
// Execute copy
- helper.selectItemByContent('.menu-entry-with-icon', 'Copy')
+ cy.contains('.menu-entry-with-icon', 'Copy')
.click();
// Close warning about clipboard operations
diff --git a/cypress_test/integration_tests/desktop/copy_paste_spec.js b/cypress_test/integration_tests/desktop/copy_paste_spec.js
index a4c2c3de5..37d6f04dd 100644
--- a/cypress_test/integration_tests/desktop/copy_paste_spec.js
+++ b/cypress_test/integration_tests/desktop/copy_paste_spec.js
@@ -26,7 +26,7 @@ describe('Clipboard operations.', function() {
cy.get('body').rightclick(XPos, YPos);
});
- helper.selectItemByContent('.context-menu-link', 'Copy')
+ cy.contains('.context-menu-link', 'Copy')
.click();
// Loleaflet code can not execute document.execCommand() when executed by cypress
diff --git a/cypress_test/integration_tests/mobile/calc/apply_font_spec.js b/cypress_test/integration_tests/mobile/calc/apply_font_spec.js
index 89a5fe2af..df9428258 100644
--- a/cypress_test/integration_tests/mobile/calc/apply_font_spec.js
+++ b/cypress_test/integration_tests/mobile/calc/apply_font_spec.js
@@ -87,7 +87,7 @@ describe('Apply font changes.', function() {
cy.get('#fontnamecombobox')
.click();
- helper.selectItemByContent('.mobile-wizard.ui-combobox-text', 'Linux Libertine G')
+ cy.contains('.mobile-wizard.ui-combobox-text', 'Linux Libertine G')
.click();
cy.get('.level-1[title="Font Name"] .mobile-wizard.ui-combobox-text.selected')
@@ -111,7 +111,7 @@ describe('Apply font changes.', function() {
cy.get('#fontsizecombobox')
.click();
- helper.selectItemByContent('.mobile-wizard.ui-combobox-text', '14')
+ cy.contains('.mobile-wizard.ui-combobox-text', '14')
.click();
if (Cypress.env('LO_CORE_VERSION') === 'master')
diff --git a/cypress_test/integration_tests/mobile/calc/insertion_wizard_spec.js b/cypress_test/integration_tests/mobile/calc/insertion_wizard_spec.js
index 847184584..36b4273d6 100644
--- a/cypress_test/integration_tests/mobile/calc/insertion_wizard_spec.js
+++ b/cypress_test/integration_tests/mobile/calc/insertion_wizard_spec.js
@@ -24,15 +24,15 @@ describe('Calc insertion wizard.', function() {
});
it('Check existance of image insertion items.', function() {
- helper.selectItemByContent('.menu-entry-with-icon', 'Local Image...')
+ cy.contains('.menu-entry-with-icon', 'Local Image...')
.should('be.visible');
- helper.selectItemByContent('.menu-entry-with-icon', 'Image...')
+ cy.contains('.menu-entry-with-icon', 'Image...')
.should('be.visible');
});
it('Insert chart.', function() {
- helper.selectItemByContent('.menu-entry-with-icon', 'Chart...')
+ cy.contains('.menu-entry-with-icon', 'Chart...')
.click();
cy.get('.leaflet-drag-transform-marker')
@@ -40,7 +40,7 @@ describe('Calc insertion wizard.', function() {
});
it('Insert hyperlink.', function() {
- helper.selectItemByContent('.menu-entry-with-icon', 'Hyperlink...')
+ cy.contains('.menu-entry-with-icon', 'Hyperlink...')
.click();
// Dialog is opened
@@ -72,7 +72,7 @@ describe('Calc insertion wizard.', function() {
it('Insert shape.', function() {
// Do insertion
- helper.selectItemByContent('.menu-entry-with-icon', 'Shape')
+ cy.contains('.menu-entry-with-icon', 'Shape')
.click();
cy.get('.basicshapes_ellipse').
@@ -91,7 +91,7 @@ describe('Calc insertion wizard.', function() {
it('Insert date.', function() {
// Do insertion
- helper.selectItemByContent('.menu-entry-with-icon', 'Date')
+ cy.contains('.menu-entry-with-icon', 'Date')
.click();
calcHelper.copyContentToClipboard();
@@ -102,7 +102,7 @@ describe('Calc insertion wizard.', function() {
it('Insert time.', function() {
// Do insertion
- helper.selectItemByContent('.menu-entry-with-icon', 'Time')
+ cy.contains('.menu-entry-with-icon', 'Time')
.click();
calcHelper.copyContentToClipboard();
diff --git a/cypress_test/integration_tests/mobile/calc/number_format_spec.js b/cypress_test/integration_tests/mobile/calc/number_format_spec.js
index ae0243769..a80ca2d41 100644
--- a/cypress_test/integration_tests/mobile/calc/number_format_spec.js
+++ b/cypress_test/integration_tests/mobile/calc/number_format_spec.js
@@ -35,7 +35,7 @@ describe('Apply number formatting.', function() {
cy.get('#category')
.click();
- helper.selectItemByContent('.mobile-wizard.ui-combobox-text', formattingString)
+ cy.contains('.mobile-wizard.ui-combobox-text', formattingString)
.click();
// Combobox entry contains the selected format
@@ -221,7 +221,7 @@ describe('Apply number formatting.', function() {
cy.get('#category')
.click();
- helper.selectItemByContent('.mobile-wizard.ui-combobox-text', 'Date')
+ cy.contains('.mobile-wizard.ui-combobox-text', 'Date')
.click();
// Combobox entry contains the selected format
diff --git a/cypress_test/integration_tests/mobile/calc/spellchecking_spec.js b/cypress_test/integration_tests/mobile/calc/spellchecking_spec.js
index 5fc7d95fa..2b1315656 100644
--- a/cypress_test/integration_tests/mobile/calc/spellchecking_spec.js
+++ b/cypress_test/integration_tests/mobile/calc/spellchecking_spec.js
@@ -55,7 +55,7 @@ describe('Calc spell checking menu.', function() {
it('Apply suggestion.', function() {
openContextMenu();
- helper.selectItemByContent('.context-menu-link', 'hello')
+ cy.contains('.context-menu-link', 'hello')
.click();
// Click outside of the cell
@@ -80,7 +80,7 @@ describe('Calc spell checking menu.', function() {
it('Ignore all.', function() {
openContextMenu();
- helper.selectItemByContent('.context-menu-link', 'Ignore\u00a0All')
+ cy.contains('.context-menu-link', 'Ignore All')
.click();
// Click outside of the cell
@@ -96,14 +96,14 @@ describe('Calc spell checking menu.', function() {
openContextMenu();
// We don't get the spell check context menu any more
- helper.selectItemByContent('.context-menu-link', 'Paste')
+ cy.contains('.context-menu-link', 'Paste')
.should('be.visible');
});
it('Apply language for word.', function() {
openContextMenu();
- helper.selectItemByContent('.context-menu-link', 'Word\u00a0is Finnish')
+ cy.contains('.context-menu-link', 'Word is Finnish')
.click();
// Click outside of the cell
@@ -119,14 +119,14 @@ describe('Calc spell checking menu.', function() {
openContextMenu();
// We don't get the spell check context menu any more
- helper.selectItemByContent('.context-menu-link', 'Paste')
+ cy.contains('.context-menu-link', 'Paste')
.should('be.visible');
});
it('Apply language for paragraph.', function() {
openContextMenu();
- helper.selectItemByContent('.context-menu-link', 'Paragraph\u00a0is Finnish')
+ cy.contains('.context-menu-link', 'Paragraph is Finnish')
.click();
// Click outside of the cell
@@ -142,7 +142,7 @@ describe('Calc spell checking menu.', function() {
openContextMenu();
// We don't get the spell check context menu any more
- helper.selectItemByContent('.context-menu-link', 'Paste')
+ cy.contains('.context-menu-link', 'Paste')
.should('be.visible');
});
});
diff --git a/cypress_test/integration_tests/mobile/impress/spellchecking_spec.js b/cypress_test/integration_tests/mobile/impress/spellchecking_spec.js
index b85a8c350..8e1994f35 100644
--- a/cypress_test/integration_tests/mobile/impress/spellchecking_spec.js
+++ b/cypress_test/integration_tests/mobile/impress/spellchecking_spec.js
@@ -63,7 +63,7 @@ describe('Spell checking menu.', function() {
it('Apply suggestion.', function() {
openContextMenu();
- helper.selectItemByContent('.context-menu-link', 'hello')
+ cy.contains('.context-menu-link', 'hello')
.click();
impressHelper.copyShapeContentToClipboard();
@@ -78,39 +78,39 @@ describe('Spell checking menu.', function() {
it('Ignore all.', function() {
openContextMenu();
- helper.selectItemByContent('.context-menu-link', 'Ignore\u00a0All')
+ cy.contains('.context-menu-link', 'Ignore All')
.click();
openContextMenu();
// We don't get the spell check context menu any more
- helper.selectItemByContent('.context-menu-link', 'Paste')
+ cy.contains('.context-menu-link', 'Paste')
.should('be.visible');
});
it('Apply language for word.', function() {
openContextMenu();
- helper.selectItemByContent('.context-menu-link', 'Word\u00a0is Finnish')
+ cy.contains('.context-menu-link', 'Word is Finnish')
.click();
openContextMenu();
// We don't get the spell check context menu any more
- helper.selectItemByContent('.context-menu-link', 'Paste')
+ cy.contains('.context-menu-link', 'Paste')
.should('be.visible');
});
it('Apply language for paragraph.', function() {
openContextMenu();
- helper.selectItemByContent('.context-menu-link', 'Paragraph\u00a0is Finnish')
+ cy.contains('.context-menu-link', 'Paragraph is Finnish')
.click();
openContextMenu();
// We don't get the spell check context menu any more
- helper.selectItemByContent('.context-menu-link', 'Paste')
+ cy.contains('.context-menu-link', 'Paste')
.should('be.visible');
});
});
diff --git a/cypress_test/integration_tests/mobile/writer/apply_font_spec.js b/cypress_test/integration_tests/mobile/writer/apply_font_spec.js
index e16626b77..0d9b37759 100644
--- a/cypress_test/integration_tests/mobile/writer/apply_font_spec.js
+++ b/cypress_test/integration_tests/mobile/writer/apply_font_spec.js
@@ -34,7 +34,7 @@ describe('Apply font changes.', function() {
cy.get('#mobile-wizard-back')
.should('be.visible');
- helper.selectItemByContent('.mobile-wizard.ui-combobox-text', styleName)
+ cy.contains('.mobile-wizard.ui-combobox-text', styleName)
.click();
// Combobox entry contains the selected font name
@@ -51,7 +51,7 @@ describe('Apply font changes.', function() {
cy.get('#fontnamecombobox')
.click();
- helper.selectItemByContent('.mobile-wizard.ui-combobox-text', 'Linux Libertine G')
+ cy.contains('.mobile-wizard.ui-combobox-text', 'Linux Libertine G')
.click();
cy.get('.level-1[title="Font Name"] .mobile-wizard.ui-combobox-text.selected')
@@ -75,7 +75,7 @@ describe('Apply font changes.', function() {
cy.get('#fontsizecombobox')
.click();
- helper.selectItemByContent('.mobile-wizard.ui-combobox-text', '36')
+ cy.contains('.mobile-wizard.ui-combobox-text', '36')
.click();
if (Cypress.env('LO_CORE_VERSION') === 'master')
diff --git a/cypress_test/integration_tests/mobile/writer/focus_spec.js b/cypress_test/integration_tests/mobile/writer/focus_spec.js
index d20f4f87b..b32262f80 100644
--- a/cypress_test/integration_tests/mobile/writer/focus_spec.js
+++ b/cypress_test/integration_tests/mobile/writer/focus_spec.js
@@ -111,11 +111,11 @@ describe('Focus tests', function() {
mobileHelper.openInsertionWizard();
// Select More Fields
- helper.selectItemByContent('.ui-header.level-0.mobile-wizard.ui-widget', 'More Fields...')
+ cy.contains('.ui-header.level-0.mobile-wizard.ui-widget', 'More Fields...')
.click();
// Insert a field
- helper.selectItemByContent('.menu-entry-with-icon', 'Page Number')
+ cy.contains('.menu-entry-with-icon', 'Page Number')
.click();
cy.get('#mobile-wizard')
@@ -133,7 +133,7 @@ describe('Focus tests', function() {
mobileHelper.openInsertionWizard();
// Do insertion
- helper.selectItemByContent('.menu-entry-with-icon', 'Shape')
+ cy.contains('.menu-entry-with-icon', 'Shape')
.click();
cy.get('.col.w2ui-icon.basicshapes_rectangle').
diff --git a/cypress_test/integration_tests/mobile/writer/insert_field_spec.js b/cypress_test/integration_tests/mobile/writer/insert_field_spec.js
index 1f588ab68..95b180f38 100644
--- a/cypress_test/integration_tests/mobile/writer/insert_field_spec.js
+++ b/cypress_test/integration_tests/mobile/writer/insert_field_spec.js
@@ -14,7 +14,7 @@ describe('Insert fields via insertion wizard.', function() {
mobileHelper.openInsertionWizard();
// Open fields submenu
- helper.selectItemByContent('.menu-entry-with-icon.flex-fullwidth', 'More Fields...')
+ cy.contains('.menu-entry-with-icon.flex-fullwidth', 'More Fields...')
.click();
cy.get('.ui-content.level-0.mobile-wizard')
@@ -27,7 +27,7 @@ describe('Insert fields via insertion wizard.', function() {
it('Insert page number field.', function() {
// Insert field
- helper.selectItemByContent('.menu-entry-with-icon', 'Page Number')
+ cy.contains('.menu-entry-with-icon', 'Page Number')
.click();
writerHelper.copyTextToClipboard();
@@ -39,7 +39,7 @@ describe('Insert fields via insertion wizard.', function() {
it('Insert page count field.', function() {
// Insert field
- helper.selectItemByContent('.menu-entry-with-icon', 'Page Count')
+ cy.contains('.menu-entry-with-icon', 'Page Count')
.click();
writerHelper.copyTextToClipboard();
@@ -51,7 +51,7 @@ describe('Insert fields via insertion wizard.', function() {
it('Insert date field.', function() {
// Insert field
- helper.selectItemByContent('.menu-entry-with-icon', 'Date')
+ cy.contains('.menu-entry-with-icon', 'Date')
.click();
writerHelper.copyTextToClipboard();
@@ -63,7 +63,7 @@ describe('Insert fields via insertion wizard.', function() {
it('Insert time field.', function() {
// Insert field
- helper.selectItemByContent('.menu-entry-with-icon', 'Time')
+ cy.contains('.menu-entry-with-icon', 'Time')
.click();
writerHelper.copyTextToClipboard();
@@ -75,7 +75,7 @@ describe('Insert fields via insertion wizard.', function() {
it('Insert title field.', function() {
// Insert field
- helper.selectItemByContent('.menu-entry-with-icon', 'Title')
+ cy.contains('.menu-entry-with-icon', 'Title')
.click();
writerHelper.copyTextToClipboard();
@@ -87,7 +87,7 @@ describe('Insert fields via insertion wizard.', function() {
it('Insert author field.', function() {
// Insert field
- helper.selectItemByContent('.menu-entry-with-icon', 'First Author')
+ cy.contains('.menu-entry-with-icon', 'First Author')
.click();
writerHelper.copyTextToClipboard();
@@ -100,7 +100,7 @@ describe('Insert fields via insertion wizard.', function() {
it('Insert subject field.', function() {
// Insert field
- helper.selectItemByContent('.menu-entry-with-icon', 'Subject')
+ cy.contains('.menu-entry-with-icon', 'Subject')
.click();
writerHelper.copyTextToClipboard();
diff --git a/cypress_test/integration_tests/mobile/writer/insert_formatting_mark_spec.js b/cypress_test/integration_tests/mobile/writer/insert_formatting_mark_spec.js
index 1ea93713b..faa4d0d9b 100644
--- a/cypress_test/integration_tests/mobile/writer/insert_formatting_mark_spec.js
+++ b/cypress_test/integration_tests/mobile/writer/insert_formatting_mark_spec.js
@@ -14,7 +14,7 @@ describe('Insert formatting mark via insertion wizard.', function() {
mobileHelper.openInsertionWizard();
// Open formatting marks
- helper.selectItemByContent('.menu-entry-with-icon.flex-fullwidth', 'Formatting Mark')
+ cy.contains('.menu-entry-with-icon.flex-fullwidth', 'Formatting Mark')
.click();
cy.get('.ui-content.level-0.mobile-wizard')
@@ -26,7 +26,7 @@ describe('Insert formatting mark via insertion wizard.', function() {
});
it('Insert non-breaking space.', function() {
- helper.selectItemByContent('.menu-entry-with-icon', 'Non-breaking space')
+ cy.contains('.menu-entry-with-icon', 'Non-breaking space')
.click();
writerHelper.copyTextToClipboard();
@@ -39,7 +39,7 @@ describe('Insert formatting mark via insertion wizard.', function() {
});
it('Insert non-breaking hyphen.', function() {
- helper.selectItemByContent('.menu-entry-with-icon', 'Non-breaking hyphen')
+ cy.contains('.menu-entry-with-icon', 'Non-breaking hyphen')
.click();
writerHelper.copyTextToClipboard();
@@ -52,7 +52,7 @@ describe('Insert formatting mark via insertion wizard.', function() {
});
it('Insert soft hyphen.', function() {
- helper.selectItemByContent('.menu-entry-with-icon', 'Soft hyphen')
+ cy.contains('.menu-entry-with-icon', 'Soft hyphen')
.click();
writerHelper.copyTextToClipboard();
@@ -65,7 +65,7 @@ describe('Insert formatting mark via insertion wizard.', function() {
});
it('Insert no-width optional break.', function() {
- helper.selectItemByContent('.menu-entry-with-icon', 'No-width optional break')
+ cy.contains('.menu-entry-with-icon', 'No-width optional break')
.click();
writerHelper.copyTextToClipboard();
@@ -78,7 +78,7 @@ describe('Insert formatting mark via insertion wizard.', function() {
});
it('Insert no-width no break.', function() {
- helper.selectItemByContent('.menu-entry-with-icon', 'No-width no break')
+ cy.contains('.menu-entry-with-icon', 'No-width no break')
.click();
writerHelper.copyTextToClipboard();
@@ -91,7 +91,7 @@ describe('Insert formatting mark via insertion wizard.', function() {
});
it('Insert left-to-right mark.', function() {
- helper.selectItemByContent('.menu-entry-with-icon', 'Left-to-right mark')
+ cy.contains('.menu-entry-with-icon', 'Left-to-right mark')
.click();
writerHelper.copyTextToClipboard();
@@ -104,7 +104,7 @@ describe('Insert formatting mark via insertion wizard.', function() {
});
it('Insert right-to-left mark.', function() {
- helper.selectItemByContent('.menu-entry-with-icon', 'Right-to-left mark')
+ cy.contains('.menu-entry-with-icon', 'Right-to-left mark')
.click();
writerHelper.copyTextToClipboard();
diff --git a/cypress_test/integration_tests/mobile/writer/insert_object_spec.js b/cypress_test/integration_tests/mobile/writer/insert_object_spec.js
index ba3e047a8..c7791307e 100644
--- a/cypress_test/integration_tests/mobile/writer/insert_object_spec.js
+++ b/cypress_test/integration_tests/mobile/writer/insert_object_spec.js
@@ -22,7 +22,7 @@ describe('Insert objects via insertion wizard.', function() {
mobileHelper.openInsertionWizard();
// We check whether the entry is there
- helper.selectItemByContent('.menu-entry-with-icon', 'Local Image...')
+ cy.contains('.menu-entry-with-icon', 'Local Image...')
.should('be.visible');
// We not not test the insertion, it might depend on the system.
});
@@ -30,7 +30,7 @@ describe('Insert objects via insertion wizard.', function() {
it('Insert comment.', function() {
mobileHelper.openInsertionWizard();
- helper.selectItemByContent('.menu-entry-with-icon', 'Comment')
+ cy.contains('.menu-entry-with-icon', 'Comment')
.click();
// Comment insertion dialog is opened
@@ -59,7 +59,7 @@ describe('Insert objects via insertion wizard.', function() {
mobileHelper.openInsertionWizard();
// Open Table submenu
- helper.selectItemByContent('.ui-header.level-0.mobile-wizard.ui-widget', 'Table')
+ cy.contains('.ui-header.level-0.mobile-wizard.ui-widget', 'Table')
.click();
cy.get('.mobile-wizard.ui-text')
@@ -92,7 +92,7 @@ describe('Insert objects via insertion wizard.', function() {
mobileHelper.openInsertionWizard();
// Open Table submenu
- helper.selectItemByContent('.ui-header.level-0.mobile-wizard.ui-widget', 'Table')
+ cy.contains('.ui-header.level-0.mobile-wizard.ui-widget', 'Table')
.click();
cy.get('.mobile-wizard.ui-text')
.should('be.visible');
@@ -136,17 +136,17 @@ describe('Insert objects via insertion wizard.', function() {
mobileHelper.openInsertionWizard();
// Open header/footer submenu
- helper.selectItemByContent('.menu-entry-with-icon', 'Header and Footer')
+ cy.contains('.menu-entry-with-icon', 'Header and Footer')
.click();
cy.get('.ui-header.level-1.mobile-wizard.ui-widget')
.should('be.visible');
// Open header submenu
- helper.selectItemByContent('.ui-header.level-1.mobile-wizard.ui-widget', 'Header')
+ cy.contains('.ui-header.level-1.mobile-wizard.ui-widget', 'Header')
.click();
// Insert header for All
- helper.selectItemByContent('.menu-entry-no-icon', 'All')
+ cy.contains('.menu-entry-no-icon', 'All')
.click();
// Check that the cursor was moved
@@ -172,17 +172,17 @@ describe('Insert objects via insertion wizard.', function() {
mobileHelper.openInsertionWizard();
// Open header/footer submenu
- helper.selectItemByContent('.menu-entry-with-icon', 'Header and Footer')
+ cy.contains('.menu-entry-with-icon', 'Header and Footer')
.click();
cy.get('.ui-header.level-1.mobile-wizard.ui-widget')
.should('be.visible');
// Open footer submenu
- helper.selectItemByContent('.ui-header.level-1.mobile-wizard.ui-widget', 'Footer')
+ cy.contains('.ui-header.level-1.mobile-wizard.ui-widget', 'Footer')
.click();
// Insert footer for All
- helper.selectItemByContent('.ui-content.level-1.mobile-wizard[title~="Footer"] .ui-header.level-2.mobile-wizard.ui-widget .menu-entry-no-icon', 'All')
+ cy.contains('.ui-content.level-1.mobile-wizard[title~="Footer"] .ui-header.level-2.mobile-wizard.ui-widget .menu-entry-no-icon', 'All')
.click();
// Check that the cursor was moved
@@ -208,7 +208,7 @@ describe('Insert objects via insertion wizard.', function() {
mobileHelper.openInsertionWizard();
// Insert footnote
- helper.selectItemByContent('.menu-entry-with-icon', 'Footnote')
+ cy.contains('.menu-entry-with-icon', 'Footnote')
.click();
// Check that the cursor was moved
@@ -234,7 +234,7 @@ describe('Insert objects via insertion wizard.', function() {
mobileHelper.openInsertionWizard();
// Insert endnote
- helper.selectItemByContent('.menu-entry-with-icon', 'Endnote')
+ cy.contains('.menu-entry-with-icon', 'Endnote')
.click();
// Check that the cursor was moved
@@ -260,7 +260,7 @@ describe('Insert objects via insertion wizard.', function() {
mobileHelper.openInsertionWizard();
// Insert page break
- helper.selectItemByContent('.menu-entry-with-icon', 'Page Break')
+ cy.contains('.menu-entry-with-icon', 'Page Break')
.click();
// Check that the cursor was moved
@@ -286,7 +286,7 @@ describe('Insert objects via insertion wizard.', function() {
mobileHelper.openInsertionWizard();
// Do insertion
- helper.selectItemByContent('.menu-entry-with-icon', 'Column Break')
+ cy.contains('.menu-entry-with-icon', 'Column Break')
.click();
// Check that the cursor was moved
@@ -303,7 +303,7 @@ describe('Insert objects via insertion wizard.', function() {
mobileHelper.openInsertionWizard();
// Open hyperlink dialog
- helper.selectItemByContent('.menu-entry-with-icon', 'Hyperlink...')
+ cy.contains('.menu-entry-with-icon', 'Hyperlink...')
.click();
// Dialog is opened
@@ -333,7 +333,7 @@ describe('Insert objects via insertion wizard.', function() {
mobileHelper.openInsertionWizard();
// Do insertion
- helper.selectItemByContent('.menu-entry-with-icon', 'Shape')
+ cy.contains('.menu-entry-with-icon', 'Shape')
.click();
cy.get('.col.w2ui-icon.basicshapes_rectangle').
diff --git a/cypress_test/integration_tests/mobile/writer/mobile_wizard_state_spec.js b/cypress_test/integration_tests/mobile/writer/mobile_wizard_state_spec.js
index 9b7ec28fc..1adae5376 100644
--- a/cypress_test/integration_tests/mobile/writer/mobile_wizard_state_spec.js
+++ b/cypress_test/integration_tests/mobile/writer/mobile_wizard_state_spec.js
@@ -34,7 +34,7 @@ describe('Mobile wizard state tests', function() {
// Open hamburger menu
mobileHelper.openHamburgerMenu();
- helper.selectItemByContent('.ui-header.level-0.mobile-wizard.ui-widget .menu-entry-with-icon', 'About')
+ cy.contains('.ui-header.level-0.mobile-wizard.ui-widget .menu-entry-with-icon', 'About')
.should('be.visible');
// Close hamburger menu
@@ -53,7 +53,7 @@ describe('Mobile wizard state tests', function() {
// Open context wizard by right click on document
mobileHelper.longPressOnDocument(40, 40);
- helper.selectItemByContent('.ui-header.level-0.mobile-wizard.ui-widget .menu-entry-with-icon', 'Paste')
+ cy.contains('.ui-header.level-0.mobile-wizard.ui-widget .menu-entry-with-icon', 'Paste')
.should('be.visible');
// TODO: fix this bug
diff --git a/cypress_test/integration_tests/mobile/writer/shape_properties_spec.js b/cypress_test/integration_tests/mobile/writer/shape_properties_spec.js
index dcb47e03a..613e24611 100644
--- a/cypress_test/integration_tests/mobile/writer/shape_properties_spec.js
+++ b/cypress_test/integration_tests/mobile/writer/shape_properties_spec.js
@@ -24,7 +24,7 @@ describe('Change shape properties via mobile wizard.', function() {
mobileHelper.openInsertionWizard();
// Do insertion
- helper.selectItemByContent('.menu-entry-with-icon', 'Shape')
+ cy.contains('.menu-entry-with-icon', 'Shape')
.click();
cy.get('.basicshapes_right-triangle').
@@ -224,7 +224,7 @@ describe('Change shape properties via mobile wizard.', function() {
cy.get('#linestyle')
.click();
- helper.selectItemByContent('.ui-combobox-text', 'Dashed')
+ cy.contains('.ui-combobox-text', 'Dashed')
.click();
triggerNewSVG();
diff --git a/cypress_test/integration_tests/mobile/writer/spellchecking_spec.js b/cypress_test/integration_tests/mobile/writer/spellchecking_spec.js
index 0ea024302..cb0a8d007 100644
--- a/cypress_test/integration_tests/mobile/writer/spellchecking_spec.js
+++ b/cypress_test/integration_tests/mobile/writer/spellchecking_spec.js
@@ -50,7 +50,7 @@ describe('Spell checking menu.', function() {
it('Apply suggestion.', function() {
openContextMenu();
- helper.selectItemByContent('.context-menu-link', 'hello')
+ cy.contains('.context-menu-link', 'hello')
.click();
writerHelper.copyTextToClipboard();
@@ -65,79 +65,79 @@ describe('Spell checking menu.', function() {
it('Ignore one.', function() {
openContextMenu();
- helper.selectItemByContent('.context-menu-link', 'Ignore')
+ cy.contains('.context-menu-link', 'Ignore')
.click();
openContextMenu();
// We don't get the spell check context menu any more
- helper.selectItemByContent('.context-menu-link', 'Paste');
+ cy.contains('.context-menu-link', 'Paste');
});
it('Ignore all.', function() {
openContextMenu();
- helper.selectItemByContent('.context-menu-link', 'Ignore\u00a0All')
+ cy.contains('.context-menu-link', 'Ignore All')
.click();
openContextMenu();
// We don't get the spell check context menu any more
- helper.selectItemByContent('.context-menu-link', 'Paste')
+ cy.contains('.context-menu-link', 'Paste')
.should('be.visible');
});
it('Check language status for selection.', function() {
openContextMenu();
- helper.selectItemByContent('.menu-entry-with-icon', 'Set Language for Selection')
+ cy.contains('.menu-entry-with-icon', 'Set Language for Selection')
.click();
// English is selected
- helper.selectItemByContent('.ui-content[title="Set Language for Selection"] .menu-entry-checked', 'English\u00a0(USA)')
+ cy.contains('.ui-content[title="Set Language for Selection"] .menu-entry-checked', 'English (USA)')
.should('be.visible');
});
it('Set None Language for selection.', function() {
openContextMenu();
- helper.selectItemByContent('.menu-entry-with-icon', 'Set Language for Selection')
+ cy.contains('.menu-entry-with-icon', 'Set Language for Selection')
.click();
- helper.selectItemByContent('.ui-content[title="Set Language for Selection"] .menu-entry-with-icon', 'None\u00a0(Do not check spelling)')
+ cy.contains('.ui-content[title="Set Language for Selection"] .menu-entry-with-icon', 'None (Do not check spelling)')
.click();
openContextMenu();
// We don't get the spell check context menu any more
- helper.selectItemByContent('.context-menu-link', 'Paste')
+ cy.contains('.context-menu-link', 'Paste')
.should('be.visible');
});
it('Check language status for paragraph.', function() {
openContextMenu();
- helper.selectItemByContent('.menu-entry-with-icon', 'Set Language for Paragraph')
+ cy.contains('.menu-entry-with-icon', 'Set Language for Paragraph')
.click();
// English is selected
- helper.selectItemByContent('.ui-content[title="Set Language for Paragraph"] .menu-entry-checked', 'English\u00a0(USA)')
+ cy.contains('.ui-content[title="Set Language for Paragraph"] .menu-entry-checked', 'English (USA)')
.should('be.visible');
});
it('Set None Language for paragraph.', function() {
openContextMenu();
- helper.selectItemByContent('.menu-entry-with-icon', 'Set Language for Paragraph')
+ cy.contains('.menu-entry-with-icon', 'Set Language for Paragraph')
.click();
- helper.selectItemByContent('.ui-content[title="Set Language for Paragraph"] .menu-entry-with-icon', 'None\u00a0(Do not check spelling)')
+ cy.contains('.ui-content[title="Set Language for Paragraph"] .menu-entry-with-icon', 'None (Do not check spelling)')
.click();
openContextMenu();
// We don't get the spell check context menu any more
- helper.selectItemByContent('.context-menu-link', 'Paste')
+ cy.contains('.context-menu-link', 'Paste')
.should('be.visible');
});
});
diff --git a/cypress_test/integration_tests/mobile/writer/writer_helper.js b/cypress_test/integration_tests/mobile/writer/writer_helper.js
index 4a9c0382d..8a910aab0 100644
--- a/cypress_test/integration_tests/mobile/writer/writer_helper.js
+++ b/cypress_test/integration_tests/mobile/writer/writer_helper.js
@@ -1,7 +1,6 @@
/* global cy expect require*/
var mobileHelper = require('../../common/mobile_helper');
-var helper = require('../../common/helper');
function copyTextToClipboard() {
cy.log('Copying text to clipboard - start.');
@@ -60,11 +59,11 @@ function selectAllMobile() {
mobileHelper.openHamburgerMenu();
// Open edit menu
- helper.selectItemByContent('.ui-header.level-0 .menu-entry-with-icon', 'Edit')
+ cy.contains('.ui-header.level-0 .menu-entry-with-icon', 'Edit')
.click();
// Do the selection
- helper.selectItemByContent('.ui-header.level-1 .menu-entry-with-icon', 'Select All')
+ cy.contains('.ui-header.level-1 .menu-entry-with-icon', 'Select All')
.click();
cy.get('.leaflet-marker-icon')
.should('exist');
More information about the Libreoffice-commits
mailing list