Skip to content
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

Use Cypress config file to determine where test source files are located #18

Open
ArturT opened this issue Oct 23, 2018 · 3 comments
Open
Labels
enhancement New feature or request help wanted Extra attention is needed @knapsack-pro/cypress

Comments

@ArturT
Copy link
Member

ArturT commented Oct 23, 2018

Cypress already has a config file that says where the test source files are located. We could use that. Thanks to that user would not have to set KNAPSACK_PRO_TEST_FILE_PATTERN if he keeps tests in non-standard directory.

@ArturT ArturT added the enhancement New feature or request label Oct 23, 2018
@ArturT
Copy link
Member Author

ArturT commented Jun 17, 2022

Here is an example of how to define a node-glob pattern for KNAPSACK_PRO_TEST_FILE_PATTERN.
https://knapsackpro.com/faq/question/how-to-run-tests-only-from-specific-directory-in-cypress

I'm not sure if the issue still makes sense. I think the option to set your own KNAPSACK_PRO_TEST_FILE_PATTERN gives users more flexibility. For instance, you can run 2 different sets of tests on CI by specifying different KNAPSACK_PRO_TEST_FILE_PATTERN values per the @knapsack-pro/cypress command.

I'd like to hear feedback from users. What's your use case? Do you always have a single pattern in your cypress.config.js file? Do you use a few patterns? How?

@ArturT
Copy link
Member Author

ArturT commented Jan 30, 2023

Here is another related solution.

We've released the @knapsack-pro/cypress 5.3.0 version. Here is an example of how to use KNAPSACK_PRO_TEST_FILE_LIST_SOURCE_FILE to define a list of test files in the .txt file.
KnapsackPro/knapsack-pro-core-js#62

You could generate any list of test files you like and provide it to Knapsack Pro.

@3v0k4 3v0k4 transferred this issue from KnapsackPro/knapsack-pro-cypress Jun 13, 2023
@ArturT
Copy link
Member Author

ArturT commented Jun 13, 2023

I feel like this feature is a bit Cypress-specific and further away from how the Knapsack Pro architecture works now.

But maybe it could be combined with KNAPSACK_PRO_TEST_FILE_LIST_SOURCE_FILE. For example, we could detect test files based on the pattern defined in the cypress config file and then feed the txt file defined with KNAPSACK_PRO_TEST_FILE_LIST_SOURCE_FILE.
https://docs.knapsackpro.com/cypress/reference/#knapsack_pro_test_file_list_source_file

@ArturT ArturT added the help wanted Extra attention is needed label Jun 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed @knapsack-pro/cypress
Projects
None yet
Development

No branches or pull requests

2 participants