-
Notifications
You must be signed in to change notification settings - Fork 16
Description
Enhancement Request: Run All Related Tests from Context Menu
Description
Currently, the extension allows users to right-click within a test or class and run individual tests. However, when right-clicking on a method or class, the extension responds that there are no tests in the file, even though the method or class may be used by multiple tests across the project.
The desired enhancement is to allow users to right-click on a method or class and select to run all tests in the project that reference that method or class. This will provide greater flexibility and efficiency when testing methods that are shared across multiple test files.
Expected Behavior
- Right-clicking on a method: Runs all tests across the project that reference the method.
- Right-clicking on a class: Runs all tests across the project that reference any method within the class.
Steps to Reproduce Current Behavior
- Open a TypeScript or JavaScript file with a class that contains methods referenced by multiple test files.
- Right-click on the method or class and select TestCafe: Run Test(s) in....
- Observe that the extension says there are no tests in the file, rather than running all tests that reference the method or class.
Suggested Solution
Enhance the context menu functionality to identify all tests in the project that reference the selected method or class and run them accordingly.
Benefits
- Improved Developer Workflow: Saves time by running all relevant tests for a method or class without needing to locate and trigger individual tests manually.
- Enhanced Test Coverage Verification: Allows developers to ensure that all relevant tests for a method or class have been run when making changes.
Acceptance Criteria
- Right-clicking a method should provide an option to run all tests across the project that reference it.
- Right-clicking a class should provide an option to run all tests across the project that reference any of its methods.
- Tests are correctly identified and run without false positives or negatives.
Additional Context
This enhancement will be especially useful for projects with shared utility classes or commonly reused methods, improving both productivity and confidence in code quality.