@vitest/browser-playwright 4.0.16 → 4.1.0-beta.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.
Files changed (2) hide show
  1. package/dist/index.js +11 -0
  2. package/package.json +5 -5
package/dist/index.js CHANGED
@@ -694,11 +694,22 @@ const upload = async (context, selector, files, options) => {
694
694
  await iframe.locator(selector).setInputFiles(playwrightFiles, options);
695
695
  };
696
696
 
697
+ const wheel = async (context, selector, options) => {
698
+ await hover(context, selector);
699
+ const times = options.times ?? 1;
700
+ const deltaX = options.delta.x ?? 0;
701
+ const deltaY = options.delta.y ?? 0;
702
+ for (let count = 0; count < times; count += 1) {
703
+ await context.page.mouse.wheel(deltaX, deltaY);
704
+ }
705
+ };
706
+
697
707
  var commands = {
698
708
  __vitest_upload: upload,
699
709
  __vitest_click: click,
700
710
  __vitest_dblClick: dblClick,
701
711
  __vitest_tripleClick: tripleClick,
712
+ __vitest_wheel: wheel,
702
713
  __vitest_takeScreenshot: takeScreenshot,
703
714
  __vitest_type: type,
704
715
  __vitest_clear: clear,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vitest/browser-playwright",
3
3
  "type": "module",
4
- "version": "4.0.16",
4
+ "version": "4.1.0-beta.1",
5
5
  "description": "Browser running for Vitest using playwright",
6
6
  "license": "MIT",
7
7
  "funding": "https://opencollective.com/vitest",
@@ -42,7 +42,7 @@
42
42
  ],
43
43
  "peerDependencies": {
44
44
  "playwright": "*",
45
- "vitest": "4.0.16"
45
+ "vitest": "4.1.0-beta.1"
46
46
  },
47
47
  "peerDependenciesMeta": {
48
48
  "playwright": {
@@ -51,12 +51,12 @@
51
51
  },
52
52
  "dependencies": {
53
53
  "tinyrainbow": "^3.0.3",
54
- "@vitest/mocker": "4.0.16",
55
- "@vitest/browser": "4.0.16"
54
+ "@vitest/browser": "4.1.0-beta.1",
55
+ "@vitest/mocker": "4.1.0-beta.1"
56
56
  },
57
57
  "devDependencies": {
58
58
  "playwright": "^1.57.0",
59
- "vitest": "4.0.16"
59
+ "vitest": "4.1.0-beta.1"
60
60
  },
61
61
  "scripts": {
62
62
  "build": "premove dist && pnpm rollup -c",