Last active
August 29, 2015 14:20
-
-
Save horike37/4e628c9a84f466ccba19 to your computer and use it in GitHub Desktop.
WordPressのバージョンアップを実施した際に回帰テストを行う ref: http://qiita.com/horike37/items/87f9e178e35ece82daa7
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
{ | |
"login": { | |
"url":"http://wordpress.local/wp-login.php", | |
"account_id":"admin", | |
"account_pass":"admin" | |
} | |
} |
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
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