mirror of
https://github.com/appium/appium.git
synced 2026-02-09 19:28:48 -06:00
node sample fix
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
#Node.js samples
|
||||
|
||||
## prerequisites
|
||||
|
||||
Upgrade Mocha to the latest version before running the tests.
|
||||
|
||||
##iOS
|
||||
|
||||
### local
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
The appium specific methods are not yet implemented by selenium-webdriver.
|
||||
However it is possible to attach an existing selenium-webdriver to a wd
|
||||
browser instance as below.
|
||||
However it is possible to attach an existing selenium-webdriver session to
|
||||
a wd browser instance as below.
|
||||
|
||||
prerequisite:
|
||||
npm install selenium-webdriver
|
||||
|
||||
@@ -11,7 +11,7 @@ describe("selendroid simple", function () {
|
||||
var driver;
|
||||
var allPassed = true;
|
||||
|
||||
before(function (done) {
|
||||
before(function () {
|
||||
var serverConfig = process.env.SAUCE ?
|
||||
serverConfigs.sauce : serverConfigs.local;
|
||||
driver = wd.promiseChainRemote(serverConfig);
|
||||
@@ -23,33 +23,31 @@ describe("selendroid simple", function () {
|
||||
desired.name = 'selendroid - simple';
|
||||
desired.tags = ['sample'];
|
||||
}
|
||||
driver
|
||||
return driver
|
||||
.init(desired)
|
||||
.setImplicitWaitTimeout(3000)
|
||||
.nodeify(done);
|
||||
.setImplicitWaitTimeout(3000);
|
||||
});
|
||||
|
||||
after(function (done) {
|
||||
driver
|
||||
after(function () {
|
||||
return driver
|
||||
.quit()
|
||||
.finally(function () {
|
||||
if (process.env.SAUCE) {
|
||||
return driver.sauceJobStatus(allPassed);
|
||||
}
|
||||
})
|
||||
.nodeify(done);
|
||||
});
|
||||
});
|
||||
|
||||
afterEach(function () {
|
||||
allPassed = allPassed && this.currentTest.state === 'passed';
|
||||
});
|
||||
|
||||
it("should find elements", function (done) {
|
||||
it("should find elements", function () {
|
||||
return driver
|
||||
.waitForElementByName('Animation')
|
||||
.text().should.become('Animation')
|
||||
.elementByClassName('android.widget.TextView')
|
||||
.text().should.become('Accessibility')
|
||||
.text().should.eventually.match(/Accessibility|API Demos/)
|
||||
.elementByName('App').click()
|
||||
.waitForElementByXPath('//TextView[@name=\'Action Bar\']')
|
||||
.elementsByClassName('android.widget.TextView')
|
||||
@@ -57,7 +55,6 @@ describe("selendroid simple", function () {
|
||||
.back()
|
||||
.sleep(3000)
|
||||
.waitForElementByName('Animation', 5000, 500)
|
||||
.text().should.become('Animation')
|
||||
.nodeify(done);
|
||||
.text().should.become('Animation');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user