protractor icon indicating copy to clipboard operation
protractor copied to clipboard

Testing multiple specs

Open jurgenvo opened this issue 12 years ago • 6 comments

Hi,

I am trying to run multiple specs that are defined in the config.js file.

specs: ['folder1/test1.spec.js', 'folder2/test1.spec.js', 'folder2/test2.spec.js']

When I run this, one browser window opens and it starts the first test, but then without finishing the first test, it will start the second.

Is there some option that makes sure that the test will start when the other test is finished? Or am I doing something wrong here?

Thanks in advance!

jurgenvo avatar Jul 15 '14 08:07 jurgenvo

How do you know it's starting the second test without finishing the first? What is the output that you are seeing?

Protractor should automatically wait for a test to finish before starting the next one. It queues all requests and then runs them in series.

juliemr avatar Jul 15 '14 17:07 juliemr

I can see the URL in the browser window change to an address that is not used within the first test.

jurgenvo avatar Jul 16 '14 07:07 jurgenvo

What framework are you using? (Jasmine, Mocha?) If you just include one spec file, does that complete as expected?

juliemr avatar Jul 17 '14 04:07 juliemr

We found what the problem was. I was using the Jasmine framework. The problem was that we were initializing some pages (and opening the with browser.get()) inside the describe block. Since the framework puts all the things that are in the describe block inside the global scope, all the pages got initialized at the start of the run. To solve it, we put the initialization of the page objects into an 'it' block.

jurgenvo avatar Jul 17 '14 08:07 jurgenvo

I have to run two senerios using protractor. config.js I given two of the spec name. But not running second one. here is the sample. Please advice. Thanks

config.js specs: ['mcac_jm_online_NRE_flow.js','mcac_jm_online_RTE_flow.js'],

reddynr avatar Dec 16 '16 19:12 reddynr

Hi,

Is it possible to include the 2nd file in the end of 1st test file ?

Like with coding in asp or php we can transfer execution to other file can this be done with jasmine

specs: ['sendmsg.ts']

sendmsg.ts

describe(){ it (){ run case } call readmsg.ts; }

Thanks

Pankaj-Pippin avatar Feb 16 '18 08:02 Pankaj-Pippin