mirror of
https://github.com/tinyhumansai/openhuman.git
synced 2026-07-28 13:32:23 +00:00
- Deleted obsolete .mcp.json file. - Updated ESLint and test configurations to reflect new file paths. - Changed title and branding in index.html and README.md to OpenHuman. - Adjusted package.json scripts for testing with new configuration files. - Modified E2E test scripts to use updated WebDriverIO configuration paths. - Added new TypeScript configuration files for E2E testing and Vitest.
61 lines
1.9 KiB
TypeScript
61 lines
1.9 KiB
TypeScript
import type { Options } from '@wdio/types';
|
|
import path from 'path';
|
|
import { fileURLToPath } from 'url';
|
|
|
|
const configDir = path.dirname(fileURLToPath(import.meta.url));
|
|
const projectRoot = path.resolve(configDir, '..');
|
|
const tsconfigE2ePath = path.join(projectRoot, 'test', 'tsconfig.e2e.json');
|
|
|
|
/**
|
|
* Resolve the path to the built Tauri application bundle.
|
|
*
|
|
* On macOS, Appium mac2 driver launches the .app via bundleId or app path.
|
|
* On Windows/Linux, tauri-driver would be used instead (not covered here).
|
|
*/
|
|
function getAppPath(): string {
|
|
const base = path.resolve('src-tauri/target/debug/bundle');
|
|
|
|
switch (process.platform) {
|
|
case 'darwin':
|
|
return path.join(base, 'macos', 'AlphaHuman.app');
|
|
case 'win32':
|
|
return path.join('src-tauri', 'target', 'debug', 'AlphaHuman.exe');
|
|
case 'linux':
|
|
return path.join('src-tauri', 'target', 'debug', 'alpha-human');
|
|
default:
|
|
throw new Error(`Unsupported platform: ${process.platform}`);
|
|
}
|
|
}
|
|
|
|
export const config: Options.Testrunner = {
|
|
runner: 'local',
|
|
hostname: '127.0.0.1',
|
|
port: 4723, // Appium default port
|
|
specs: ['./test/e2e/specs/**/*.spec.ts'],
|
|
maxInstances: 1, // Tauri apps are single-instance
|
|
capabilities: [
|
|
{
|
|
platformName: 'mac',
|
|
// @ts-expect-error -- Appium capabilities are not in standard WebDriver types
|
|
'appium:automationName': 'Mac2',
|
|
'appium:app': getAppPath(),
|
|
'appium:bundleId': 'com.alphahuman.app',
|
|
'appium:showServerLogs': true,
|
|
},
|
|
],
|
|
logLevel: 'warn',
|
|
bail: 0,
|
|
waitforTimeout: 10_000,
|
|
connectionRetryTimeout: 120_000,
|
|
connectionRetryCount: 3,
|
|
// No appium service — appium is started externally via scripts/start-appium.sh
|
|
// so we can control the Node version (appium v3 requires Node >=24).
|
|
framework: 'mocha',
|
|
reporters: ['spec'],
|
|
mochaOpts: {
|
|
ui: 'bdd',
|
|
timeout: 60_000, // App startup can be slow
|
|
},
|
|
autoCompileOpts: { tsNodeOpts: { project: tsconfigE2ePath } },
|
|
};
|