@allwright.dev/vitest 0.1.17 → 0.1.19
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 +24 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -38,7 +38,7 @@ test("opens an Android app", async ({ androidApp }) => {
|
|
|
38
38
|
});
|
|
39
39
|
|
|
40
40
|
test("opens an iOS app", async ({ iosApp }) => {
|
|
41
|
-
await iosApp.
|
|
41
|
+
await iosApp.getByRole("button", { name: "Login", exact: true }).click();
|
|
42
42
|
});
|
|
43
43
|
```
|
|
44
44
|
|
|
@@ -133,9 +133,9 @@ the test. The test remains platform-client code only:
|
|
|
133
133
|
import { expect, test } from "@allwright.dev/vitest";
|
|
134
134
|
|
|
135
135
|
test("logs in", async ({ iosApp }) => {
|
|
136
|
-
await iosApp.
|
|
137
|
-
await iosApp.
|
|
138
|
-
await expect(iosApp.
|
|
136
|
+
await iosApp.getByRole("button", { name: "Login", exact: true }).click();
|
|
137
|
+
await iosApp.getByLabel("Email", { exact: true }).fill("user@example.com");
|
|
138
|
+
await expect(iosApp.getByText("Welcome back", { exact: true })).toBeVisible();
|
|
139
139
|
});
|
|
140
140
|
```
|
|
141
141
|
|
package/dist/index.js
CHANGED
|
@@ -340,6 +340,18 @@ function createLazyMobileApp(appResource) {
|
|
|
340
340
|
locator(selector) {
|
|
341
341
|
return createLazyMobileLocator(appResource, async () => selector);
|
|
342
342
|
},
|
|
343
|
+
getByRole(role, options) {
|
|
344
|
+
return createLazyMobileLocator(appResource, async () => (await appResource.get()).getByRole(role, options).selector);
|
|
345
|
+
},
|
|
346
|
+
getByText(text, options) {
|
|
347
|
+
return createLazyMobileLocator(appResource, async () => (await appResource.get()).getByText(text, options).selector);
|
|
348
|
+
},
|
|
349
|
+
getByLabel(text, options) {
|
|
350
|
+
return createLazyMobileLocator(appResource, async () => (await appResource.get()).getByLabel(text, options).selector);
|
|
351
|
+
},
|
|
352
|
+
getByTestId(text) {
|
|
353
|
+
return createLazyMobileLocator(appResource, async () => (await appResource.get()).getByTestId(text).selector);
|
|
354
|
+
},
|
|
343
355
|
async registerHook(type) {
|
|
344
356
|
return (await appResource.get()).registerHook(type);
|
|
345
357
|
},
|
|
@@ -411,6 +423,18 @@ function createLazyMobileLocator(appResource, selectorFactory) {
|
|
|
411
423
|
locator(selector) {
|
|
412
424
|
return createLazyMobileLocator(appResource, async () => (await appResource.get()).locator(await selectorFactory()).locator(selector).selector);
|
|
413
425
|
},
|
|
426
|
+
getByRole(role, options) {
|
|
427
|
+
return createLazyMobileLocator(appResource, async () => (await appResource.get()).locator(await selectorFactory()).getByRole(role, options).selector);
|
|
428
|
+
},
|
|
429
|
+
getByText(text, options) {
|
|
430
|
+
return createLazyMobileLocator(appResource, async () => (await appResource.get()).locator(await selectorFactory()).getByText(text, options).selector);
|
|
431
|
+
},
|
|
432
|
+
getByLabel(text, options) {
|
|
433
|
+
return createLazyMobileLocator(appResource, async () => (await appResource.get()).locator(await selectorFactory()).getByLabel(text, options).selector);
|
|
434
|
+
},
|
|
435
|
+
getByTestId(text) {
|
|
436
|
+
return createLazyMobileLocator(appResource, async () => (await appResource.get()).locator(await selectorFactory()).getByTestId(text).selector);
|
|
437
|
+
},
|
|
414
438
|
};
|
|
415
439
|
return lazyLocator;
|
|
416
440
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@allwright.dev/vitest",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.19",
|
|
4
4
|
"description": "Vitest fixtures for the allwright TypeScript client.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"prepublishOnly": "bun run build"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@allwright.dev/core": "0.1.
|
|
50
|
+
"@allwright.dev/core": "0.1.19"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"typescript": "^5.9.2",
|