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

Wait for readyState when switching test windows #2191

Merged
merged 2 commits into from
Dec 12, 2024

Conversation

labkey-tchad
Copy link
Member

Rationale

A change to how we switch windows was accidentally included in a previous PR. It attempts to prevent errors with assertTextPresent throwing an NPE after switching windows by waiting for document.readyState to be "complete". This mostly works, except one place in WNPRC that opens a window in a unique method. In Firefox, the readyState of that page is the nonstandard "uninitialized".

org.junit.runners.model.TestTimedOutException: test timed out after 30 minutes
  at java.base@17.0.7/java.lang.Thread.sleep(Native Method)
  at app//org.openqa.selenium.support.ui.Sleeper.lambda$static$0(Sleeper.java:25)
  at app//org.openqa.selenium.support.ui.Sleeper$$Lambda$675/0x00000008016d5478.sleep(Unknown Source)
  at app//org.openqa.selenium.support.ui.FluentWait.until(FluentWait.java:232)
  at app//org.labkey.test.WebDriverWrapper.switchToWindow(WebDriverWrapper.java:1011)
  at app//org.labkey.test.tests.wnprc_ehr.WNPRC_EHRTest.testClinpathVirologyBulkUploadPreviewAndDate(WNPRC_EHRTest.java:3294)

Note: the test timeout was caused by using seconds instead of milliseconds for the readyState timeout. That has also been fixed.

Related Pull Requests

Changes

  • Handle "uninitialized" readyState when switching windows
  • Use Duration.ofMillis instead of Duration.ofSeconds for timeout

@labkey-tchad
Copy link
Member Author

@labkey-tchad labkey-tchad merged commit 75d9e34 into develop Dec 12, 2024
4 checks passed
@labkey-tchad labkey-tchad deleted the fb_documentReadyState branch December 12, 2024 19:10
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.

2 participants