1

I'm not sure if this is possible. I want to have 1 file per test (spec/it), and have a separate file wich only has the test suite defined (describe funciont), that includes all my other files with my "its" specs. Something like this:

Suite1.js has the test suite configuration:

describe('Account test suite', function () {
beforeEach(function () {
bla bla bla
}

afterEach(function () {
bla bla bla
}

require('test_case1');
require('test_case2');
require('test_case3');

});

test_case1.js has only the specs like:

it('Betting Successful Win', function () {        

        onLoginContainer
            .given.openedLoginForm()
            .when.loginIsAttempted(browser.params.account.id, browser.params.account.pin, browser.params.state);

        onLoginContainer
            .then.itShouldBeLoggedIn();
});    

And when I run Suite1.js, it runs all the required tests. Is this possible ? Thanks

1 Answers1

0

Let protractor handle it and configure suites that would group your tests:

suites: {
    suite1: ["test1.spec.js", "test2.spec.js"],
    suite2: ["test3.spec.js"]
},
Community
  • 1
  • 1
alecxe
  • 462,703
  • 120
  • 1,088
  • 1,195