mirror of
https://github.com/appium/appium.git
synced 2026-01-20 00:59:50 -06:00
@@ -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);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user