w3wallets 0.8.3 → 0.8.4

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.js CHANGED
@@ -221,6 +221,7 @@ var Metamask = class extends Wallet {
221
221
  await this.page.getByTestId("terms-of-use-checkbox").click();
222
222
  await this.page.getByTestId("terms-of-use-agree-button").click();
223
223
  await this.page.getByTestId("onboarding-import-wallet").click();
224
+ await this.page.getByTestId("onboarding-import-with-srp-button").click();
224
225
  await this.page.getByTestId("srp-input-import__srp-note").pressSequentially(mnemonic);
225
226
  await this.page.getByTestId("import-srp-confirm").click();
226
227
  await this.page.getByTestId("create-password-new-input").fill(password);
@@ -265,7 +266,8 @@ var Metamask = class extends Wallet {
265
266
  }
266
267
  async connectToNetwork(settingsOrName) {
267
268
  if (typeof settingsOrName !== "string") {
268
- await this.page.locator(".mm-picker-network").click();
269
+ await this.page.getByTestId("account-options-menu-button").click();
270
+ await this.page.getByTestId("global-menu-networks").click();
269
271
  await this.page.getByRole("button", { name: "Add a custom network" }).click();
270
272
  await this.page.getByTestId("network-form-network-name").fill(settingsOrName.name);
271
273
  await this.page.getByTestId("network-form-chain-id").fill(settingsOrName.chainId.toString());
@@ -275,12 +277,19 @@ var Metamask = class extends Wallet {
275
277
  await this.page.getByTestId("rpc-url-input-test").fill(settingsOrName.rpc);
276
278
  await this.page.getByRole("button", { name: "Add URL" }).click();
277
279
  await this.page.getByRole("button", { name: "Save" }).click();
280
+ } else {
281
+ await this.page.getByTestId("sort-by-networks").click();
282
+ await this.page.getByRole("button", { name: "Default" }).click();
283
+ const additionalNetwork = this.page.getByTestId("additional-network-item").getByText(settingsOrName);
284
+ try {
285
+ await additionalNetwork.isEnabled({ timeout: 1e3 });
286
+ await additionalNetwork.click();
287
+ await this.page.getByTestId("confirmation-submit-button").click();
288
+ } catch (error) {
289
+ await this.page.getByText(settingsOrName).click();
290
+ await this.page.getByTestId("modal-header-close-button").click();
291
+ }
278
292
  }
279
- await this.page.locator(".mm-picker-network").click();
280
- await this.page.locator("text=Show test networks >> xpath=following-sibling::label").click();
281
- await this.page.getByTestId(
282
- typeof settingsOrName === "string" ? settingsOrName : settingsOrName.name
283
- ).click();
284
293
  }
285
294
  async approve() {
286
295
  const p = await this.page.context().newPage();
package/dist/index.mjs CHANGED
@@ -187,6 +187,7 @@ var Metamask = class extends Wallet {
187
187
  await this.page.getByTestId("terms-of-use-checkbox").click();
188
188
  await this.page.getByTestId("terms-of-use-agree-button").click();
189
189
  await this.page.getByTestId("onboarding-import-wallet").click();
190
+ await this.page.getByTestId("onboarding-import-with-srp-button").click();
190
191
  await this.page.getByTestId("srp-input-import__srp-note").pressSequentially(mnemonic);
191
192
  await this.page.getByTestId("import-srp-confirm").click();
192
193
  await this.page.getByTestId("create-password-new-input").fill(password);
@@ -231,7 +232,8 @@ var Metamask = class extends Wallet {
231
232
  }
232
233
  async connectToNetwork(settingsOrName) {
233
234
  if (typeof settingsOrName !== "string") {
234
- await this.page.locator(".mm-picker-network").click();
235
+ await this.page.getByTestId("account-options-menu-button").click();
236
+ await this.page.getByTestId("global-menu-networks").click();
235
237
  await this.page.getByRole("button", { name: "Add a custom network" }).click();
236
238
  await this.page.getByTestId("network-form-network-name").fill(settingsOrName.name);
237
239
  await this.page.getByTestId("network-form-chain-id").fill(settingsOrName.chainId.toString());
@@ -241,12 +243,19 @@ var Metamask = class extends Wallet {
241
243
  await this.page.getByTestId("rpc-url-input-test").fill(settingsOrName.rpc);
242
244
  await this.page.getByRole("button", { name: "Add URL" }).click();
243
245
  await this.page.getByRole("button", { name: "Save" }).click();
246
+ } else {
247
+ await this.page.getByTestId("sort-by-networks").click();
248
+ await this.page.getByRole("button", { name: "Default" }).click();
249
+ const additionalNetwork = this.page.getByTestId("additional-network-item").getByText(settingsOrName);
250
+ try {
251
+ await additionalNetwork.isEnabled({ timeout: 1e3 });
252
+ await additionalNetwork.click();
253
+ await this.page.getByTestId("confirmation-submit-button").click();
254
+ } catch (error) {
255
+ await this.page.getByText(settingsOrName).click();
256
+ await this.page.getByTestId("modal-header-close-button").click();
257
+ }
244
258
  }
245
- await this.page.locator(".mm-picker-network").click();
246
- await this.page.locator("text=Show test networks >> xpath=following-sibling::label").click();
247
- await this.page.getByTestId(
248
- typeof settingsOrName === "string" ? settingsOrName : settingsOrName.name
249
- ).click();
250
259
  }
251
260
  async approve() {
252
261
  const p = await this.page.context().newPage();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "w3wallets",
3
3
  "description": "browser wallets for playwright",
4
- "version": "0.8.3",
4
+ "version": "0.8.4",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "homepage": "https://github.com/Maksandre/w3wallets",