@web/test-runner-commands 0.8.0 → 0.8.2
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/browser/commands.d.ts +18 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/package.json +6 -5
- package/plugins.mjs +2 -0
- package/src/index.ts +1 -0
package/browser/commands.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
RemoveFilePayload,
|
|
9
9
|
SnapshotPluginConfig,
|
|
10
10
|
SaveSnapshotPayload,
|
|
11
|
+
SelectOptionPayload,
|
|
11
12
|
SendMousePayload,
|
|
12
13
|
} from '../dist/index';
|
|
13
14
|
|
|
@@ -135,6 +136,23 @@ export function sendKeys(payload: SendKeysPayload): Promise<void>;
|
|
|
135
136
|
**/
|
|
136
137
|
export function sendMouse(payload: SendMousePayload): Promise<void>;
|
|
137
138
|
|
|
139
|
+
/**
|
|
140
|
+
* Selects an option in a <select> element by value or label
|
|
141
|
+
*
|
|
142
|
+
* @example
|
|
143
|
+
* ```
|
|
144
|
+
* it('natively selects an option by value', async () => {
|
|
145
|
+
* const valueToSelect = 'first';
|
|
146
|
+
* const select = document.querySelector('#testSelect');
|
|
147
|
+
*
|
|
148
|
+
* await selectOption({ selector: '#testSelect', value: valueToSelect });
|
|
149
|
+
*
|
|
150
|
+
* expect(select.value).to.equal(valueToSelect);
|
|
151
|
+
*});
|
|
152
|
+
*```
|
|
153
|
+
*/
|
|
154
|
+
export function selectOption(payload: SelectOptionPayload): Promise<void>;
|
|
155
|
+
|
|
138
156
|
/**
|
|
139
157
|
* Resets the mouse position to (0, 0) and releases mouse buttons.
|
|
140
158
|
*
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { Viewport, setViewportPlugin } from './setViewportPlugin';
|
|
2
2
|
export { Media, emulateMediaPlugin } from './emulateMediaPlugin';
|
|
3
|
+
export { selectOptionPlugin, SelectOptionPayload } from './selectOptionPlugin';
|
|
3
4
|
export { setUserAgentPlugin } from './setUserAgentPlugin';
|
|
4
5
|
export { sendKeysPlugin, SendKeysPayload } from './sendKeysPlugin';
|
|
5
6
|
export { sendMousePlugin, SendMousePayload } from './sendMousePlugin';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC/E,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAChG,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC/E,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC/E,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAChG,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.snapshotPlugin = exports.filePlugin = exports.a11ySnapshotPlugin = exports.sendMousePlugin = exports.sendKeysPlugin = exports.setUserAgentPlugin = exports.emulateMediaPlugin = exports.setViewportPlugin = void 0;
|
|
3
|
+
exports.snapshotPlugin = exports.filePlugin = exports.a11ySnapshotPlugin = exports.sendMousePlugin = exports.sendKeysPlugin = exports.setUserAgentPlugin = exports.selectOptionPlugin = exports.emulateMediaPlugin = exports.setViewportPlugin = void 0;
|
|
4
4
|
var setViewportPlugin_1 = require("./setViewportPlugin");
|
|
5
5
|
Object.defineProperty(exports, "setViewportPlugin", { enumerable: true, get: function () { return setViewportPlugin_1.setViewportPlugin; } });
|
|
6
6
|
var emulateMediaPlugin_1 = require("./emulateMediaPlugin");
|
|
7
7
|
Object.defineProperty(exports, "emulateMediaPlugin", { enumerable: true, get: function () { return emulateMediaPlugin_1.emulateMediaPlugin; } });
|
|
8
|
+
var selectOptionPlugin_1 = require("./selectOptionPlugin");
|
|
9
|
+
Object.defineProperty(exports, "selectOptionPlugin", { enumerable: true, get: function () { return selectOptionPlugin_1.selectOptionPlugin; } });
|
|
8
10
|
var setUserAgentPlugin_1 = require("./setUserAgentPlugin");
|
|
9
11
|
Object.defineProperty(exports, "setUserAgentPlugin", { enumerable: true, get: function () { return setUserAgentPlugin_1.setUserAgentPlugin; } });
|
|
10
12
|
var sendKeysPlugin_1 = require("./sendKeysPlugin");
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,yDAAkE;AAA/C,sHAAA,iBAAiB,OAAA;AACpC,2DAAiE;AAAjD,wHAAA,kBAAkB,OAAA;AAClC,2DAA0D;AAAjD,wHAAA,kBAAkB,OAAA;AAC3B,mDAAmE;AAA1D,gHAAA,cAAc,OAAA;AACvB,qDAAsE;AAA7D,kHAAA,eAAe,OAAA;AACxB,2DAA+E;AAAtE,wHAAA,kBAAkB,OAAA;AAC3B,2CAAgG;AAAjC,wGAAA,UAAU,OAAA;AACzE,mDAA6F;AAAzC,gHAAA,cAAc,OAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,yDAAkE;AAA/C,sHAAA,iBAAiB,OAAA;AACpC,2DAAiE;AAAjD,wHAAA,kBAAkB,OAAA;AAClC,2DAA+E;AAAtE,wHAAA,kBAAkB,OAAA;AAC3B,2DAA0D;AAAjD,wHAAA,kBAAkB,OAAA;AAC3B,mDAAmE;AAA1D,gHAAA,cAAc,OAAA;AACvB,qDAAsE;AAA7D,kHAAA,eAAe,OAAA;AACxB,2DAA+E;AAAtE,wHAAA,kBAAkB,OAAA;AAC3B,2CAAgG;AAAjC,wGAAA,UAAU,OAAA;AACzE,mDAA6F;AAAzC,gHAAA,cAAc,OAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@web/test-runner-commands",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.2",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"default": "./browser/commands.mjs"
|
|
21
21
|
},
|
|
22
22
|
"./plugins": {
|
|
23
|
+
"types": "./plugins.d.ts",
|
|
23
24
|
"import": "./plugins.mjs",
|
|
24
25
|
"require": "./dist/index.js"
|
|
25
26
|
}
|
|
@@ -48,13 +49,13 @@
|
|
|
48
49
|
"commands"
|
|
49
50
|
],
|
|
50
51
|
"dependencies": {
|
|
51
|
-
"@web/test-runner-core": "^0.11.
|
|
52
|
+
"@web/test-runner-core": "^0.11.6",
|
|
52
53
|
"mkdirp": "^1.0.4"
|
|
53
54
|
},
|
|
54
55
|
"devDependencies": {
|
|
55
|
-
"@web/test-runner-chrome": "^0.14.
|
|
56
|
-
"@web/test-runner-playwright": "^0.10.
|
|
57
|
-
"@web/test-runner-webdriver": "^0.7.
|
|
56
|
+
"@web/test-runner-chrome": "^0.14.3",
|
|
57
|
+
"@web/test-runner-playwright": "^0.10.2",
|
|
58
|
+
"@web/test-runner-webdriver": "^0.7.1",
|
|
58
59
|
"mocha": "^10.2.0"
|
|
59
60
|
}
|
|
60
61
|
}
|
package/plugins.mjs
CHANGED
|
@@ -4,6 +4,7 @@ import cjsEntrypoint from './dist/index.js';
|
|
|
4
4
|
const {
|
|
5
5
|
setViewportPlugin,
|
|
6
6
|
emulateMediaPlugin,
|
|
7
|
+
selectOptionPlugin,
|
|
7
8
|
setUserAgentPlugin,
|
|
8
9
|
sendKeysPlugin,
|
|
9
10
|
sendMousePlugin,
|
|
@@ -15,6 +16,7 @@ const {
|
|
|
15
16
|
export {
|
|
16
17
|
setViewportPlugin,
|
|
17
18
|
emulateMediaPlugin,
|
|
19
|
+
selectOptionPlugin,
|
|
18
20
|
setUserAgentPlugin,
|
|
19
21
|
sendKeysPlugin,
|
|
20
22
|
sendMousePlugin,
|
package/src/index.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { Viewport, setViewportPlugin } from './setViewportPlugin';
|
|
2
2
|
export { Media, emulateMediaPlugin } from './emulateMediaPlugin';
|
|
3
|
+
export { selectOptionPlugin, SelectOptionPayload } from './selectOptionPlugin';
|
|
3
4
|
export { setUserAgentPlugin } from './setUserAgentPlugin';
|
|
4
5
|
export { sendKeysPlugin, SendKeysPayload } from './sendKeysPlugin';
|
|
5
6
|
export { sendMousePlugin, SendMousePayload } from './sendMousePlugin';
|