Created
February 21, 2017 09:49
-
-
Save arnaudvalle/773b9aebd32462b27c0e55e0d98dcab6 to your computer and use it in GitHub Desktop.
A basic sitespeed login preScript example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
run(context) { | |
return context.runWithDriver((driver) => { | |
var DOMAIN = 'http://lumsites-sandbox.appspot.com/'; | |
return driver.get(DOMAIN + 'login?from=email').then(() => { | |
var webdriver = context.webdriver; | |
console.log('Trying to login into ' + DOMAIN + '...'); | |
var EMAIL = 'lumapps.sitespeed.test@mailinator.com'; | |
var PASSWORD = 'sitespeed1234'; | |
// Fill in the 'external account' form with the login details and submit the form. | |
driver.findElement(webdriver.By.name('login')).sendKeys(EMAIL); | |
driver.findElement(webdriver.By.name('password')).sendKeys(PASSWORD); | |
driver.findElement(webdriver.By.css('.login-card__submit-btn')).click(); | |
console.log('Logged in successfully as ' + EMAIL); | |
}); | |
}); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment