CollaboraOnline / online

Collabora Online is a collaborative online office suite based on LibreOffice technology. This is also the source for the Collabora Office apps for iOS and Android.
https://collaboraonline.com
Other
1.85k stars 701 forks source link

Cypress test stability: Avoid closing the sidebar before every test #5974

Open pedropintosilva opened 1 year ago

pedropintosilva commented 1 year ago

Describe the bug Currently we always close the sidebar via the UI even on tests where we are not testing the sidebar at all. This is costly and not necessary for those tests.

Example running: make -C cypress_test run-desktop spec=writer/scrolling_spec.js forces cypress to first detect the scroll indicator then click; find the sidebar button and then click it. All that and we are still not sure when (exactly) the sidebar is not visible anymore.

Better would be to make sure that the sidebar is closed without UI (either by shortcut or by sending the uno:SidebarShow). Still this is not ideal..

Ideally we would switch off the sidebar via the ui_defaults https://sdk.collaboraonline.com/docs/theming.html?highlight=sidebar#user-interface-modifications

But I don't think SpreadsheetSidebar=false or TextSidebar=false actually work anymore (now that the sidebar is JS)

Rash419 commented 1 year ago

Flaky tests in CI:

Redo:
      Timed out retrying after 6000ms
      + expected - actual

      -'Hello Wor'
      +'Hello Worl'
Switching sheet sets the view that contains cell-cursor:
 CypressError: Timed out retrying after 6050ms: `cy.click()` failed because this element is detached from the DOM.
`<button class="spreadsheet-tab spreadsheet-tab-selected" id="spreadsheet-tab1" draggable="true">Sheet2</button>`
Cypress requires elements be attached in the DOM to interact with them.
Scroll through document: Scrolling to left/right:
      Timed out retrying after 6000ms
      + expected - actual

      -'242'
      +'0'

Tests on which CI gets stuck:

Makefile:683: recipe for target '/home/collabora/jenkins/workspace/tinderbox_online_master_debug_vs_co-22.05/cypress_test/workdir/track/mobile/writer/searchbar_spec.js.done' failed

pedropintosilva commented 1 year ago

Maybe we could start using app actions ? https://www.cypress.io/blog/2019/01/03/stop-using-page-objects-and-start-using-app-actions/#application-actions

pedropintosilva commented 1 year ago

https://github.com/cypress-io/cypress-realworld-app