refactor(integration-tests): remove unused methods - #5830
Conversation
|
At first glance I'm not sure about this for most of these. These are all 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:
|
|
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 |
|
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 |
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] |
|
Closed in favor of #5852. |
#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>
This removes unused code in the integration tests.
(This is using the branch from #5827 as base to avoid conflicts.)
🚀 Preview: Add
previewlabel to enable