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

@@ -1,29 +1,23 @@
const webdriverio = require("webdriverio");
const androidOptions = require("../../helpers/caps").androidWebOptions;
const app = require("../../helpers/apps").androidApiDemos;
const assert = require("chai").assert;
describe("Create Chrome web session", function() {
let client;
before(function() {
client = webdriverio.remote(androidOptions);
return client.init();
before(async function() {
client = await webdriverio.remote(androidOptions);
});
after(function() {
return client.end();
after(async function() {
return await client.deleteSession();
});
it("should create and destroy Android browser session", async function() {
// Navigate to google.com
return client
.url("https://www.google.com")
.title(function(res) {
assert.equal(res.value, "Google");
})
.source(function(res) {
assert.match(/<html/g);
});
let client = await webdriverio.remote(iosOptions);
await client.url("https://www.google.com");
const title = await client.getTitle();
assert.equal(title, "Google");
});
});