w3wallets 0.8.1 → 0.8.3

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/README.md CHANGED
@@ -15,7 +15,7 @@ npm install -D w3wallets
15
15
 
16
16
  ## Getting Started
17
17
 
18
- The `Backpack` and the `Polkadot{.js}` wallets are currently supported.
18
+ `MetaMask`, `Backpack`, and `Polkadot{.js}` wallets are currently supported.
19
19
 
20
20
  <p align="center">
21
21
  <img src="https://images.ctfassets.net/clixtyxoaeas/1ezuBGezqfIeifWdVtwU4c/d970d4cdf13b163efddddd5709164d2e/MetaMask-icon-Fox.svg" alt="Metamask Logo" width="60"/>
@@ -31,9 +31,9 @@ npx w3wallets backpack polkadotJS
31
31
 
32
32
  The unzipped files should be stored in the `.w3wallets/<wallet-name>` directory. Add them to `.gitignore`.
33
33
 
34
- #### 2. Wrap your fixture `withWallets`
34
+ #### 2. Wrap your fixture with `withWallets`
35
35
 
36
- Install needed wallets into the chromium using `withWallets`.
36
+ Install the required wallets into Chromium using `withWallets`.
37
37
 
38
38
  ```ts
39
39
  // your-fixture.ts
@@ -57,7 +57,7 @@ export { expect } from "@playwright/test";
57
57
 
58
58
  #### 3. Use the installed wallets in tests
59
59
 
60
- Most often, you will use the following methods:
60
+ Most commonly, you will use the following methods:
61
61
 
62
62
  1. `onboard`: to set up your wallet
63
63
  2. `approve`: for operations that confirm actions
package/dist/index.js CHANGED
@@ -216,21 +216,21 @@ 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-terms-checkbox").click();
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();
220
223
  await this.page.getByTestId("onboarding-import-wallet").click();
221
- await this.page.getByTestId("metametrics-i-agree").click();
222
- for (const [i, word] of mnemonic.split(" ").entries())
223
- await this.page.getByTestId(`import-srp__srp-word-${i}`).fill(word);
224
+ await this.page.getByTestId("srp-input-import__srp-note").pressSequentially(mnemonic);
224
225
  await this.page.getByTestId("import-srp-confirm").click();
225
- await this.page.getByTestId("create-password-new").fill(password);
226
- await this.page.getByTestId("create-password-confirm").fill(password);
226
+ await this.page.getByTestId("create-password-new-input").fill(password);
227
+ await this.page.getByTestId("create-password-confirm-input").fill(password);
227
228
  await this.page.getByTestId("create-password-terms").click();
228
- await this.page.getByTestId("create-password-import").click();
229
+ await this.page.getByTestId("create-password-submit").click();
230
+ await this.page.getByTestId("metametrics-no-thanks").click();
229
231
  await this.page.getByTestId("onboarding-complete-done").click();
230
- await this.page.getByTestId("pin-extension-next").click();
231
232
  await this.page.getByTestId("pin-extension-done").click();
232
- await this.page.waitForTimeout(1e3);
233
- await this.clickTopRightCornerToCloseAllTheMarketingBullshit();
233
+ await this.page.getByTestId("not-now-button").click();
234
234
  }
235
235
  async switchAccount(accountNameOrAddress) {
236
236
  await this.page.getByTestId("account-menu-icon").click();
@@ -288,7 +288,9 @@ var Metamask = class extends Wallet {
288
288
  await p.locator(
289
289
  '[data-testid="confirm-footer-button"], [data-testid="confirm-btn"], [data-testid="page-container-footer-next"], [data-testid="confirmation-submit-button"]'
290
290
  ).click();
291
- await p.waitForSelector(".main-container-wrapper:empty", { timeout: 1e4 });
291
+ await p.waitForSelector(".main-container-wrapper:empty", {
292
+ timeout: 1e4
293
+ });
292
294
  await p.close();
293
295
  }
294
296
  async deny() {
package/dist/index.mjs CHANGED
@@ -182,21 +182,21 @@ 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-terms-checkbox").click();
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();
186
189
  await this.page.getByTestId("onboarding-import-wallet").click();
187
- await this.page.getByTestId("metametrics-i-agree").click();
188
- for (const [i, word] of mnemonic.split(" ").entries())
189
- await this.page.getByTestId(`import-srp__srp-word-${i}`).fill(word);
190
+ await this.page.getByTestId("srp-input-import__srp-note").pressSequentially(mnemonic);
190
191
  await this.page.getByTestId("import-srp-confirm").click();
191
- await this.page.getByTestId("create-password-new").fill(password);
192
- await this.page.getByTestId("create-password-confirm").fill(password);
192
+ await this.page.getByTestId("create-password-new-input").fill(password);
193
+ await this.page.getByTestId("create-password-confirm-input").fill(password);
193
194
  await this.page.getByTestId("create-password-terms").click();
194
- await this.page.getByTestId("create-password-import").click();
195
+ await this.page.getByTestId("create-password-submit").click();
196
+ await this.page.getByTestId("metametrics-no-thanks").click();
195
197
  await this.page.getByTestId("onboarding-complete-done").click();
196
- await this.page.getByTestId("pin-extension-next").click();
197
198
  await this.page.getByTestId("pin-extension-done").click();
198
- await this.page.waitForTimeout(1e3);
199
- await this.clickTopRightCornerToCloseAllTheMarketingBullshit();
199
+ await this.page.getByTestId("not-now-button").click();
200
200
  }
201
201
  async switchAccount(accountNameOrAddress) {
202
202
  await this.page.getByTestId("account-menu-icon").click();
@@ -254,7 +254,9 @@ var Metamask = class extends Wallet {
254
254
  await p.locator(
255
255
  '[data-testid="confirm-footer-button"], [data-testid="confirm-btn"], [data-testid="page-container-footer-next"], [data-testid="confirmation-submit-button"]'
256
256
  ).click();
257
- await p.waitForSelector(".main-container-wrapper:empty", { timeout: 1e4 });
257
+ await p.waitForSelector(".main-container-wrapper:empty", {
258
+ timeout: 1e4
259
+ });
258
260
  await p.close();
259
261
  }
260
262
  async deny() {
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.1",
4
+ "version": "0.8.3",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "homepage": "https://github.com/Maksandre/w3wallets",