Skip to content

Run All Related Tests from Context Menu #50

@Christopher-C-Robinson

Description

@Christopher-C-Robinson

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

  1. Open a TypeScript or JavaScript file with a class that contains methods referenced by multiple test files.
  2. Right-click on the method or class and select TestCafe: Run Test(s) in....
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions