jesse-r-s-hines_obsidian-op.../wdio.mobile.conf.mts

69 lines
1.9 KiB
TypeScript
Raw Normal View History

2025-07-26 17:18:20 +00:00
import * as path from "path"
2025-08-03 18:21:26 +00:00
import { parseObsidianVersions } from "wdio-obsidian-service";
import { env } from "process";
2025-07-26 17:18:20 +00:00
2025-08-03 18:21:26 +00:00
const cacheDir = path.resolve(".obsidian-cache");
// choose Obsidian versions to test
// note: beta versions aren't available for the Android app
let defaultVersions = "earliest/earliest latest/latest";
const versions = await parseObsidianVersions(
env.OBSIDIAN_MOBILE_VERSIONS ?? env.OBSIDIAN_VERSIONS ?? defaultVersions,
{cacheDir},
);
if (env.CI) {
console.log("obsidian-cache-key:", JSON.stringify(versions));
2025-07-26 17:18:20 +00:00
}
export const config: WebdriverIO.Config = {
runner: 'local',
framework: 'mocha',
2025-08-03 18:21:26 +00:00
2025-07-26 17:18:20 +00:00
specs: ['./test/specs/**/*.e2e.ts'],
2025-08-03 18:21:26 +00:00
maxInstances: 1, // Parallel tests don't work under appium
hostname: env.APPIUM_HOST || 'localhost',
port: parseInt(env.APPIUM_PORT || "4723"),
2025-07-26 17:18:20 +00:00
2025-08-03 18:21:26 +00:00
// (installerVersion isn't relevant for the mobile app)
capabilities: versions.map<WebdriverIO.Capabilities>(([appVersion]) => ({
2025-07-26 17:18:20 +00:00
browserName: "obsidian",
platformName: 'Android',
'appium:automationName': 'UiAutomator2',
'appium:avd': "obsidian_test",
'appium:enforceAppInstall': true,
'appium:adbExecTimeout': 60 * 1000,
'wdio:obsidianOptions': {
2025-08-03 18:21:26 +00:00
appVersion: appVersion,
2025-07-26 17:18:20 +00:00
plugins: [
".",
{id: "obsidian-excalidraw-plugin", enabled: false},
{id: "home-tab", enabled: false},
{id: "obsidian-kanban", enabled: false},
],
vault: "./test/vault",
},
})),
services: [
"obsidian",
["appium", {
args: { allowInsecure: "*:chromedriver_autodownload,*:adb_shell" },
2025-07-26 17:18:20 +00:00
}],
],
reporters: ["obsidian"],
bail: 2,
mochaOpts: {
ui: 'bdd',
2025-08-03 18:21:26 +00:00
timeout: 60 * 1000,
2025-07-26 17:18:20 +00:00
retries: 4,
bail: true,
},
waitforInterval: 250,
waitforTimeout: 5 * 1000,
logLevel: "warn",
2025-08-03 18:21:26 +00:00
cacheDir: cacheDir,
2025-07-26 17:18:20 +00:00
}