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
Cannot run all tests sequentially in protractor #708
Comments
This should not happen - what do you mean all the tests start running simultaneously? How many browser winwos do you have, and what's the output? |
I have only one Browser window. When the first test spec runs, login is successful and while its trying to navigate then second test kicks in and fails as it cannot find the login page. The browser results in 404 error (page not found) and the protractor has the following error Starting selenium standalone server... ..\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\promise.js:1702 Driver info: org.openqa.selenium.chrome.ChromeDriver Process finished with exit code 1 |
It sounds like the tests are running sequentially but you have a synchronization problem where your spec is not waiting until login is done before it moves on. How are you doing your login? Here's a working example from Protractor's own test suite: https://github.com/angular/protractor/blob/master/spec/withLoginConf.js Note how it uses |
I tried running the protractor config using the above example but still it doesn't seem like its running sequentially. The above example will only wait until the login is successful and it triggers the second test without waiting for the first test to finish. I need the first test to run completely and finish and then the second test should start to run. |
I have a similar issue in my tests. It seems like it depends on where I put my navigation logic and when it gets executed. E.g. if I have a |
@KasMA1990 that's how Jasmine works - anything inside a |
Oh damn, sorry! I'm still new to this d: |
@nethulap what test framework (jasmine/mocha) are you using? Could you share your tests? |
The problem is fixed now. I have changed the way every test navigates. The following is the solution for the above problem. For every test spec inside the This ensures the second test never interferes with the first one until the first test finishes its execution completely. My code looks like this Thank you for the help. |
I tried running the protractor config using the above example but still it doesn't seem like its running sequentially. The above example will only wait until the login is successful and it triggers the second test without waiting for the first test to finish. I need the first test to run completely and finish and then the second test should start to run.but the first and second files are in different folders. |
i am also getting same issue, i have one describe associated with one "it" I wan to know is there any annotation or keyword in Jenkin or Jasmine, to make suite run sequentially ione after the other like we used to work in TestNG using @priority annotation |
For the above mentioned problem, the alternative way, i think so is, to place all these files names in a sequential order as a suite in one file and make the trigger to collect the testcase from that file which contains the all the testcase names. |
+1 |
I am new to E2E testing with Protractor. I have created 3 test specs. Each test spec has one
describe
and severalit
in it. I want to run all specs sequentially.My protractor config file with specs listed like this
specs: [
'tests/../test1_spec.js',
'tests/../test2_spec.js',
'tests/../test3_spec.js'
]
When I run my protractor config file all the tests start running simultaneously.
I am not sure if my config file is wrong or something else which is triggering the simultaneous tests runs.
The text was updated successfully, but these errors were encountered: