Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ This is an Appium driver for automating Gecko-based browsers (such as Firefox) a
different platforms, including Android.

> [!IMPORTANT]
> Since major version *2.0.0*, this driver is only compatible with Appium 3.
> Since major version *4.0.0*, this driver is only compatible with Appium 4.


## Documentation
Expand Down
3 changes: 2 additions & 1 deletion docs/getting-started/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ and prerequisites of Appium itself can be found in [the Appium documentation](ht

| Geckodriver version | Supported Appium server version |
| --- | --- |
| >= 2.0.0 | Appium 3 |
| >= 4.0.0 | Appium 4 |
| 2.0.0 - 3.0.18 | Appium 3 |
| 1.0.0 - 1.4.4 | Appium 2 |

## Installation
Expand Down
6 changes: 6 additions & 0 deletions lib/commands/find.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ import {util} from 'appium/support.js';

import type {GeckoDriver} from '../driver.js';

declare module '../driver.js' {
interface GeckoDriver {
findElOrEls(...args: Parameters<typeof findElOrEls>): ReturnType<typeof findElOrEls>;
}
}

/**
* Find element(s) by given strategy and selector. If context is provided, search will be performed within the context element.
* This is needed to make lookup by image working.
Expand Down
14 changes: 6 additions & 8 deletions lib/driver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import type {
} from '@appium/types';
import {BaseDriver, errors} from 'appium/driver.js';

import * as findCommands from './commands/find.js';
import {findElOrEls} from './commands/find.js';
import {INSECURE_FEAT_CUSTOM_GECKODRIVER_EXECUTABLE} from './constants.js';
import {desiredCapConstraints} from './desired-caps.js';
import {GECKO_SERVER_HOST, GeckoDriverServer} from './gecko.js';
Expand All @@ -32,8 +32,6 @@ export class GeckoDriver

public proxyReqRes: (...args: any) => any = null as any;

findElOrEls = findCommands.findElOrEls;

private isProxyActive: boolean = false;
private _gecko: GeckoDriverServer | null = null;
private _bidiProxyUrl: string | null = null;
Expand Down Expand Up @@ -95,11 +93,9 @@ export class GeckoDriver
}

override async createSession(
w3cCaps1: W3CDriverCaps<GeckoConstraints>,
w3cCaps2?: W3CDriverCaps<GeckoConstraints>,
...args: any[]
w3cCapabilities: W3CDriverCaps<GeckoConstraints>,
): Promise<DefaultCreateSessionResult<GeckoConstraints>> {
const [sessionId, processedCaps] = await super.createSession(w3cCaps1, w3cCaps2, ...args);
const [sessionId, processedCaps] = await super.createSession(w3cCapabilities);
this._gecko = new GeckoDriverServer(this.log, processedCaps);
let response: StringRecord;
try {
Expand Down Expand Up @@ -150,4 +146,6 @@ export class GeckoDriver
}
}

export default GeckoDriver;
Object.assign(GeckoDriver.prototype, {
findElOrEls,
});
2 changes: 0 additions & 2 deletions lib/gecko.ts
Original file line number Diff line number Diff line change
Expand Up @@ -302,5 +302,3 @@ export class GeckoDriverServer {
}
}
}

export default GeckoDriverServer;
5 changes: 1 addition & 4 deletions lib/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
import {GeckoDriver} from './driver.js';

export default GeckoDriver;
export {GeckoDriver};
export {GeckoDriver} from './driver.js';
2 changes: 0 additions & 2 deletions lib/logger.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import {logger} from 'appium/support.js';

export const log = logger.getLogger('GeckoDriver');

export default log;
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,21 +69,21 @@
"teen_process": "^4.0.4"
},
"devDependencies": {
"@appium/docutils": "^3.0.0",
"@appium/oxc-config": "^1.1.0",
"@appium/semantic-release-config": "^1.1.0",
"@appium/tsconfig": "^1.2.0",
"@appium/types": "^1.0.0-rc.1",
"@appium/docutils": "^4.0.0-beta.5",
"@appium/oxc-config": "^2.0.0-beta.2",
"@appium/semantic-release-config": "^2.0.0-beta.1",
"@appium/tsconfig": "^2.0.0-beta.1",
"@appium/types": "^2.0.0-beta.5",
"@types/node": "^26.0.0",
"@types/portscanner": "^2.1.4",
"@types/tar-stream": "^3.1.4",
"webdriverio": "^9.0.5"
"webdriverio": "^10.1.0"
},
"peerDependencies": {
"appium": "^3.0.0-rc.2"
"appium": "^4.0.0-beta.6"
},
"engines": {
"node": "^20.19.0 || ^22.12.0 || >=24.0.0",
"node": "^22.22.2 || ^24.15.0 || >=26.0.0",
"npm": ">=10"
},
"appium": {
Expand Down
4 changes: 2 additions & 2 deletions scripts/install-geckodriver.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ class GeckodriverReleaseCatalog {
}
throw new Error(
`GeckoDriver v${release.version} does not contain any release matching the ` +
`current OS architecture ${process.arch}. Available packages: ${release.assets.map(({name}) => name)}`,
`current OS architecture ${process.arch}. Available packages: ${release.assets.map(({name}) => name).join(', ')}`,
);
}

Expand Down Expand Up @@ -421,7 +421,7 @@ NOTE:
await program.parseAsync(process.argv);
}

(async () => await main())();
await main();

/**
* @typedef {Object} ReleaseAsset
Expand Down
5 changes: 3 additions & 2 deletions test/functional/desktop-driver-e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ describe('Desktop Gecko Driver', {timeout: TEST_TIMEOUT}, () => {
await waitForCondition(
async () => {
try {
const element = await driver!.$('img[alt="logo"]');
return await element.isExisting();
// The page has more than one logo, which fails WDIO 10's strict `$`
const logos = await driver!.$$('img[alt="logo"]');
return logos.length > 0;
} catch {
return false;
}
Expand Down
Loading