-
Notifications
You must be signed in to change notification settings - Fork 2.3k
(Feature Request) Support running scenario by line number #4522
Comments
Hi @gd46 Tnx for your feature request. Are you talking here only about CucumberJS? If so, wouldn't that be the responsibility of the framework like protractor-cucumber-framework or your own to support that? If we look at Jasmine and Mocha I think it would be a different story because you works the @vikerman / @cnishina , |
@wswebcreation Thank you for the quick reply! Yes I was talking about CucumberJS. I wasnt sure if this was a protractor issue or something that protractor-cucumber-framework could handle. At the moment im using cucumber so that was my main interest, and I saw cucumber-js supported it but like I said if you pass the fileName:line number to protractor it didnt recognize that I wanted to run that scenario. If this issue is misplaced and I should log it with protractor-cucumber-framework please let me know and we can close and ill open an issue there.. But I do think this would be a great feature and allow for even better parallel testing. |
Sorry was on my phone didn't mean to hit the comment and close |
Hi @gd46 I'm wondering what the issue / feature request would hold. I just created a simple test and it works as you describe / want. # Featurefile
Feature: Run a test by line number
Scenario: Skip scenario on line 3
Given I skip
Then I'm skipped
Scenario: Skip scenario on line 7
Given I skip
Then I feel like a skipyball
Scenario: Run the scenario on line 11
Given I foo a bar
Then I have a foo-bar node node_modules/.bin/protractor e2e-tests/config/protractor.e2e.local.conf.js --specs e2e-tests/features/example.feature:11
[06:27:45] I/launcher - Running 1 instances of WebDriver
[06:27:45] I/local - Starting selenium standalone server...
[06:27:45] I/local - Selenium standalone server started at http://10.236.54.137:62276/wd/hub
Feature: Run a test by line number
Scenario: Run the scenario on line 11
✔ Given I foo a bar
✔ Then I have a foo-bar
1 scenario (1 passed)
2 steps (2 passed)
0m04.132s
[06:27:52] I/local - Shutting down selenium standalone server.
[06:27:52] I/launcher - 0 instance(s) of WebDriver still running
[06:27:52] I/launcher - chrome #01 passed
|
hmm thats odd I tried it again and I do see that working. Im not sure if I had a typo or something but it does seem to work. Im going to try again with what I wanted to do to try to run scenarios in parallel using this. |
Im still trying this out, but at the moment I see it still pick up both scenarios within a file. Given this result:
Would you use the locations line under name? This is my example feature:
And if I run:
I see it run both scenarios |
Can you then please provide a working example where you see this issue so I can debug it |
You beat me to it! Thank you for such quick replies. If you checkout this branch: https://github.com/gd46/dibellag-automation-framework/tree/parallel_scenarios And run the following Im expecting to run each of the three scenarios in parallel(going to clean it up more once It works properly)
|
Tnx, will check it out later. Hope to have time for it this evening |
Thank you so much that would be great! Just to clarify the current issue once more. From what I can tell now it seems to ignore the file number on the end and run each of the specified feature files. |
Hi @wswebcreation, was wondering if you had a chance to run my example? And I was curious to know what versions of protractor, cucumber, and protractor-cucumber-framework that you ran your example on? |
Hi @gd46 Sorry for my late reaction. Was in Berlin for the Selenium Conf ;-). I've checked it again and changed my local config to this capabilities: {
browserName: 'chrome',
specs: '/Users/wswebcreation/contributions/e2e-tests/features/example.feature:7'
} and it still works. I think you need to check your own code because it now looks like all is working as expected. Secondly because this is about using a third party framework I would advice checking protractor-cucumber-framework so I'm going to close this issue for now. |
No worries, thanks again I'll have another look. |
@wswebcreation can you take a look at this issue once more? There is a similar discussion in cucumber is but I think the issue is that the spec path that protractor cucumber framework ends up with is absolute and that's when I see it doesn't work. |
I'd like to see support to be able to pass protractor a location, ie: a file name:line number and have it run that specific test.
Cucumber-js has a way of doing this, and I know its not part of the core support of protractor, but I think it would be useful for other test frameworks as well if possible. If you could do this then you can run each scenario in parallel.
Take this example:
https://github.com/gd46/dibellag-automation-framework/blob/master/configuration.js#L32
I am using getMultipleCapabilities function to run each file in parallel by creating my own custom shards based on cucumber features that meet the tag expression. Cucumber-js allows tests to be run by line number, and in the current code I have setup I am able to extract that but not run them how cucumber expects.
For example:
Given the follow spec options:
I would expect it to run just the one scenario on line 8.
The text was updated successfully, but these errors were encountered: