-
Notifications
You must be signed in to change notification settings - Fork 25
[full-ci] detect and delete unused steps #840
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR removes several unused step definitions and associated helper functions, and adds a new command to detect them.
- Removed unused helper functions and step definitions from support objects and test files.
- Added a new package.json script ("check:unused-steps") to identify unused steps.
Reviewed Changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/e2e/support/objects/app-files/share/utils.ts | Removed unused function "resourceIsNotOpenable". |
| tests/e2e/support/objects/app-files/share/index.ts | Removed reference to "resourceIsNotOpenable" from the Share class. |
| tests/e2e/support/objects/app-files/resource/index.ts | Removed unused functions "checkThatFileVersionIsNotAvailable" and "expectFileToBeSelected". |
| tests/e2e/support/objects/app-files/resource/actions.ts | Removed unused file version related function "checkThatFileVersionIsNotAvailable". |
| tests/e2e/support/objects/app-files/page/shares/withMe.ts | Removed unused method "openShareWithMeFromInternalLink". |
| tests/e2e/support/objects/app-files/page/public.ts | Removed unused method "uploadInternal". |
| tests/e2e/support/objects/app-files/link/index.ts | Removed unused function "getPublicLinkUrl". |
| tests/e2e/support/objects/app-files/link/actions.ts | Removed unused function "getPublicLinkVisibility". |
| Multiple tests files (cucumber steps) | Removed unused step definitions related to deleted helper functions. |
| package.json | Added the "check:unused-steps" command. |
Comments suppressed due to low confidence (17)
tests/e2e/cucumber/steps/ui/session.ts:40
- Removed step definitions for login/logout that appear to be unused; ensure that the new session handling steps cover all necessary scenarios.
await page.locator('#web-content').waitFor()
package.json:24
- The addition of the 'check:unused-steps' script is a useful enhancement; please ensure it is integrated into the CI process for continuous feedback.
"check:unused-steps": "TS_NODE_PROJECT=./tests/e2e/cucumber/tsconfig.json cucumber-js --profile=e2e --format usage --dry-run tests/e2e/cucumber/features/*/*.feature"
tests/e2e/support/objects/app-files/share/utils.ts:1
- Removal of the unused 'resourceIsNotOpenable' function is appropriate; please ensure no other parts of the code are relying on it.
import { errors, Page } from '@playwright/test'
tests/e2e/support/objects/app-files/share/index.ts:52
- The removal of the 'resourceIsNotOpenable' method from the Share class is consistent; verify that no tests or dependent logic require its behavior.
}
tests/e2e/support/objects/app-files/resource/index.ts:274
- Removing the 'checkThatFileVersionIsNotAvailable' function cleans up unused code; ensure that any file version related checks are covered elsewhere if needed.
}
tests/e2e/support/objects/app-files/resource/index.ts:308
- The deletion of 'expectFileToBeSelected' is acceptable as long as its functionality is not required by any active tests.
}
tests/e2e/support/objects/app-files/resource/actions.ts:1866
- Removing the unused version check function helps reduce maintenance overhead; confirm that version-related functionality remains tested where needed.
}
tests/e2e/support/objects/app-files/page/shares/withMe.ts:10
- The removal of 'openShareWithMeFromInternalLink' is justified if it is no longer used; double-check that tests are updated accordingly.
}
tests/e2e/support/objects/app-files/page/public.ts:67
- Removing the 'uploadInternal' method is acceptable if it is unused; please confirm that there are no lingering test cases expecting this functionality.
}
tests/e2e/support/objects/app-files/link/index.ts:82
- Ensure that the removal of 'getPublicLinkUrl' does not affect any remaining tests or functions that might require public link URL retrieval.
}
tests/e2e/support/objects/app-files/link/actions.ts:306
- The deletion of 'getPublicLinkVisibility' is acceptable if public link visibility is now managed by other functions; confirm that its removal doesn’t leave any gaps in functionality.
}
tests/e2e/cucumber/steps/ui/shares.ts:192
- The removal of this step definition is consistent with the overall cleanup; please confirm that the test suite reflects these changes.
for (const resource of stepTable.hashes()) {
tests/e2e/cucumber/steps/ui/resources.ts:723
- The removal of version checking steps cleans up the test suite; verify that version functionality is sufficiently covered elsewhere.
async function (this: World, stepUser: string, spaceName: string) {
tests/e2e/cucumber/steps/ui/public.ts:157
- Removing this test step is acceptable if the associated 'uploadInternal' functionality has been deprecated; ensure alternative tests cover public link uploads if needed.
for (const info of stepTable.hashes()) {
tests/e2e/cucumber/steps/ui/links.ts:166
- The removal of these public link step definitions is fine as long as their functionality is either obsolete or reimplemented elsewhere.
}
tests/e2e/cucumber/steps/ui/adminSettings.ts:145
- The deletion of this navigation step is acceptable if it is no longer in use; please confirm that admin settings are still adequately tested.
switch (action) {
tests/e2e/cucumber/steps/api.ts:206
- Removing these API step definitions helps in cleaning up unused tests; please make sure that remaining API tests fully cover resource creation functionalities.
for (const info of stepTable.hashes()) {
|
CI is failed due #841 |
|
fix failed tests is here #843 |
e77f89b to
8953aff
Compare
8953aff to
1f633d6
Compare
pnpm check:unused-steps, which compares all steps fromfeatureandstepDefinitionsfiles and finds unused steps that should, of course, be deleted.example: