Created
October 20, 2015 09:45
-
-
Save just-boris/6dd99e4d5386e6fcff19 to your computer and use it in GitHub Desktop.
JSUnderhood webdriver.io
This file contains hidden or 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
"use strict"; | |
var webdriverio = require("webdriverio"); | |
var config = require("../config"); | |
describe("webdriverio spec", function() { | |
beforeEach(function() { | |
this.webdriver = webdriverio.remote({ | |
desiredCapabilities: config.capabilities, | |
host: config.seleniumHost | |
}); | |
this.setQuery = (query) => { | |
return this.webdriver.setValue('.search__input', query); | |
}); | |
return this.webdriver.init().url(config.testHost); | |
}); | |
it("should open page", function() { | |
return webdriver.waitForVisible('.search__input'); | |
}); | |
it("should show suggest", function() { | |
return this.setQuery("an elephant").waitForVisible(mainPage.suggest.selector, 3000); | |
}); | |
it("should open search result page", function() { | |
return setQuery("allure-framework").click('.search__submit') | |
.waitUntil(function() { | |
return this.getTitle().then(function(title) { | |
return title.indexOf("an elephant") === 0; | |
}); | |
}, 3000); | |
}); | |
afterEach(function() { | |
return this.webdriver.end(); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment