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

Question: Run by line number #178

Open
viktor-silakov opened this issue Jul 12, 2024 · 8 comments
Open

Question: Run by line number #178

viktor-silakov opened this issue Jul 12, 2024 · 8 comments
Labels
question Further information is requested

Comments

@viktor-silakov
Copy link

viktor-silakov commented Jul 12, 2024

Can I run a specific scenario by line number? It is a handy feature in cucumber-like tools. Example:

npx wdio --spec ./features/test.feature:N

where N - is the number of a scenario name line or line with a specific example in some Scenario Outline.

Yes I know about the @only tag but in some situations run by line is more suitable

@viktor-silakov viktor-silakov added the question Further information is requested label Jul 12, 2024
@alescinskis
Copy link

Why not give your scenarios custom tags (e.g. @scenarioFailedLogin) and then execute by a specific tag or groups of tags? I think it's more beneficial in the long run, than relying on line number that might change.

@viktor-silakov
Copy link
Author

viktor-silakov commented Jul 12, 2024

Why not give your scenarios custom tags (e.g. @scenarioFailedLogin) and then execute by a specific tag or groups of tags? I think it's more beneficial in the long run, than relying on line number that might change.

You are right, this is not for the long run, for debugging mostly, it can be used for example to run certain scenarios via IDE extension (e.g. VScode). BTW there is no way to run certain example in Outline using the tag system.

@vitalets
Copy link
Owner

I saw this in Cucumber, and I also curious what is the dev flow for it?

Playwright itself does not provide such feature. It can run particular scenario by file + scenario name.
So, to get it working, we need Playwright to support it on the runner side. Or generate only that scenario in spec file.

For VSCode the expected way for debugging playwright-bdd tests is using Playwright VSCode extension, that allows to run particular scenario / example just by click:

image

@viktor-silakov
Copy link
Author

viktor-silakov commented Jul 12, 2024

I saw this in Cucumber, and I also curious what is the dev flow for it?

image image

Very convenient to run certain example in such a way for example. Especially to run such things on ci/cd.

@vitalets
Copy link
Owner

Ok.
Btw, do you the VSCode extension that allows to run example line from feature file just by click?

@viktor-silakov
Copy link
Author

Ok. Btw, do you the VSCode extension that allows to run example line from feature file just by click?

I use my own one for WDIO + Cucumber. But really it is more for CI/CD not for extension, there are cases when I need to do this on some heavy e2e outlines.

@vitalets
Copy link
Owner

How to you run particular line on CI/CD?

@viktor-silakov
Copy link
Author

How to you run particular line on CI/CD?

Just put something like test.feature:23 in the path field of my job :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants