Skip to content

Commit fb5b00d

Browse files
authored
feat: remove @assert-equals/headless-wallet integration (#7)
1 parent cef28c6 commit fb5b00d

8 files changed

Lines changed: 7 additions & 38 deletions

File tree

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@
7979
"author": "Assert Equals Ltd",
8080
"license": "MIT",
8181
"dependencies": {
82-
"@assert-equals/headless-wallet": "^0.0.16",
8382
"adm-zip": "^0.5.16",
8483
"axios": "^1.9.0",
8584
"chalk": "^4.1.2",

src/constants/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ export const DEFAULT_METAMASK_BINARY_PATH: string = `${process.cwd()}/${NODE_MOD
2424
export const DEFAULT_METAMASK_FLASK_BINARY_PATH: string = `${process.cwd()}/${NODE_MODULE_DIR}/${DEFAULT_METAMASK_FLASK_ASSET}-${DEFAULT_METAMASK_FLASK_VERSION}-flask.0`;
2525
export const DEFAULT_RAINBOW_BINARY_PATH: string = `${process.cwd()}/${NODE_MODULE_DIR}/${DEFAULT_RAINBOW_ASSET}-v${DEFAULT_RAINBOW_VERSION}`;
2626
export const DEFAULT_ZERION_BINARY_PATH: string = `${process.cwd()}/${NODE_MODULE_DIR}/${DEFAULT_ZERION_ASSET}-v${DEFAULT_ZERION_VERSION}`;
27-
export const HEADLESS: Wallet = 'headless';
2827
export const METAMASK: Wallet = 'metamask';
2928
export const METAMASK_FLASK: Wallet = 'flask';
3029
export const RAINBOW: Wallet = 'rainbow';

src/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
export { DappDriver } from './session/dapp-driver';
22
export { MockServer } from './mock';
33
export { CheckBox, DropDown, HTMLElement, HTMLElementCollection, InputText, Link, Radio } from './controls';
4-
export { METAMASK, METAMASK_FLASK, RAINBOW, ZERION, HEADLESS, PLAYWRIGHT, WEBDRIVER, CHROME } from './constants';
4+
export { METAMASK, METAMASK_FLASK, RAINBOW, ZERION, PLAYWRIGHT, WEBDRIVER, CHROME } from './constants';
55
export { PageObject } from './page';
66
export * from './types';
7-
export { HeadlessWalletServer } from '@assert-equals/headless-wallet';

src/playwright/playwright-factory.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import playwright, { BrowserContext } from 'playwright-core';
2-
import { CHROME, HEADLESS, HTTPS_PROXY_HOST } from '../constants';
2+
import { CHROME, HTTPS_PROXY_HOST } from '../constants';
33
import { logInfo } from '../log';
44
import { Browser, BrowserOptions } from '../types';
55

@@ -23,7 +23,7 @@ export class PlaywrightFactory {
2323
server: HTTPS_PROXY_HOST
2424
};
2525
}
26-
if (options.extension.wallet !== null && options.extension.wallet !== HEADLESS) {
26+
if (options.extension.wallet !== null) {
2727
process.env.PW_CHROMIUM_ATTACH_TO_OTHER = '1';
2828
const extensionPath: string = options.extension.path;
2929
logInfo(`Loading extension from path: ${extensionPath}`);

src/session/dapp-driver.ts

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,6 @@
1-
import { setupHeadlessWallet } from '@assert-equals/headless-wallet';
21
import { BrowserContext } from 'playwright-core';
32
import { WebDriver } from 'selenium-webdriver';
4-
import {
5-
HEADLESS,
6-
METAMASK,
7-
METAMASK_FLASK,
8-
NODE_MODULE_DIR,
9-
PLAYWRIGHT,
10-
RAINBOW,
11-
WEBDRIVER,
12-
ZERION
13-
} from '../constants';
3+
import { METAMASK, METAMASK_FLASK, NODE_MODULE_DIR, PLAYWRIGHT, RAINBOW, WEBDRIVER, ZERION } from '../constants';
144
import { IWallet } from '../interface/extension/wallet';
155
import { PageObject } from '../page';
166
import { PlaywrightFactory } from '../playwright/playwright-factory';
@@ -283,16 +273,6 @@ export class DappDriver {
283273
DappDriver.Instance.Wallet = options.extension.wallet;
284274
await DappDriver.Instance.Extension.setup(options.extension.seed);
285275
break;
286-
case HEADLESS:
287-
DappDriver.Instance.Wallet = HEADLESS;
288-
if (DappDriver.Instance.Framework === PLAYWRIGHT) {
289-
const page = DappDriver.Instance.Page as Page;
290-
await setupHeadlessWallet({ page, port: options.extension.port });
291-
} else if (DappDriver.Instance.Framework === WEBDRIVER) {
292-
const driver = DappDriver.Instance.Driver as WebDriver;
293-
await setupHeadlessWallet({ driver });
294-
}
295-
break;
296276
}
297277
} catch (error) {
298278
await this.dispose();

src/types/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export type Frame = FrameLocator | null;
66
export type Driver = WebDriver | BrowserContext;
77
export type Framework = 'playwright' | 'webdriver';
88
export type Browser = 'chrome';
9-
export type Wallet = 'metamask' | 'flask' | 'rainbow' | 'zerion' | 'headless';
9+
export type Wallet = 'metamask' | 'flask' | 'rainbow' | 'zerion';
1010

1111
export type Artifact = {
1212
archive_download_url: string;

src/webdriver/webdriver-factory.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Builder, WebDriver } from 'selenium-webdriver';
22
import { Options as ChromeOptions } from 'selenium-webdriver/chrome';
3-
import { CHROME, HEADLESS, HTTPS_PROXY_HOST } from '../constants';
3+
import { CHROME, HTTPS_PROXY_HOST } from '../constants';
44
import { logInfo } from '../log';
55
import { Browser, BrowserOptions } from '../types';
66

@@ -19,14 +19,11 @@ export class WebDriverFactory {
1919
args.push(`--proxy-server=${HTTPS_PROXY_HOST}`);
2020
chromeOptions.setAcceptInsecureCerts(true);
2121
}
22-
if (options.extension.wallet !== null && options.extension.wallet !== HEADLESS) {
22+
if (options.extension.wallet !== null) {
2323
const extensionPath: string = options.extension.path;
2424
logInfo(`Loading extension from path: ${extensionPath}`);
2525
args.push(`--load-extension=${extensionPath}`);
2626
}
27-
if (options.extension.wallet === HEADLESS) {
28-
chromeOptions.enableBidi();
29-
}
3027
args.push(`--window-size=1024,768`);
3128
chromeOptions.addArguments(...args);
3229
chromeOptions.setBrowserVersion('135.0.7049.114');

yarn.lock

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,6 @@
1616
css-tree "^2.3.1"
1717
is-potential-custom-element-name "^1.0.1"
1818

19-
"@assert-equals/headless-wallet@^0.0.16":
20-
version "0.0.16"
21-
resolved "https://registry.yarnpkg.com/@assert-equals/headless-wallet/-/headless-wallet-0.0.16.tgz#3a568a9c0e3323ff7fe8ad3ffc439c157d191bbc"
22-
integrity sha512-EUJY9o+wNtbKQFtWzZpgJ5kzDievnxvjDM0lJD1OEvtOWN0VJ7mpgfJtIN0gpLLaW6wcYsI+rbNJfcRdeJE6NA==
23-
2419
"@babel/code-frame@^7.0.0":
2520
version "7.24.2"
2621
resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.24.2.tgz#718b4b19841809a58b29b68cde80bc5e1aa6d9ae"

0 commit comments

Comments
 (0)