Skip to content

Conversation

@aaronskiba
Copy link
Contributor

Fixes #3450

Changes proposed in this PR:

  • Fixes the flaky tests within spec/features/plans/exports_spec.rb (see Some Selenium/Features Tests Breaking (Independent of Code Changes) #3450)
    • While inspecting these sometimes failing tests, it was found that expect(page.source).to have_text(plan.title) sometimes failed because sometimes page.source == "".
    • Rather than page.source, which returns the entire HTML content of the page, this PR uses page.title, which only returns the contents inside of the <title> tags.
      • page.title does not seem to encounter the unwanted behaviour of returning a blank string. Maybe because it is faster (only returning the title should be faster than returning the entire HTML content via page.source)?
      • Also, the <title> title tags and their contents are part of the entire HTML content. So despite page.source returning a blank string, because page.title is not blank, it follows that the DOM is not blank.

This commit replaces `page.source` with (the hopefully more efficient) `page.title` for verifying the page title. Checking the entire page source was potentially causing slowdowns and leading to the intermittent failing of tests within this file.
@benjaminfaure benjaminfaure merged commit 0f263f7 into development Nov 18, 2024
8 checks passed
@benjaminfaure benjaminfaure deleted the aaron/issues/3450 branch November 18, 2024 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants