Skip to content

Commit

Permalink
Simple UI test.
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-x committed Oct 3, 2016
1 parent 95eb610 commit 7339187
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion browser-tests/nightwatch_runner.js
@@ -1,5 +1,5 @@
module.exports = {
'All Tests': function(browser) {
'Unit Tests': function(browser) {
browser
.url('http://localhost:8080/tests.html')
.waitForElementVisible('#qunit-testresult', 10000)
Expand All @@ -8,5 +8,24 @@ module.exports = {
browser.expect.element('#qunit-testresult .failed').text.to.equal('0');
browser.expect.element('#qunit-testresult .passed').text.not.to.equal('0');
browser.end();
},
'UI Tests': function(browser) {
browser
.url('http://localhost:8080/')
.waitForElementVisible('body', 1000)
.execute(function() {
window.setRemoteArchive('https://kiwix.github.io/kiwix-html5/tests/wikipedia_en_ray_charles_2015-06.zim');
})
.waitForElementVisible('#searchTitles', 20000)
.setValue('#prefix', "Ray")
.click('#searchTitles')
.waitForElementVisible('#titleList', 20000)
.useXpath()
.click("//div[@id='titleList']/a[text()='Ray Charles']")
.useCss()
.frame('articleContent')
.waitForElementPresent('#mweQ', 2000000)
.assert.containsText('#mweQ', 'Life and career')
.end();
}
};

0 comments on commit 7339187

Please sign in to comment.