Skip to content

Add "group" metadata to define which tests will be run #2527

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

Closed
MarinaRukavitsyna opened this issue Jun 19, 2018 · 5 comments
Closed

Add "group" metadata to define which tests will be run #2527

MarinaRukavitsyna opened this issue Jun 19, 2018 · 5 comments
Labels
STATE: Auto-locked An issue has been automatically locked by the Lock bot. TYPE: enhancement The accepted proposal for future implementation.

Comments

@MarinaRukavitsyna
Copy link

MarinaRukavitsyna commented Jun 19, 2018

Are you requesting a feature or reporting a bug?

A feature, posted by one of TestCafe customers (see details below)

In one of the recent releases I noticed that test and fixture metadata can now be added to the test scripts. Would it be possible in the future to use the metadata of a test to group them when running from command line? ie setting test.meta({sanity: true, fullRegression: true, feature1: false}) then from command line start all tests that have --meta '{sanity: true}' when i want to run only a small subset of my scripts?

I'm currently doing this using globs on Fixture and Test names but they will become long and involved with too many unsafe keywords when I expand my test suite.

Specify your

  • testcafe version: 0.20
@MarinaRukavitsyna MarinaRukavitsyna added TYPE: enhancement The accepted proposal for future implementation. TYPE: proposal labels Jun 19, 2018
@AndreyBelym AndreyBelym removed the TYPE: enhancement The accepted proposal for future implementation. label Aug 1, 2018
@iswarya-voxy
Copy link

iswarya-voxy commented Aug 14, 2018

This is a much needed feature. Ability to run a particular category of tests using their meta data set on the test or the fixture.
Example: test.meta({smoke: true, feature: true}) or fixture.meta({crud: read})
Command to run only smoke tests : testcafe --meta "smoke:true" test
Command to run only read tests : testcafe --meta "crud:read" test
or something similar.

Testcafe version : 0.21.1

@NickCis
Copy link
Contributor

NickCis commented Oct 5, 2018

I've implemented this feature in this PR.

The --meta JSON (eg: --meta {smoke: true}) flag was introduced. Only tests whose metadata matches the provided json will be run.

NickCis added a commit to NickCis/testcafe that referenced this issue Oct 10, 2018
testcafe-build-bot added a commit to testcafe-build-bot/testcafe that referenced this issue Oct 10, 2018
testcafe-build-bot added a commit to testcafe-build-bot/testcafe that referenced this issue Oct 10, 2018
NickCis added a commit to NickCis/testcafe that referenced this issue Oct 10, 2018
testcafe-build-bot added a commit to testcafe-build-bot/testcafe that referenced this issue Oct 10, 2018
testcafe-build-bot added a commit to testcafe-build-bot/testcafe that referenced this issue Oct 10, 2018
miherlosev pushed a commit to NickCis/testcafe that referenced this issue Oct 25, 2018
miherlosev pushed a commit to NickCis/testcafe that referenced this issue Oct 25, 2018
@AndreyBelym AndreyBelym added TYPE: enhancement The accepted proposal for future implementation. and removed TYPE: proposal labels Feb 6, 2019
@jafin
Copy link

jafin commented Feb 21, 2019

Is there any way to use the filter when a test omits the meta tag. ie
if we execute test with --test-meta smoke=false
and only have some tests marked up with test.meta("smoke","true")
it would be useful to have all tests without the attribute to execute the test given they do not meet truthy.

@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Feb 21, 2019
@NickCis
Copy link
Contributor

NickCis commented Feb 26, 2019

@jafin As the docs state: metadata value's are strings, so it really doesn't have sense to speak of truthy or falsy value. If you read the PR's comments, you will fully understand the cmd line api decision.

Anyway, you can implement you own custom runner, using the programming interface, to have the custom behavior that you need.

@miherlosev miherlosev removed the STATE: Need response An issue that requires a response or attention from the team. label Feb 26, 2019
@lock
Copy link

lock bot commented Mar 27, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs or feature requests. For TestCafe API, usage and configuration inquiries, we recommend asking them on StackOverflow.

@lock lock bot added the STATE: Auto-locked An issue has been automatically locked by the Lock bot. label Mar 27, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Mar 27, 2019
kirovboris pushed a commit to kirovboris/testcafe-phoenix that referenced this issue Dec 18, 2019
…ress#2954)

* Updated filter docs. closes DevExpress#2527

* Updated filter cli docs. closes DevExpress#2527

* updated doc

* fix lint
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
STATE: Auto-locked An issue has been automatically locked by the Lock bot. TYPE: enhancement The accepted proposal for future implementation.
Projects
None yet
Development

No branches or pull requests

7 participants