I have two identical javascript test (Jest) scripts.
const webdriverio = require("webdriverio");
const capabilities = {
platformName: 'Android',
automationName: 'UiAutomator2',
deviceName: "Pixel_5_API_33",
app: "/app/android/app/build/outputs/apk/debug/app-arm64-v8a-debug.apk",
appPackage: "<secret>",
appActivity: "<secret>",
};
const serverConfig = {
path: '/wd/hub',
host: 'localhost',
port: 4723,
};
const androidOptions = { capabilities, ...serverConfig }
describe('Create Android session', function () {
let client;
beforeAll(async function () {
client = await webdriverio.remote(androidOptions);
console.log("CLIENT?", client)
}, 60000);
it('should create and destroy a session', async function () {
const res = await client.status();
expect(res.build).not.toBe(null);
const current_package = await client.getCurrentPackage();
expect(current_package).toBe('nl.mywheels.app');
const delete_session = await client.deleteSession();
expect(delete_session).toBe(null);
});
});
One running in an isolated npm project (bare minimum) and it works flawlessly.
But - the same identical test in my company repo does not. It seems
webdriverio.remote(withIdenticalAndroidOptions)
does not resolve and the test times out.
Both tests talk to the same Appium server (appium@next)
In Appium it never goes beyond:
[HTTP] <-- POST /wd/hub/session 200 4187 ms - 1175
[HTTP]
What could be going on here?