opensearch-project / opensearch-dashboards-functional-test

Maintains functional tests for OpenSearch Dashboards and Dashboards plugins
Apache License 2.0
14 stars 114 forks source link

make modifyColumnsOnSwitc test more robust #1615

Closed ananzh closed 3 weeks ago

ananzh commented 3 weeks ago

Description

seeing this error in CI

core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/discover_advanced_settings.spec.js

  modifyColumnsOnSwitch advanced setting
    - check columns still available after switching data sources in legacy table
    ✓ check columns still available after switching data sources in new table (39154ms)

  16 passing (8m)
  1 pending
  1 failing

  1) discover_advanced_setting
       searchOnPageLoad advanced setting
         check refresh data button is displayed when searchOnPageLoad is set as false:
     AssertionError: Timed out retrying after 60000ms: Expected to find content: 'Refresh data' within the element: <span.euiButton__text.euiSuperUpdateButton__text> but never did.
      at Context.eval (http://localhost:5601/__cypress/tests?p=cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/discover_advanced_settings.spec.js:515:59)

I am able to reproduce locally. The issue is that Cypress is trying to find the text "Refresh data" directly within an element with class .euiButton__text, but it needs to:

  1. find the button element
  2. look for the text within that button's descendant elements

After the fix, local test can pass

Screenshot 2024-10-31 at 1 48 53 PM

Note: currently only add this for 2.18. I will verify 2.x and main. If the issue persists (I don't see that in recent main CI), I will create PRs for main and 2.x.

Issues Resolved

NA

Check List

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. For more information on following Developer Certificate of Origin and signing off your commits, please check here.

ananzh commented 3 weeks ago

Will investigate in main https://github.com/opensearch-project/opensearch-dashboards-functional-test/issues/1617