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
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@
"author": "Assert Equals Ltd",
"license": "MIT",
"dependencies": {
"@assert-equals/headless-wallet": "^0.0.16",
"adm-zip": "^0.5.16",
"axios": "^1.9.0",
"chalk": "^4.1.2",
Expand Down
1 change: 0 additions & 1 deletion src/constants/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ export const DEFAULT_METAMASK_BINARY_PATH: string = `${process.cwd()}/${NODE_MOD
export const DEFAULT_METAMASK_FLASK_BINARY_PATH: string = `${process.cwd()}/${NODE_MODULE_DIR}/${DEFAULT_METAMASK_FLASK_ASSET}-${DEFAULT_METAMASK_FLASK_VERSION}-flask.0`;
export const DEFAULT_RAINBOW_BINARY_PATH: string = `${process.cwd()}/${NODE_MODULE_DIR}/${DEFAULT_RAINBOW_ASSET}-v${DEFAULT_RAINBOW_VERSION}`;
export const DEFAULT_ZERION_BINARY_PATH: string = `${process.cwd()}/${NODE_MODULE_DIR}/${DEFAULT_ZERION_ASSET}-v${DEFAULT_ZERION_VERSION}`;
export const HEADLESS: Wallet = 'headless';
export const METAMASK: Wallet = 'metamask';
export const METAMASK_FLASK: Wallet = 'flask';
export const RAINBOW: Wallet = 'rainbow';
Expand Down
3 changes: 1 addition & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
export { DappDriver } from './session/dapp-driver';
export { MockServer } from './mock';
export { CheckBox, DropDown, HTMLElement, HTMLElementCollection, InputText, Link, Radio } from './controls';
export { METAMASK, METAMASK_FLASK, RAINBOW, ZERION, HEADLESS, PLAYWRIGHT, WEBDRIVER, CHROME } from './constants';
export { METAMASK, METAMASK_FLASK, RAINBOW, ZERION, PLAYWRIGHT, WEBDRIVER, CHROME } from './constants';
export { PageObject } from './page';
export * from './types';
export { HeadlessWalletServer } from '@assert-equals/headless-wallet';
4 changes: 2 additions & 2 deletions src/playwright/playwright-factory.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import playwright, { BrowserContext } from 'playwright-core';
import { CHROME, HEADLESS, HTTPS_PROXY_HOST } from '../constants';
import { CHROME, HTTPS_PROXY_HOST } from '../constants';
import { logInfo } from '../log';
import { Browser, BrowserOptions } from '../types';

Expand All @@ -23,7 +23,7 @@ export class PlaywrightFactory {
server: HTTPS_PROXY_HOST
};
}
if (options.extension.wallet !== null && options.extension.wallet !== HEADLESS) {
if (options.extension.wallet !== null) {
process.env.PW_CHROMIUM_ATTACH_TO_OTHER = '1';
const extensionPath: string = options.extension.path;
logInfo(`Loading extension from path: ${extensionPath}`);
Expand Down
22 changes: 1 addition & 21 deletions src/session/dapp-driver.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
import { setupHeadlessWallet } from '@assert-equals/headless-wallet';
import { BrowserContext } from 'playwright-core';
import { WebDriver } from 'selenium-webdriver';
import {
HEADLESS,
METAMASK,
METAMASK_FLASK,
NODE_MODULE_DIR,
PLAYWRIGHT,
RAINBOW,
WEBDRIVER,
ZERION
} from '../constants';
import { METAMASK, METAMASK_FLASK, NODE_MODULE_DIR, PLAYWRIGHT, RAINBOW, WEBDRIVER, ZERION } from '../constants';
import { IWallet } from '../interface/extension/wallet';
import { PageObject } from '../page';
import { PlaywrightFactory } from '../playwright/playwright-factory';
Expand Down Expand Up @@ -283,16 +273,6 @@ export class DappDriver {
DappDriver.Instance.Wallet = options.extension.wallet;
await DappDriver.Instance.Extension.setup(options.extension.seed);
break;
case HEADLESS:
DappDriver.Instance.Wallet = HEADLESS;
if (DappDriver.Instance.Framework === PLAYWRIGHT) {
const page = DappDriver.Instance.Page as Page;
await setupHeadlessWallet({ page, port: options.extension.port });
} else if (DappDriver.Instance.Framework === WEBDRIVER) {
const driver = DappDriver.Instance.Driver as WebDriver;
await setupHeadlessWallet({ driver });
}
break;
}
} catch (error) {
await this.dispose();
Expand Down
2 changes: 1 addition & 1 deletion src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export type Frame = FrameLocator | null;
export type Driver = WebDriver | BrowserContext;
export type Framework = 'playwright' | 'webdriver';
export type Browser = 'chrome';
export type Wallet = 'metamask' | 'flask' | 'rainbow' | 'zerion' | 'headless';
export type Wallet = 'metamask' | 'flask' | 'rainbow' | 'zerion';

export type Artifact = {
archive_download_url: string;
Expand Down
7 changes: 2 additions & 5 deletions src/webdriver/webdriver-factory.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Builder, WebDriver } from 'selenium-webdriver';
import { Options as ChromeOptions } from 'selenium-webdriver/chrome';
import { CHROME, HEADLESS, HTTPS_PROXY_HOST } from '../constants';
import { CHROME, HTTPS_PROXY_HOST } from '../constants';
import { logInfo } from '../log';
import { Browser, BrowserOptions } from '../types';

Expand All @@ -19,14 +19,11 @@ export class WebDriverFactory {
args.push(`--proxy-server=${HTTPS_PROXY_HOST}`);
chromeOptions.setAcceptInsecureCerts(true);
}
if (options.extension.wallet !== null && options.extension.wallet !== HEADLESS) {
if (options.extension.wallet !== null) {
const extensionPath: string = options.extension.path;
logInfo(`Loading extension from path: ${extensionPath}`);
args.push(`--load-extension=${extensionPath}`);
}
if (options.extension.wallet === HEADLESS) {
chromeOptions.enableBidi();
}
args.push(`--window-size=1024,768`);
chromeOptions.addArguments(...args);
chromeOptions.setBrowserVersion('135.0.7049.114');
Expand Down
5 changes: 0 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@
css-tree "^2.3.1"
is-potential-custom-element-name "^1.0.1"

"@assert-equals/headless-wallet@^0.0.16":
version "0.0.16"
resolved "https://registry.yarnpkg.com/@assert-equals/headless-wallet/-/headless-wallet-0.0.16.tgz#3a568a9c0e3323ff7fe8ad3ffc439c157d191bbc"
integrity sha512-EUJY9o+wNtbKQFtWzZpgJ5kzDievnxvjDM0lJD1OEvtOWN0VJ7mpgfJtIN0gpLLaW6wcYsI+rbNJfcRdeJE6NA==

"@babel/code-frame@^7.0.0":
version "7.24.2"
resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.24.2.tgz#718b4b19841809a58b29b68cde80bc5e1aa6d9ae"
Expand Down
Loading