w3wallets 0.9.3 → 0.9.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -76,7 +76,7 @@ declare class Metamask extends Wallet {
76
76
  importAccount(privateKey: string): Promise<void>;
77
77
  addAccount(accountName?: string): Promise<void>;
78
78
  getAccountName(): Promise<string>;
79
- connectToNetwork(networkName: string, networkType?: "Default" | "Custom"): Promise<void>;
79
+ connectToNetwork(networkName: string, networkType?: "Popular" | "Custom"): Promise<void>;
80
80
  addCustomNetwork(settings: NetworkSettings): Promise<void>;
81
81
  enableTestNetworks(): Promise<void>;
82
82
  approve(): Promise<void>;
package/dist/index.d.ts CHANGED
@@ -76,7 +76,7 @@ declare class Metamask extends Wallet {
76
76
  importAccount(privateKey: string): Promise<void>;
77
77
  addAccount(accountName?: string): Promise<void>;
78
78
  getAccountName(): Promise<string>;
79
- connectToNetwork(networkName: string, networkType?: "Default" | "Custom"): Promise<void>;
79
+ connectToNetwork(networkName: string, networkType?: "Popular" | "Custom"): Promise<void>;
80
80
  addCustomNetwork(settings: NetworkSettings): Promise<void>;
81
81
  enableTestNetworks(): Promise<void>;
82
82
  approve(): Promise<void>;
package/dist/index.js CHANGED
@@ -136,7 +136,7 @@ var Backpack = class extends Wallet {
136
136
  await (0, import_test.expect)(this.page.getByText("You're all good!")).toBeVisible();
137
137
  }
138
138
  await this.page.goto(`chrome-extension://${this.extensionId}/popup.html`);
139
- await this.page.getByTestId("AccountBalanceRoundedIcon").waitFor({ state: "visible" });
139
+ await this.page.getByTestId("__CAROUSEL_ITEM_0__").waitFor({ state: "visible" });
140
140
  }
141
141
  };
142
142
 
@@ -216,10 +216,6 @@ var Metamask = class extends Wallet {
216
216
  * @param mnemonic 12-word mnemonic seed phrase
217
217
  */
218
218
  async onboard(mnemonic, password = this.defaultPassword) {
219
- await this.page.getByTestId("onboarding-get-started-button").click();
220
- await this.page.getByTestId("terms-of-use-scroll-button").click();
221
- await this.page.getByTestId("terms-of-use-checkbox").click();
222
- await this.page.getByTestId("terms-of-use-agree-button").click();
223
219
  await this.page.getByTestId("onboarding-import-wallet").click();
224
220
  await this.page.getByTestId("onboarding-import-with-srp-button").click();
225
221
  await this.page.getByTestId("srp-input-import__srp-note").pressSequentially(mnemonic);
@@ -230,7 +226,9 @@ var Metamask = class extends Wallet {
230
226
  await this.page.getByTestId("create-password-submit").click();
231
227
  await this.page.getByTestId("metametrics-no-thanks").click();
232
228
  await this.page.getByTestId("onboarding-complete-done").click();
229
+ await this.page.getByTestId("download-app-continue").click();
233
230
  await this.page.getByTestId("pin-extension-done").click();
231
+ await this.clickTopRightCornerToCloseAllTheMarketingBullshit();
234
232
  }
235
233
  async switchAccount(accountNameOrAddress) {
236
234
  await this.page.getByTestId("account-menu-icon").click();
@@ -263,7 +261,7 @@ var Metamask = class extends Wallet {
263
261
  if (!text) throw Error("Cannot get account name");
264
262
  return text;
265
263
  }
266
- async connectToNetwork(networkName, networkType = "Default") {
264
+ async connectToNetwork(networkName, networkType = "Popular") {
267
265
  await this.page.getByTestId("sort-by-networks").click();
268
266
  await this.page.getByRole("button", { name: networkType, exact: true }).click();
269
267
  const additionalNetwork = this.page.getByTestId("additional-network-item").getByText(networkName);
@@ -273,7 +271,6 @@ var Metamask = class extends Wallet {
273
271
  await this.page.getByTestId("confirmation-submit-button").click();
274
272
  } catch (error) {
275
273
  await this.page.getByText(networkName).click();
276
- await this.page.getByTestId("modal-header-close-button").click();
277
274
  }
278
275
  }
279
276
  async addCustomNetwork(settings) {
@@ -318,6 +315,8 @@ var Metamask = class extends Wallet {
318
315
  await p.close();
319
316
  }
320
317
  async clickTopRightCornerToCloseAllTheMarketingBullshit() {
318
+ await this.page.waitForTimeout(500);
319
+ await this.page.keyboard.press("Escape");
321
320
  await this.page.mouse.click(1e3, 10);
322
321
  }
323
322
  };
package/dist/index.mjs CHANGED
@@ -102,7 +102,7 @@ var Backpack = class extends Wallet {
102
102
  await expect(this.page.getByText("You're all good!")).toBeVisible();
103
103
  }
104
104
  await this.page.goto(`chrome-extension://${this.extensionId}/popup.html`);
105
- await this.page.getByTestId("AccountBalanceRoundedIcon").waitFor({ state: "visible" });
105
+ await this.page.getByTestId("__CAROUSEL_ITEM_0__").waitFor({ state: "visible" });
106
106
  }
107
107
  };
108
108
 
@@ -182,10 +182,6 @@ var Metamask = class extends Wallet {
182
182
  * @param mnemonic 12-word mnemonic seed phrase
183
183
  */
184
184
  async onboard(mnemonic, password = this.defaultPassword) {
185
- await this.page.getByTestId("onboarding-get-started-button").click();
186
- await this.page.getByTestId("terms-of-use-scroll-button").click();
187
- await this.page.getByTestId("terms-of-use-checkbox").click();
188
- await this.page.getByTestId("terms-of-use-agree-button").click();
189
185
  await this.page.getByTestId("onboarding-import-wallet").click();
190
186
  await this.page.getByTestId("onboarding-import-with-srp-button").click();
191
187
  await this.page.getByTestId("srp-input-import__srp-note").pressSequentially(mnemonic);
@@ -196,7 +192,9 @@ var Metamask = class extends Wallet {
196
192
  await this.page.getByTestId("create-password-submit").click();
197
193
  await this.page.getByTestId("metametrics-no-thanks").click();
198
194
  await this.page.getByTestId("onboarding-complete-done").click();
195
+ await this.page.getByTestId("download-app-continue").click();
199
196
  await this.page.getByTestId("pin-extension-done").click();
197
+ await this.clickTopRightCornerToCloseAllTheMarketingBullshit();
200
198
  }
201
199
  async switchAccount(accountNameOrAddress) {
202
200
  await this.page.getByTestId("account-menu-icon").click();
@@ -229,7 +227,7 @@ var Metamask = class extends Wallet {
229
227
  if (!text) throw Error("Cannot get account name");
230
228
  return text;
231
229
  }
232
- async connectToNetwork(networkName, networkType = "Default") {
230
+ async connectToNetwork(networkName, networkType = "Popular") {
233
231
  await this.page.getByTestId("sort-by-networks").click();
234
232
  await this.page.getByRole("button", { name: networkType, exact: true }).click();
235
233
  const additionalNetwork = this.page.getByTestId("additional-network-item").getByText(networkName);
@@ -239,7 +237,6 @@ var Metamask = class extends Wallet {
239
237
  await this.page.getByTestId("confirmation-submit-button").click();
240
238
  } catch (error) {
241
239
  await this.page.getByText(networkName).click();
242
- await this.page.getByTestId("modal-header-close-button").click();
243
240
  }
244
241
  }
245
242
  async addCustomNetwork(settings) {
@@ -284,6 +281,8 @@ var Metamask = class extends Wallet {
284
281
  await p.close();
285
282
  }
286
283
  async clickTopRightCornerToCloseAllTheMarketingBullshit() {
284
+ await this.page.waitForTimeout(500);
285
+ await this.page.keyboard.press("Escape");
287
286
  await this.page.mouse.click(1e3, 10);
288
287
  }
289
288
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "w3wallets",
3
3
  "description": "browser wallets for playwright",
4
- "version": "0.9.3",
4
+ "version": "0.9.5",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "homepage": "https://github.com/Maksandre/w3wallets",