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

Running test files sequentially #592

Closed
mohsen1 opened this issue Mar 7, 2014 · 2 comments
Closed

Running test files sequentially #592

mohsen1 opened this issue Mar 7, 2014 · 2 comments

Comments

@mohsen1
Copy link

mohsen1 commented Mar 7, 2014

I want each file (or describe block) runs and finish then next describe block starts running my tests in it. (isn't that default jasmine behavior?)

I have multiple files in my tests folder, here is my config file:

exports.config = {
    seleniumAddress: 'http://localhost:4444/wd/hub', // goes to profile
    specs: argv.f ? argv.f.split(' ') : ['protractor/tests/*Test.js'],

    baseUrl: config.base_url + '/platform/',

    jasmineNodeOpts: {
        showColors: true,
        defaultTimeoutInterval: 25000
    },

    onPrepare: function() {

When I pass argument to test runner to just test one file, it works perfect. I tried this for every file and it did work. Each file has one describe block. But when I don't pass the argument for test file to test all files, it fails. I put console.log statements to see which file is running first, but surprising all my console.logs was printed at the same time.

Does Protractor tries to run all files that matches the patters at the same time? How can I fix this?

@juliemr
Copy link
Member

juliemr commented Mar 10, 2014

Protractor does not try to run all the files at the same time - You're probably seeing all of your console.log statements because all of the file are loaded before execution of any one test begins. Also, tests are asynchronous, which may be why you're getting console.log statements all at once (depending on where you put them).

@mohsen1
Copy link
Author

mohsen1 commented Mar 11, 2014

Hi @juliemr,

Thank you for responding. Per my investigation in issue, it was my fault that I was putting describe and it methods next to each other in my tests. My tests used to look like this:

describe('things', function(){
   it('should do foo', function(){/*...*/})
   describe('a batch of other things to test', function(){ /*...*/});
}

Now that I've moved those it calls in their own describe block, it doesn't have that problem anymore.

describe('things', function(){
   describe('foo', function()
       it('should do foo', function(){/*...*/})
   });
   describe('a batch of other things to test', function(){ /*...*/});
}

I'm closing the issue because it's not Protractor's fault.

@mohsen1 mohsen1 closed this as completed Mar 11, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants