@haibun/web-playwright 2.2.0 → 2.2.1
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/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@haibun/web-playwright",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.2.
|
|
4
|
+
"version": "2.2.1",
|
|
5
5
|
"description": "",
|
|
6
6
|
"main": "build/web-playwright.js",
|
|
7
7
|
"exports": { ".": "./build/web-playwright.js", "./*": "./build/*" },
|
|
@@ -19,9 +19,9 @@
|
|
|
19
19
|
"author": "",
|
|
20
20
|
"license": "ISC",
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@haibun/core": "2.2.
|
|
23
|
-
"@haibun/domain-storage": "2.2.
|
|
24
|
-
"@haibun/storage-mem": "2.2.
|
|
22
|
+
"@haibun/core": "2.2.1",
|
|
23
|
+
"@haibun/domain-storage": "2.2.1",
|
|
24
|
+
"@haibun/storage-mem": "2.2.1",
|
|
25
25
|
"playwright": "^1.56.1"
|
|
26
26
|
},
|
|
27
27
|
"gitHead": "7cf9680bd922fb622fb59f1e6bf5b65284cb8fd5",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"web-playwright.test copy.d.ts","sourceRoot":"","sources":["../src/web-playwright.test copy.ts"],"names":[],"mappings":""}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect } from 'vitest';
|
|
2
|
-
import path from 'path';
|
|
3
|
-
import WebPlaywright from './web-playwright.js';
|
|
4
|
-
import { getPackageLocation } from '@haibun/core/lib/util/workspace-lib.js';
|
|
5
|
-
import { getCreateSteppers, getDefaultWorld } from '@haibun/core/lib/test/lib.js';
|
|
6
|
-
const me = path.join(getPackageLocation(import.meta).replace(/\/src$/, '/build'), 'web-playwright');
|
|
7
|
-
describe('playwrightWeb', () => {
|
|
8
|
-
it('sets up steps', async () => {
|
|
9
|
-
const steppers = await getCreateSteppers([me]);
|
|
10
|
-
expect(Object.keys(steppers[0].steps).length > 0).toBe(true);
|
|
11
|
-
expect(Object.values(steppers[0].steps).every((s) => !!s.action)).toBe(true);
|
|
12
|
-
});
|
|
13
|
-
/*
|
|
14
|
-
it('sets browser type and device', async () => {
|
|
15
|
-
const { world, featureStep, steppers } = await getTestEnv([me], 'using firefox.Pixel 5 browser', getDefaultWorld(0));
|
|
16
|
-
await FeatureExecutor.doFeatureStep(steppers, featureStep, world);
|
|
17
|
-
const webPlaywright = findStepper<any>(steppers, 'WebPlaywright');
|
|
18
|
-
const bf = await webPlaywright.getBrowserFactory();
|
|
19
|
-
|
|
20
|
-
expect(bf.browserType.name()).toBe('firefox');
|
|
21
|
-
expect(bf.device).toBe('Pixel 5');
|
|
22
|
-
});
|
|
23
|
-
it('fails setting browser type and device', async () => {
|
|
24
|
-
const { world, featureStep, steppers } = await getTestEnv([me], 'using nonexistent browser', getDefaultWorld(0));
|
|
25
|
-
const result = await FeatureExecutor.doFeatureStep(steppers, featureStep, world);
|
|
26
|
-
expect(result.actionResult.ok).toBe(false);
|
|
27
|
-
});
|
|
28
|
-
*/
|
|
29
|
-
});
|
|
30
|
-
describe('handles cycles', () => {
|
|
31
|
-
it('closes browser', async () => {
|
|
32
|
-
const wp = new WebPlaywright();
|
|
33
|
-
await wp.steps.takeScreenshot.action({}, {});
|
|
34
|
-
expect(async () => {
|
|
35
|
-
if (wp.cycles && wp.cycles.endFeature) {
|
|
36
|
-
const world = getDefaultWorld(0);
|
|
37
|
-
await wp.cycles.endFeature({ world, shouldClose: true, isLast: true, okSoFar: true, continueAfterError: false, stayOnFailure: false, thisFeatureOK: true });
|
|
38
|
-
await wp.steps.takeScreenshot.action({}, {});
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
throw new Error('no cycles');
|
|
42
|
-
}
|
|
43
|
-
}).not.toThrow();
|
|
44
|
-
});
|
|
45
|
-
});
|
|
46
|
-
//# sourceMapp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