testcafe icon indicating copy to clipboard operation
testcafe copied to clipboard

feature request --test-meta-grep

Open fmancardi opened this issue 3 years ago • 9 comments

What is your Test Scenario?

the test test1 covers multiple tickets: 10101,2222,666 the test test2 covers multiple tickets: 9999,2222,333 the test test3 covers multiple tickets: 666,888

for each test a separated js file is created (design choice) with meta ISSUES with the values defined in this way: for test1 test .meta({"ISSUES": "10101,2222,666"}) for test2 test .meta({"ISSUES": "9999,2222,333"}) for test3 test .meta({"ISSUES": "666,888"})

I would like to run test cases that cover issue 2222 OR 666, and AFAIK today it's not possible.

What are you suggesting?

add --test-meta-grep keyword

then I will be able to launch testcafe in this way testcafe ... --test-meta-grep ISSUE='2222|666'

the format to specify the pattern will be the same used by grep (pattern multiple strings)

fmancardi avatar Apr 26 '21 20:04 fmancardi

Hi @fmancardi

Thank you for sharing this idea.

miherlosev avatar Apr 28 '21 07:04 miherlosev

This issue has been automatically marked as stale because it has not had any activity for a long period. It will be closed and archived if no further activity occurs. However, we may return to this issue in the future. If it still affects you or you have any additional information regarding it, please leave a comment and we will keep it open.

github-actions[bot] avatar Apr 29 '22 02:04 github-actions[bot]

We're closing this issue after a prolonged period of inactivity. If it still affects you, please add a comment to this issue with up-to-date information. Thank you.

github-actions[bot] avatar May 10 '22 01:05 github-actions[bot]

HI do you plan to consider this request? this issue has been closed automatically

best regards

fmancardi avatar May 10 '22 05:05 fmancardi

Hi @fmancardi.

We are collecting user feedback regarding this feature. For now, I see there is only one customer reaction - from @testorangemac. So it doesn't seem like this feature is much in demand in the TestCafe community. However, we will continue to collect feedback from our users.

miherlosev avatar May 11 '22 08:05 miherlosev

@miherlosev It seems the only alternative is to rename all existing tests so that -T, --test-grep <pattern> can be used instead?

Other than that (and maybe easier to implement), it might be helpful to have a blacklist instead of just being able to whitelist meta values and/or test/fixture names? For example, if you want to exclude all tests that require authentication.

Is there a specific reason why this doesn't exist (yet), or am I missing something?

Keep up the great work! ❤️

lastzero avatar Jul 12 '22 15:07 lastzero

Hi @lastzero,

This thread is about adding the command-line option --test-meta-grep. Due to low demand we keep it closed. However, you can filter tests by meta using the Runner.filter method. In this case, you need to use a programmatic way to run your tests.

miherlosev avatar Jul 15 '22 07:07 miherlosev

Thank you! I understood that. It was feedback on the requested --test-meta-grep parameter, because it seems to be ONE WAY for non-developers to implement a blacklist (without developing their own filtering function, which not all users can do flawlessly even if they find it in the docs).

This is a common use case for test tools that IMHO you should consider. Should I have a little time, I will try to contribute.

(Edit: I don't expect a reply.)

lastzero avatar Jul 15 '22 11:07 lastzero

Thank you for the feedback. Your contribution is greatly appreciated.

miherlosev avatar Jul 18 '22 08:07 miherlosev

This issue has been automatically marked as stale because it has not had any activity for a long period. It will be closed and archived if no further activity occurs. However, we may return to this issue in the future. If it still affects you or you have any additional information regarding it, please leave a comment and we will keep it open.

github-actions[bot] avatar Jul 31 '23 01:07 github-actions[bot]

We're closing this issue after a prolonged period of inactivity. If it still affects you, please add a comment to this issue with up-to-date information. Thank you.

github-actions[bot] avatar Aug 11 '23 01:08 github-actions[bot]