-
Notifications
You must be signed in to change notification settings - Fork 61
tagExpression doesn't allow to add more than one tag. #80
Comments
Have you tried using '@login or @search' yet? I had to go through this recently. There's a small snippet in their changelog under 2.0.0-rc.0 that explains the new format for their tag expressions. |
@glenheide I have done all the things as they explained. But when I say tagExpression as '@login and @search' it skips both the features but launches the instances and doesn't run any tests. Similarly with '@login or @search'. |
I am having the same issue... @arunaousula9421 have you found a solution? |
@markmssd you can use workaround in your wdio.conf you can manually filter specs with your tags like that:
|
It works, thanks a lot @BorisOsipov! 🎉 |
@markmssd you're welcome. pay attention it's a bit raw and it handles emails in your feature files as tag (because emails have |
Right, if we use the regex |
@markmssd yep :) |
Should this code go in wdio.conf.js ? @BorisOsipov |
yes
чт, 7 июн. 2018 г. в 22:39, Venkat Rao <notifications@github.com>:
… const fs = require('fs');
const { TagExpressionParser } = require('cucumber-tag-expressions');
const glob = require('glob');
const featuresPath = './src/features/**/*.feature';
const tagParser = new TagExpressionParser();
const featureFilesWithTags = (featuresPath, cucumberTags) => {
const expressionNode = tagParser.parse(cucumberTags);
const featureFilesHaveTags = glob.sync(featuresPath).filter((featureFile)
=> {
const content = fs.readFileSync(featureFile, 'utf8');
if (content.length > 0) {
const tagsInFile = content.match(/(@\w+)/g) || [];
if (expressionNode.evaluate(tagsInFile)) {
return true;
}
}
return false;
});
return featureFilesHaveTags;
};
exports.config = {
....
specs: featureFilesWithTags(featuresPath, ***@***.*** or @search')),
cucumberOpts: {
tagExpression: ***@***.*** or @search'),
....
}
....
}
Should this code go in wdio.conf.js ? @BorisOsipov
<https://github.com/BorisOsipov>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#80 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AGNmZA65Z5JohITHH0Z4JHE9IMsL-tQBks5t6YFbgaJpZM4QKDUy>
.
--
--
Best Regards,
Boris Osipov
|
@BorisOsipov thanks for the snippet. It works , but it opens multiple browser instances (equal to the number of features file). Only one feature file has the tag I intend to run. Is there a way to restrict the browser instance to open only one? |
don't know why. it must not. for me it works like a charm |
@BorisOsipov In earlier version of the After upgrading my Any suggestions ? |
Use |
@BorisOsipov I used
with output :
|
It seems to not able to handle |
how do you use it? |
It works. Cucumber uses |
@BorisOsipov
Here is the output :
Here is my
|
And why did you decide that is not work? You just print |
Well, I am trying to read all
|
smth like this? |
Works like a charm !!!!! Thanks @BorisOsipov |
@BorisOsipov me again, I know it is not related to this thread and if needed i will create separate issue but when I am trying to set my test data to Here is my code :
Any help appreciated ? |
@ckurban please when you write "seems it doesn't work", "it seems, it does not read" in issues explain what you expect and what happened then. It is hard to guess what do you mean by "it does not read", any errors\failed checks? |
@BorisOsipov I am trying to set test data to It was working before my upgrade where I was able to retrieve the url and endpoints from the global envConfig object. Does that make sense ? |
@ckurban Not sure what is going on but I guess this will help
|
@BorisOsipov I am keep getting this error:
hooks such as |
Hi, Below is my CucumberOptns where I am passing the tags to run specific tests
For Example, I have two feature files with tags @login and @search. If I add only one tag which is @login it spins up two instances where in one instance it doesn't run the tests and in the second instance it runs the tests for the @login. Actually it should spawn up only one instance. As I have two features it spawn 2 instances.
In the other situation as above in the cucumberOpts, if I pass two tags it spawn two instances and didn't run both the tests. Skipped both of them.
Tried adding different combinations of tag expression.
For example: if I add @login not @search, it does same as above open two instances and run one test[@login] and in another instance launches browser and doesn't run anything[@search].
And if I add @login and search, it launches instances for both and skips the tests.
Can I please know if this how it behaves.
The text was updated successfully, but these errors were encountered: