From 8653df44f33e248821f257d54c81db4377a66a24 Mon Sep 17 00:00:00 2001 From: Surma Date: Thu, 23 Feb 2017 23:11:45 +0000 Subject: [PATCH] Fix example code on landing page (#82) --- docs/index.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/docs/index.md b/docs/index.md index 29f0a49..08765e8 100644 --- a/docs/index.md +++ b/docs/index.md @@ -40,6 +40,7 @@ on the current machine, filter out any browsers you may not want and then get a web driver instance for that browser, this can be done like so: ```javascript +const selenium = require('selenium-webdriver'); const seleniumAssistant = require('selenium-assistant'); const browsers = seleniumAssistant.getLocalBrowsers(); @@ -53,12 +54,10 @@ browsers.forEach(browser => { console.log(browsers.getPrettyName()); browser.getSeleniumDriver() - .then(webdriverInstance => { - return webdriverInstance.get('https://google.com/'); - }) - .then(() => { - return globalDriver.wait(selenium.until.titleIs('Google'), 1000); - }); + .then(webdriverInstance => + webdriverInstance.get('https://google.com/'); + .then(_ => webdriverInstance.wait(selenium.until.titleIs('Google'), 1000); + ); }); ```