Skip to content

Remove duplicate test code - Navigation helpers#3092

Merged
labkey-tchad merged 8 commits into
developfrom
fb_appAdminPages
Jul 9, 2026
Merged

Remove duplicate test code - Navigation helpers#3092
labkey-tchad merged 8 commits into
developfrom
fb_appAdminPages

Conversation

@labkey-tchad

@labkey-tchad labkey-tchad commented Jul 7, 2026

Copy link
Copy Markdown
Member

Rationale

Github epic

SMTestUtils and BiologicsHelper have methods for building app URLs (buildAppURL) and navigating within apps (beginAt). These methods are no longer necessary.
The custom beginAt methods were created before WebDriverWrapper.beginAt knew how to handle navigation within our single-page apps.
There's no need for separate buildAppURL methods between LKB and LKSM so I've moved the methods to WebTestHelper where the rest of the buildURL methods reside.

Numerous existing tests define a getAppControllerName. I've pulled this method up into a new BaseAppTest class. This allows the various page objects' beginAt methods to work across LKB and LKSM. It also defines non-static buildAppURL that uses the tests' appropriate controller.

The @Contract(pure = true) annotation identifies methods that don't have any side-effects. I added it to several methods to help IntelliJ with refactor operations.

Related Pull Requests

Changes

  • Centralize buildAppURL methods into WebTestHelper
  • Create BaseAppTest and standardize getAppControllerName
  • Remove pull request template
  • Add @Contract(pure = true) annotation to numerous methods

Tasks

  • Claude Code Review
  • Verify Fix

@labkey-tchad labkey-tchad marked this pull request as ready for review July 7, 2026 22:35
@labkey-tchad labkey-tchad self-assigned this Jul 7, 2026
Comment on lines +523 to +526
if (StringUtils.isBlank(containerPath))
{
throw new IllegalArgumentException("Invalid app containerPath: " + containerPath);
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this just an assert?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Effectively, I suppose, but not conceptually.
Assertions generally reference aspects of the software under test. This is validating a parameter defined within test code.

@labkey-tchad labkey-tchad merged commit 79cef65 into develop Jul 9, 2026
9 checks passed
@labkey-tchad labkey-tchad deleted the fb_appAdminPages branch July 9, 2026 15:33
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