@harnessed-ts/webdriverio 0.0.0-stage → 0.6.0
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/CHANGELOG.md +72 -0
- package/LICENSE +21 -0
- package/README.md +23 -2
- package/dist/driver-id.d.ts +3 -0
- package/dist/driver-id.d.ts.map +1 -0
- package/dist/env.d.ts +12 -0
- package/dist/env.d.ts.map +1 -0
- package/dist/index.cjs +615 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +611 -0
- package/dist/index.js.map +1 -0
- package/dist/keys.d.ts +13 -0
- package/dist/keys.d.ts.map +1 -0
- package/dist/location.d.ts +3 -0
- package/dist/location.d.ts.map +1 -0
- package/dist/matchers.cjs +27 -0
- package/dist/matchers.cjs.map +1 -0
- package/dist/matchers.d.ts +27 -0
- package/dist/matchers.d.ts.map +1 -0
- package/dist/matchers.js +25 -0
- package/dist/matchers.js.map +1 -0
- package/dist/page-script.d.ts +43 -0
- package/dist/page-script.d.ts.map +1 -0
- package/dist/realm.d.ts +64 -0
- package/dist/realm.d.ts.map +1 -0
- package/dist/webdriverio-query.d.ts +70 -0
- package/dist/webdriverio-query.d.ts.map +1 -0
- package/package.json +79 -3
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# @harnessed-ts/webdriverio
|
|
2
|
+
|
|
3
|
+
## 0.6.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- e324e94: ember-test-selectors style test ids: `configure({ testIdAttribute: 'data-test-*' })` makes `testId('x')` match any element that has the attribute `data-test-x`, whatever its value, with the same scoping, strictness, `{ global: true }`, frame and absence rules as before under every driver. A plain attribute name keeps matching by value. A presence id is held to letters, digits, `-`, `_`, `.` and `:`, and anything else (or a `RegExp`) is refused rather than spliced into a selector.
|
|
8
|
+
|
|
9
|
+
`Query.boundingBox()` resolves to `{ x, y, width, height }`: the target's border box in CSS pixels, relative to the top-level viewport, offset by every frame crossed. Strict, and on an absent target it rejects after the timeout, as `text()` does. A node that draws no box reads as all zeros, and so does every node under the dom driver: jsdom computes no layout.
|
|
10
|
+
|
|
11
|
+
`Query.upload(files)` sets the files of an `<input type="file">`, or of the input a `<label>` is for, and fires `input` and `change`, replacing any earlier selection. It refuses any other element, and several files for an input that is not `multiple`. Puppeteer, WebdriverIO and TestCafe take only paths, so there each `File` is written to a temporary directory first: its name and bytes arrive, and the browser infers its type from the extension.
|
|
12
|
+
|
|
13
|
+
`Query` gains two abstract members, so a driver outside this repo implements both to keep compiling; the conformance catalog pins all three changes.
|
|
14
|
+
|
|
15
|
+
`@harnessed-ts/eslint-plugin` supports ESLint 8.57 and legacy `.eslintrc`: the peer range is now `>=8.57`, `legacy-recommended` and `legacy-strict` name the rules under `@harnessed-ts/`, and the CJS build exposes `rules` and `configs` at the top level, where eslintrc reads them.
|
|
16
|
+
|
|
17
|
+
`npx @harnessed-ts/claude install` detects ember-test-selectors attributes (in `.gts`, `.gjs` and `.hbs` files too) and writes `testIdAttribute: 'data-test-*'`.
|
|
18
|
+
|
|
19
|
+
`@harnessed-ts/storybook` writes and finds its story-ready marker under a `data-test-*` config, where `StoryPage` waits for it.
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- Updated dependencies [e324e94]
|
|
24
|
+
- @harnessed-ts/core@0.6.0
|
|
25
|
+
- @harnessed-ts/resolve@0.6.0
|
|
26
|
+
|
|
27
|
+
## 0.5.0
|
|
28
|
+
|
|
29
|
+
### Patch Changes
|
|
30
|
+
|
|
31
|
+
- @harnessed-ts/core@0.5.0
|
|
32
|
+
- @harnessed-ts/resolve@0.5.0
|
|
33
|
+
|
|
34
|
+
## 0.4.0
|
|
35
|
+
|
|
36
|
+
### Minor Changes
|
|
37
|
+
|
|
38
|
+
- 1823546: `isVisible()`, `waitFor('visible')` and `waitFor('hidden')` on a target matching
|
|
39
|
+
several nodes now reject with the shared strict-mode violation, at once, under
|
|
40
|
+
every driver. The dom, Ember, Vitest browser mode and Cypress drivers answered
|
|
41
|
+
`false` from `isVisible()`, waited out the timeout in `waitFor('visible')`, and —
|
|
42
|
+
worse — resolved `waitFor('hidden')` at once, passing a wait for three rendered
|
|
43
|
+
nodes to disappear; Playwright's waits raised its own wording instead of the
|
|
44
|
+
shared one. An `nth()`
|
|
45
|
+
past the last match answers `false` from `isVisible()` and counts as hidden, as it
|
|
46
|
+
does under Playwright — Puppeteer and TestCafe used to reject it as an index out
|
|
47
|
+
of range.
|
|
48
|
+
|
|
49
|
+
Core exports `StrictModeViolation`, the class `strictViolation()` now returns, so a
|
|
50
|
+
driver can tell ambiguity apart from absence. It is the class a caller catches
|
|
51
|
+
under every driver: core also exports `reviveStrictViolation()`, which the
|
|
52
|
+
Puppeteer, WebdriverIO and TestCafe drivers apply to what the page throws, so
|
|
53
|
+
a violation raised in the page arrives as core's class, worded exactly as an
|
|
54
|
+
in-process driver words it. `instanceof StrictModeViolation` checks a brand
|
|
55
|
+
rather than the prototype, so it holds across two copies of core in one page —
|
|
56
|
+
Cypress bundles the support file and each spec separately.
|
|
57
|
+
|
|
58
|
+
`WaitState` now documents the rule it is held to: a state joins only when every
|
|
59
|
+
driver honours it with the same meaning, so a runner's own states — Playwright's
|
|
60
|
+
`attached` and `detached` — stay out of the shared interface.
|
|
61
|
+
|
|
62
|
+
- 9666a3d: New driver for WebdriverIO 10: `wdio(browser)` runs every harness and page under the WDIO testrunner, over WebDriver BiDi or Classic. Selectors resolve in the page through the shared resolver, frames are entered through WebDriver (cross-origin ones included), and `@harnessed-ts/webdriverio/matchers` registers `toBeAbsent`, `toBeSelected` and `toReadAs` with expect-webdriverio.
|
|
63
|
+
|
|
64
|
+
### Patch Changes
|
|
65
|
+
|
|
66
|
+
- Updated dependencies [9666a3d]
|
|
67
|
+
- Updated dependencies [9666a3d]
|
|
68
|
+
- Updated dependencies [9666a3d]
|
|
69
|
+
- Updated dependencies [9666a3d]
|
|
70
|
+
- Updated dependencies [1823546]
|
|
71
|
+
- @harnessed-ts/core@0.4.0
|
|
72
|
+
- @harnessed-ts/resolve@0.4.0
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Joe Gaudet, Jay Seo
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,24 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @harnessed-ts/webdriverio
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
WebdriverIO driver for `@harnessed-ts/core`. Selectors resolve in the page through
|
|
4
|
+
the shared resolver — the same code the Testing Library driver runs — and
|
|
5
|
+
WebDriver does the clicking and typing.
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import { wdio } from '@harnessed-ts/webdriverio'
|
|
9
|
+
import '@harnessed-ts/webdriverio/matchers'
|
|
10
|
+
import { browser, expect } from '@wdio/globals'
|
|
11
|
+
|
|
12
|
+
const form = new LoginFormHarness(wdio(browser))
|
|
13
|
+
await form.fillIn({ email: 'ada@example.com' })
|
|
14
|
+
await expect(form).not.toBeAbsent()
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Works under WebDriver BiDi (WebdriverIO's default) and Classic. Frames are
|
|
18
|
+
entered through WebDriver, so a harness nested in a cross-origin frame works too.
|
|
19
|
+
Under Mocha, `@harnessed-ts/chai` gives the same assertions in Chai's style.
|
|
20
|
+
|
|
21
|
+
Needs WebdriverIO 10. Full guide, the cross-driver guarantees, and the API: the
|
|
22
|
+
[harnessed README](https://github.com/joegaudet/harnessed#readme).
|
|
23
|
+
|
|
24
|
+
MIT © Joe Gaudet, Jay Seo
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"driver-id.d.ts","sourceRoot":"","sources":["../src/driver-id.ts"],"names":[],"mappings":"AAAA,0FAA0F;AAC1F,eAAO,MAAM,kBAAkB,gBAAgB,CAAA"}
|
package/dist/env.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { EnvConfig } from '@harnessed-ts/core';
|
|
2
|
+
import { WEBDRIVERIO_DRIVER } from './driver-id';
|
|
3
|
+
import './webdriverio-query';
|
|
4
|
+
export { WEBDRIVERIO_DRIVER };
|
|
5
|
+
export interface WebdriverioEnv extends EnvConfig {
|
|
6
|
+
readonly driver: typeof WEBDRIVERIO_DRIVER;
|
|
7
|
+
/** The WebdriverIO `browser` — the testrunner's global, or a `remote()` session. */
|
|
8
|
+
readonly browser: WebdriverIO.Browser;
|
|
9
|
+
}
|
|
10
|
+
/** Builds the env a harness is constructed with under WebdriverIO. */
|
|
11
|
+
export declare function wdio(browser: WebdriverIO.Browser): WebdriverioEnv;
|
|
12
|
+
//# sourceMappingURL=env.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../src/env.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAEhD,OAAO,qBAAqB,CAAA;AAE5B,OAAO,EAAE,kBAAkB,EAAE,CAAA;AAE7B,MAAM,WAAW,cAAe,SAAQ,SAAS;IAC/C,QAAQ,CAAC,MAAM,EAAE,OAAO,kBAAkB,CAAA;IAC1C,oFAAoF;IACpF,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC,OAAO,CAAA;CACtC;AAED,sEAAsE;AACtE,wBAAgB,IAAI,CAAC,OAAO,EAAE,WAAW,CAAC,OAAO,GAAG,cAAc,CAEjE"}
|