update WDIO test to v5 (#11919)

* update WDIO test to v5

* fix review
This commit is contained in:
Sai Krishna
2019-01-02 17:57:39 +00:00
committed by Dan Graham
parent 4a4f1cf20e
commit 4df45addc3
8 changed files with 69 additions and 108 deletions

View File

@@ -3,30 +3,21 @@ const androidOptions = require("../../helpers/caps").androidOptions;
const app = require("../../helpers/apps").androidApiDemos;
const assert = require("chai").assert;
androidOptions.desiredCapabilities.app = app;
androidOptions.capabilities.app = app;
describe("Create Android session", function() {
let client;
before(function() {
client = webdriverio.remote(androidOptions);
return client.init();
before(async() => {
client = await webdriverio.remote(androidOptions);
});
it("should create and destroy a session", function() {
return client
.sessions(function(res) {
assert.isAbove(res.value.length, 0);
})
.currentActivity(function(res) {
assert.equals(res.value, ".ApiDemos");
})
.getCurrentPackage(function(res) {
assert.equals(res.value, "io.appium.android.apis");
})
.end()
.sessions(function(res) {
assert.equals(res.value.length, 0);
});
it("should create and destroy a session", async function() {
const res = await client.status();
assert.isObject(res.build);
const current_package = await client.getCurrentPackage();
assert.equal(current_package, "io.appium.android.apis");
const delete_session = await client.deleteSession();
assert.isNull(delete_session);
});
});