Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Y24-476 - [BUG] Integration suite test for the Heron pipeline 96 well does not wait for table re-rendering after filtering by file #393

Open
yoldas opened this issue Nov 26, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@yoldas
Copy link
Member

yoldas commented Nov 26, 2024

Describe the bug
The integration suite test for Heron pipeline 96 well spec/limber/heron_96_pipeline_spec.rb fails sometimes. It does a file name filtering on the table at this line:

fill_in('filterInput', with: file_prefix)

After the input, the table imports-table is re-created and the table found by the following becomes stale:

table_wrapper = first(:xpath, "//div[@id='imports-table']")

Because of the stale reference the assertion in the following line fails:

expect(table_wrapper).to have_content(file_prefix) # Delays while the AJAX fires

A solution should put a wait or check the re-rendering of the table after the fill_in('filterInput', with: file_prefix) call before getting a reference to the table using xpath.

RT Ticket Number
N/A

To Reproduce
Steps to reproduce the behaviour:

  1. Go to https://uat.lighthouse-ui.psd.sanger.ac.uk/imports
  2. Enter a file name / plate barcode into the Filter input box
  3. See that the table is filtered. We need to deal with the time window between the input and re-rendering of the table (AJAX call).

Expected behaviour
The test was expected to either pass or fail consistently across different test runs.

Screenshots
See the following excerpt from the integration suite log:

Following the Heron pipeline 96 well
     Failure/Error: expect(table_wrapper).to have_content(file_prefix) # Delays while the AJAX fires
     Selenium::WebDriver::Error::StaleElementReferenceError:
       stale element reference: stale element not found in the current frame
         (Session info: chrome=131.0.6778.85); For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#stale-element-reference-exception
     # /usr/local/bundle/gems/selenium-webdriver-4.24.0/lib/selenium/webdriver/remote/response.rb:62:in `add_cause'
     # /usr/local/bundle/gems/selenium-webdriver-4.24.0/lib/selenium/webdriver/remote/response.rb:41:in `error'
     # /usr/local/bundle/gems/selenium-webdriver-4.24.0/lib/selenium/webdriver/remote/response.rb:52:in `assert_ok'
     # /usr/local/bundle/gems/selenium-webdriver-4.24.0/lib/selenium/webdriver/remote/response.rb:34:in `initialize'
     # /usr/local/bundle/gems/selenium-webdriver-4.24.0/lib/selenium/webdriver/remote/http/common.rb:101:in `new'
     # /usr/local/bundle/gems/selenium-webdriver-4.24.0/lib/selenium/webdriver/remote/http/common.rb:101:in `create_response'
     # /usr/local/bundle/gems/selenium-webdriver-4.24.0/lib/selenium/webdriver/remote/http/default.rb:103:in `request'
     # /usr/local/bundle/gems/selenium-webdriver-4.24.0/lib/selenium/webdriver/remote/http/common.rb:67:in `call'
     # /usr/local/bundle/gems/selenium-webdriver-4.24.0/lib/selenium/webdriver/remote/bridge.rb:685:in `execute'
     # /usr/local/bundle/gems/selenium-webdriver-4.24.0/lib/selenium/webdriver/remote/bridge.rb:488:in `element_text'
     # /usr/local/bundle/gems/selenium-webdriver-4.24.0/lib/selenium/webdriver/common/element.rb:190:in `text'
     # /usr/local/bundle/gems/capybara-3.40.0/lib/capybara/selenium/node.rb:17:in `visible_text'
     # /usr/local/bundle/gems/capybara-3.40.0/lib/capybara/node/element.rb:60:in `block in text'
     # /usr/local/bundle/gems/capybara-3.40.0/lib/capybara/node/base.rb:77:in `synchronize'
     # /usr/local/bundle/gems/capybara-3.40.0/lib/capybara/node/element.rb:60:in `text'
     # /usr/local/bundle/gems/capybara-3.40.0/lib/capybara/queries/text_query.rb:108:in `text'
     # /usr/local/bundle/gems/capybara-3.40.0/lib/capybara/queries/text_query.rb:29:in `resolve_for'
     # /usr/local/bundle/gems/capybara-3.40.0/lib/capybara/node/matchers.rb:887:in `block in _verify_text'
     # /usr/local/bundle/gems/capybara-3.40.0/lib/capybara/node/base.rb:84:in `synchronize'
     # /usr/local/bundle/gems/capybara-3.40.0/lib/capybara/node/matchers.rb:886:in `_verify_text'
     # /usr/local/bundle/gems/capybara-3.40.0/lib/capybara/node/matchers.rb:701:in `assert_text'
     # /usr/local/bundle/gems/capybara-3.40.0/lib/capybara/rspec/matchers/have_text.rb:10:in `element_matches?'
     # /usr/local/bundle/gems/capybara-3.40.0/lib/capybara/rspec/matchers/base.rb:52:in `matches?'
     # ./spec/limber/heron_96_pipeline_spec.rb:32:in `block (3 levels) in <top (required)>'

Desktop (please complete the following information):
Observed with OS: Mac, Browser: Chrome, Environment: Training

Additional context
This was observed in Training environment but the same test was passed when run locally against Training.

Ref: Slack: https://psd-team.slack.com/archives/C07TRSCTA1Y/p1732553176354149

@yoldas yoldas added the bug Something isn't working label Nov 26, 2024
@psd-issuer psd-issuer bot changed the title [BUG] Integration suite test for the Heron pipeline 96 well does not wait for table re-rendering after filtering by file Y24-476 - [BUG] Integration suite test for the Heron pipeline 96 well does not wait for table re-rendering after filtering by file Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant