mirror of
https://github.com/appium/appium.git
synced 2026-02-12 12:59:38 -06:00
28 lines
726 B
JavaScript
28 lines
726 B
JavaScript
import path from 'path';
|
|
import wd from 'wd';
|
|
import B from 'bluebird';
|
|
|
|
const TEST_HOST = 'localhost';
|
|
const TEST_PORT = 4723;
|
|
const TEST_FAKE_APP = path.resolve(__dirname, "..", "..", "node_modules",
|
|
"appium-fake-driver", "test", "fixtures",
|
|
"app.xml");
|
|
|
|
function initSession (caps) {
|
|
let resolve = () => {};
|
|
let driver;
|
|
before(async () => {
|
|
driver = wd.promiseChainRemote({host: TEST_HOST, port: TEST_PORT});
|
|
resolve(driver);
|
|
await driver.init(caps);
|
|
});
|
|
after(async () => {
|
|
await driver.quit();
|
|
});
|
|
return new B((_resolve) => {
|
|
resolve = _resolve;
|
|
});
|
|
}
|
|
|
|
export { initSession, TEST_FAKE_APP, TEST_HOST, TEST_PORT };
|