Skip to content

Commit 947849c

Browse files
eszkadevDarshan-upadhyay1110
authored andcommitted
cypress: make scrolling tests more stable
- avoid using force so we know we already have the elements initialized and visible - avoid switching the view mode on start which is not necessary for the testing feature itself Signed-off-by: Szymon Kłos <szymon.klos@collabora.com> Change-Id: I095947bafe45e76877e9614d1d5ced1f63316f7a
1 parent 4a9c99d commit 947849c

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

cypress_test/integration_tests/common/desktop_helper.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,8 +239,8 @@ function selectZoomLevel(zoomLevel, makeZoomVisible = true) {
239239
// Force because sometimes the icons are scrolled off the screen to the right
240240
if (makeZoomVisible)
241241
makeZoomItemsVisible();
242-
cy.cGet('#toolbar-down #zoom .arrowbackground').click({force: true});
243-
cy.cGet('#zoom-dropdown').contains('.ui-combobox-entry', zoomLevel).click({force: true});
242+
cy.cGet('#toolbar-down #zoom .arrowbackground').click();
243+
cy.cGet('#zoom-dropdown').contains('.ui-combobox-entry', zoomLevel).click();
244244
shouldHaveZoomLevel(zoomLevel);
245245

246246
cy.log('<< selectZoomLevel - end');

cypress_test/integration_tests/desktop/calc/scrolling_spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ describe(['tagdesktop', 'tagnextcloud', 'tagproxy'], 'Scroll through document',
5050
}
5151

5252
// Document should scroll
53-
desktopHelper.assertScrollbarPosition('vertical', 230, 250);
53+
desktopHelper.assertScrollbarPosition('vertical', 230, 300);
5454
// Document should not scroll horizontally
5555
desktopHelper.assertScrollbarPosition('horizontal', 48, 50);
5656
});

cypress_test/integration_tests/desktop/writer/scrolling_spec.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@ describe(['tagdesktop', 'tagnextcloud', 'tagproxy'], 'Scroll through document',
77

88
beforeEach(function() {
99
helper.setupAndLoadDocument('writer/scrolling.odt');
10-
desktopHelper.switchUIToCompact();
11-
12-
cy.cGet('#toolbar-up .ui-scroll-right').click();
13-
cy.cGet('#sidebar').click({force: true});
1410
});
1511

1612
it('Check if we jump the view on new page insertion', function() {
@@ -25,11 +21,12 @@ describe(['tagdesktop', 'tagnextcloud', 'tagproxy'], 'Scroll through document',
2521
});
2622

2723
it('Scrolling to bottom/top', function() {
28-
desktopHelper.selectZoomLevel('40', false);
24+
desktopHelper.selectZoomLevel('40');
25+
2926
helper.typeIntoDocument('{ctrl}{home}');
3027
//scroll to bottom
3128
desktopHelper.assertVisiblePage(1, 1, 4);
32-
desktopHelper.pressKey(1, 'pagedown');
29+
desktopHelper.pressKey(2, 'pagedown');
3330
desktopHelper.assertVisiblePage(2, 2, 4);
3431
desktopHelper.pressKey(1, 'pagedown');
3532
desktopHelper.assertVisiblePage(3, 3, 4);
@@ -45,22 +42,25 @@ describe(['tagdesktop', 'tagnextcloud', 'tagproxy'], 'Scroll through document',
4542
});
4643

4744
it('Scrolling to left/right', function() {
48-
cy.cGet('#toolbar-down').click();
49-
desktopHelper.selectZoomLevel('200', false);
45+
desktopHelper.selectZoomLevel('200');
5046
//show horizontal scrollbar
5147
cy.cGet('.leaflet-layer').click('bottom');
5248
cy.wait(1000);
49+
desktopHelper.assertScrollbarPosition('horizontal', 0, 270)
50+
;
5351
helper.typeIntoDocument('{home}{end}{home}');
5452
cy.wait(1000);
55-
cy.cGet('#test-div-horizontal-scrollbar').should('have.text', '0');
53+
desktopHelper.assertScrollbarPosition('horizontal', 0, 270);
54+
5655
helper.typeIntoDocument('{end}{home}{end}');
56+
cy.wait(1000);
5757
desktopHelper.assertScrollbarPosition('horizontal', 430, 653);
5858
});
5959

6060
it('Check if we jump the view on change of formatting mark', function() {
6161
desktopHelper.switchUIToNotebookbar();
62+
desktopHelper.selectZoomLevel('40');
6263

63-
desktopHelper.selectZoomLevel('40', false);
6464
helper.typeIntoDocument('{ctrl}{home}');
6565
desktopHelper.pressKey(2, 'pagedown');
6666
desktopHelper.pressKey(1, 'pagedown');

0 commit comments

Comments
 (0)