Skip to content

refactor(integration-tests): remove unused methods - #5830

Closed
chaoran-chen wants to merge 3 commits into
mainfrom
remove-unused
Closed

refactor(integration-tests): remove unused methods#5830
chaoran-chen wants to merge 3 commits into
mainfrom
remove-unused

Conversation

@chaoran-chen

@chaoran-chen chaoran-chen commented Jan 11, 2026

Copy link
Copy Markdown
Member

This removes unused code in the integration tests.

(This is using the branch from #5827 as base to avoid conflicts.)

🚀 Preview: Add preview label to enable

@chaoran-chen chaoran-chen changed the title feat(website): add file uploads to revisions refactor(integration-tests): remove unused methods Jan 11, 2026
@theosanderson

Copy link
Copy Markdown
Member

At first glance I'm not sure about this for most of these. These are all .page.ts files.

I think it's fine for them to have functions that aren't used atm. IMO in their ideal state these files would capture every single functionality of the page in question.

Practical reasons to keep them:

  • we might want to use them later
  • (more relevant for me) they describe how to interact with these pages using playwright to AI agents

@theosanderson

Copy link
Copy Markdown
Member

But maybe we've ended up with a lot of duplication and maybe this broad brush approach is the easiest way to fix it, idk

@chaoran-chen

chaoran-chen commented Jan 11, 2026

Copy link
Copy Markdown
Member Author

The problem is that we don't know whether they are actually correct and they can easily get out-of-date. I stumbled over this here where Claude called the submitRevision function but it's actually wrong (there is no confirm button) and it took me a while to realize that the function had been unused (what made it more difficult was that the function itself was not directly unused but the functions that used it were).

@theosanderson

Copy link
Copy Markdown
Member

The problem is that we don't know whether they are actually correct and they can easily get out-of-date.

I guess IMO this is true of features that we haven't yet added tests for too - but my solution there would be to add tests rather than remove them (and same here). [It's not a huge deal either way though, and I definitely agree with a good proportion of the removals]

Base automatically changed from files-bulk-revision to main January 14, 2026 19:27
@chaoran-chen

Copy link
Copy Markdown
Member Author

Closed in favor of #5852.

theosanderson added a commit that referenced this pull request Jan 18, 2026
#5852)

This is an alternative to #5830 which tries to preserve a bit of the
functionality. No super strong feelings @chaoran-chen if you prefer
yours, sorry for the delay.
[clauded] 
This PR cleans up unused code in the integration test page objects by:
- Removing methods that are duplicated or unnecessary
- Adding test coverage for methods that were unused but useful
The goal is to ensure all page object methods have test coverage, making
the codebase easier to maintain and preventing dead code accumulation.
## Changes
### Removed (duplicated/unnecessary[edit:theo also / just did not get
round to adding back, for revision cases)
| Method | Reason |
|--------|--------|
| `SingleSequenceSubmissionPage.fillField()` | Duplicates
`EditPage.fillField()` |
| `SequenceDetailPage.getPage()` | Unnecessary getter that just returns
`this.page` |
| `RevisionPage.clickReviseSequenceLink()` | Duplicates
`SearchPage.reviseSequence()` |
| `RevisionPage.uploadSegmentFile()` | Unused, no test coverage |
| `RevisionPage.discardSegmentFile()` | Unused, no test coverage |
| `RevisionPage.discardSequenceFile()` | Unused, no test coverage |
| `RevisionPage.discardMetadataFile()` | Unused, no test coverage |
| `RevisionPage.clickConfirm()` | Unused, no test coverage |
| `RevisionPage.reviseSequence()` | Unused convenience wrapper |
| `RevisionPage.reviseMultiSegmentSequence()` | Unused convenience
wrapper |
### Added test coverage
| Method | Test file |
|--------|-----------|
| `SearchPage.getSequencePreviewModal()` |
`sequence-preview-url.dependent.spec.ts` |
| `SearchPage.getHalfScreenPreview()` |
`sequence-preview-url.dependent.spec.ts` |
| `CliPage.authStatus()` | `auth.spec.ts` |
| `SequenceDetailPage.selectAlignedTab()` |
`sequence-detail-page.dependent.spec.ts` |
| `GroupPage.editAddressLine2()` | `management.spec.ts` |
| `ReviewPage.navigateToReviewPage()` | `review-page.spec.ts` |
| `RevisionPage.downloadTsvTemplate()` | `revise-sequence.spec.ts` |
| `RevisionPage.downloadXlsxTemplate()` | `revise-sequence.spec.ts` |
| `CliPage.setDefaultOrganism()` | `organism-group.spec.ts` (new) |
| `CliPage.clearDefaultOrganism()` | `organism-group.spec.ts` (new) |
| `CliPage.setDefaultGroup()` | `organism-group.spec.ts` (new) |
| `CliPage.clearDefaultGroup()` | `organism-group.spec.ts` (new) |
| `CliPage.getAvailableOrganisms()` | `organism-group.spec.ts` (new) |
| `CliPage.getAvailableGroups()` | `organism-group.spec.ts` (new) |
### Bug fix
- Fixed `SequenceDetailPage.alignedTab` getter to use `.first()` to
handle pages with multiple aligned tabs (aligned nucleotide and aligned
amino acid sequences)
## Test plan
- [x] All modified tests pass against `main.loculus.org`
- [x] New `organism-group.spec.ts` CLI tests pass
- [x] New revision template download test passes
- [x] ESLint and Prettier pass
---
🤖 Generated with [Claude Code](https://claude.ai/code)
🚀 Preview: Add `preview` label to enable

Co-authored-by: Chaoran Chen <mail@chaoran-chen.de>
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