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

How to run many different Scenario() without closing the browser? #37

Closed
arsa666 opened this issue Dec 19, 2015 · 6 comments
Closed

How to run many different Scenario() without closing the browser? #37

arsa666 opened this issue Dec 19, 2015 · 6 comments

Comments

@arsa666
Copy link

arsa666 commented Dec 19, 2015

How to run many different Scenario() without closing the browser? This is my code:

Before((I) => {
    I.amOnPage('/');
    I.fillField('email', 'someEmail@gmail.com');
    I.fillField('password', '123456');
    I.click('Sign in');
});

Scenario('Check to see if it has landing page and welcome msg', (I) => {
    I.see('Welcome to Casefriend Version 1.0');
    I.amOnPage('http://cflocal/#landing');


});

Scenario('Logining into Casefriend', (I) => {
    I.click('Users');
    I.click('New User');
});

This code passes correctly but it opens firefox, test Scenario 1 then closes firefox, opens again, and tests second Scenario. I want it to do everything on one single firefox instance. How can I do?

@DavertMik
Copy link
Contributor

I think this is a good feature that will be available soon in upcoming releases )
Thanks for the suggestion

@fabioel
Copy link
Contributor

fabioel commented Jan 5, 2016

@DavertMik It would be really awesome if the state is reset to the initiale state of the site after each test, in order to enable a clean testing environment. (This is something CasperJS has issues with 😉)

@smozely
Copy link

smozely commented May 31, 2016

@DavertMik
This is kinda killer for working with SauceLabs (starting browsers there is slooow)

I've been looking at how to implement this today ... Basic plan of attack is just a custom WebDriverIO Helper that only starts the browser if it hasn't already been created... This could then be easily be expanded to work off a config option, and I'd probably add that after a test fails, it might be worth restarting the browser.

... only problem is there is no beforeAll/afterAll currently implemented (as per #103) so there is no place to hook into really shut down the browser ... any thoughts on doing this?

@Nighthawk14
Copy link
Contributor

@smozely I created a PR with this feature for Protractor/Selenium, I can try to look into it for webdriver.io or If you want to have a look feel free. #167

@HughZurname
Copy link
Contributor

@fabioel Have you tried using Nightmare? There's a setting that effectively does what you're referring to.
Below is an extract from my helpers config:

Nightmare: {
      url: 'http://localhost:3000',
      webPreferences: {
        partition: 'nopersist'
      }
   }

@APshenkin
Copy link
Collaborator

Closing this issue, now there is restart option that can be used for disabling browser restart

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

7 participants