Skip to content

Instantly share code, notes, and snippets.

@horike37
Last active August 29, 2015 14:20
Show Gist options
  • Save horike37/4e628c9a84f466ccba19 to your computer and use it in GitHub Desktop.
Save horike37/4e628c9a84f466ccba19 to your computer and use it in GitHub Desktop.
WordPressのバージョンアップを実施した際に回帰テストを行う ref: http://qiita.com/horike37/items/87f9e178e35ece82daa7
{
"login": {
"url":"http://wordpress.local/wp-login.php",
"account_id":"admin",
"account_pass":"admin"
}
}
var webdriver = require('selenium-webdriver');
var t = require('selenium-webdriver/testing');
var driver;
var By = webdriver.By;
var setting = require('./setting.json');
t.describe('WordPressバージョンアップ後のテスト', function() {
t.before(function() {
driver = new webdriver.Builder().
usingServer('http://localhost:4444/wd/hub').
withCapabilities(webdriver.Capabilities.chrome()).
build();
});
t.after(function() {
driver.quit();
});
t.it('ログイン', function() {
driver.get(setting.login.url);
driver.findElement(By.name("log")).sendKeys(setting.login.account_id);
driver.findElement(By.name("pwd")).sendKeys(setting.login.account_pass);
driver.findElement(By.name("wp-submit")).click();
driver.wait(function() {
return driver.getTitle().then(function(title) {
return title === 'Dashboard ‹ Welcome to the VCCW — WordPress';
});
}, 5000);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment