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 +4 -4
- package/dist/index.js +13 -11
- package/dist/index.mjs +13 -11
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@ npm install -D w3wallets
|
|
|
15
15
|
|
|
16
16
|
## Getting Started
|
|
17
17
|
|
|
18
|
-
|
|
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
|
|
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
|
|
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-
|
|
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("
|
|
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-
|
|
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.
|
|
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", {
|
|
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-
|
|
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("
|
|
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-
|
|
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.
|
|
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", {
|
|
257
|
+
await p.waitForSelector(".main-container-wrapper:empty", {
|
|
258
|
+
timeout: 1e4
|
|
259
|
+
});
|
|
258
260
|
await p.close();
|
|
259
261
|
}
|
|
260
262
|
async deny() {
|