I was trying to run my tests as a suite. There are three tests in a suite, how can I make my browser close after each test ?
suites:
{
one: 'one.js',
two: 'two.js',
three: 'three.js'
};
The problem is that each of this test is used to load a separate url, and each test checks whether the correct url is loaded. But my test fails each time as all the urls are different.
You can use below method in you spec.js
afterEach(() => {
browser.close(); (or browser.driver.close();)
console.log('afterEach');
});