@testspectra/cli 1.2.0 → 1.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 +8 -8
- package/templates/default/package.json +3 -3
- package/templates/nx/package.json +3 -3
- package/templates/react-component/package.json +3 -3
- package/templates/react-component/specs/ButtonComponent/TC-0006-button-bounds-and-parent/spec.md +21 -0
- package/templates/react-component/specs/ButtonComponent/TC-0006-button-bounds-and-parent/web.test.tsx +25 -0
- package/templates/react-component/specs/ButtonComponent/TC-0007-button-wait-and-remove/spec.md +20 -0
- package/templates/react-component/specs/ButtonComponent/TC-0007-button-wait-and-remove/web.test.tsx +18 -0
- package/templates/react-component/specs/InputComponent/TC-0009-input-bounds/spec.md +20 -0
- package/templates/react-component/specs/InputComponent/TC-0009-input-bounds/web.test.tsx +15 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@testspectra/cli",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"description": "TestSpectra Cross-Platform Test Runner CLI",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -25,10 +25,10 @@
|
|
|
25
25
|
],
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@clack/prompts": "^1.7.0",
|
|
28
|
-
"@testspectra/matchers": "^1.2.
|
|
29
|
-
"@testspectra/react": "^1.2.
|
|
30
|
-
"@testspectra/reporter": "^1.2.
|
|
31
|
-
"@testspectra/skills": "^1.2.
|
|
28
|
+
"@testspectra/matchers": "^1.2.1",
|
|
29
|
+
"@testspectra/react": "^1.2.1",
|
|
30
|
+
"@testspectra/reporter": "^1.2.1",
|
|
31
|
+
"@testspectra/skills": "^1.2.1",
|
|
32
32
|
"chalk": "^5.3.0",
|
|
33
33
|
"commander": "^12.1.0",
|
|
34
34
|
"cross-spawn": "^7.0.6",
|
|
@@ -39,9 +39,9 @@
|
|
|
39
39
|
"zod": "^3.23.8"
|
|
40
40
|
},
|
|
41
41
|
"optionalDependencies": {
|
|
42
|
-
"@testspectra/cli-darwin-arm64": "1.2.
|
|
43
|
-
"@testspectra/cli-linux-x64": "1.2.
|
|
44
|
-
"@testspectra/cli-win32-x64": "1.2.
|
|
42
|
+
"@testspectra/cli-darwin-arm64": "1.2.1",
|
|
43
|
+
"@testspectra/cli-linux-x64": "1.2.1",
|
|
44
|
+
"@testspectra/cli-win32-x64": "1.2.1"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@types/cross-spawn": "^6.0.6",
|
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
"postinstall": "spectra sync-types"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"@testspectra/cli": "^1.2.
|
|
21
|
-
"@testspectra/matchers": "^1.2.
|
|
22
|
-
"@testspectra/plugin-demo": "^1.2.
|
|
20
|
+
"@testspectra/cli": "^1.2.1",
|
|
21
|
+
"@testspectra/matchers": "^1.2.1",
|
|
22
|
+
"@testspectra/plugin-demo": "^1.2.1",
|
|
23
23
|
"@types/node": "^20.14.0",
|
|
24
24
|
"@wdio/cli": "^9.2.8",
|
|
25
25
|
"@wdio/local-runner": "^9.2.8",
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
"postinstall": "spectra sync-types"
|
|
13
13
|
},
|
|
14
14
|
"devDependencies": {
|
|
15
|
-
"@testspectra/cli": "^1.2.
|
|
16
|
-
"@testspectra/matchers": "^1.2.
|
|
15
|
+
"@testspectra/cli": "^1.2.1",
|
|
16
|
+
"@testspectra/matchers": "^1.2.1",
|
|
17
17
|
"@types/node": "^20.14.0",
|
|
18
18
|
"@wdio/cli": "^9.2.8",
|
|
19
19
|
"@wdio/local-runner": "^9.2.8",
|
|
@@ -24,6 +24,6 @@
|
|
|
24
24
|
"nx": "^20.8.4",
|
|
25
25
|
"typescript": "^5.4.5",
|
|
26
26
|
"webdriverio": "^9.2.8",
|
|
27
|
-
"@testspectra/plugin-demo": "^1.2.
|
|
27
|
+
"@testspectra/plugin-demo": "^1.2.1"
|
|
28
28
|
}
|
|
29
29
|
}
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
"postinstall": "spectra sync-types"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
|
-
"@testspectra/cli": "^1.2.
|
|
18
|
-
"@testspectra/matchers": "^1.2.
|
|
19
|
-
"@testspectra/react": "^1.2.
|
|
17
|
+
"@testspectra/cli": "^1.2.1",
|
|
18
|
+
"@testspectra/matchers": "^1.2.1",
|
|
19
|
+
"@testspectra/react": "^1.2.1",
|
|
20
20
|
"@types/node": "^20.14.0",
|
|
21
21
|
"@types/react": "^18.3.3",
|
|
22
22
|
"@types/react-dom": "^18.3.0",
|
package/templates/react-component/specs/ButtonComponent/TC-0006-button-bounds-and-parent/spec.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: TC-0006
|
|
3
|
+
title: Verify button bounds and parent element access
|
|
4
|
+
priority: Medium
|
|
5
|
+
caseType: Positive
|
|
6
|
+
status: automated
|
|
7
|
+
coverage:
|
|
8
|
+
web: automated
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# TC-0006: Button Bounds and Parent Access
|
|
12
|
+
|
|
13
|
+
Verify that `Spectra.get()` exposes element bounds (position + size), can navigate up the DOM tree via `parent()`, and can locate an ancestor via `closest()`.
|
|
14
|
+
|
|
15
|
+
## Test Steps
|
|
16
|
+
|
|
17
|
+
1. Mount `<div><Button label="Bounds Test" /></div>`.
|
|
18
|
+
2. Get the button via `Spectra.get('~button')` and read its bounds.
|
|
19
|
+
3. Verify `bounds.width` and `bounds.height` are greater than 0, and `bounds.x` / `bounds.y` are numbers.
|
|
20
|
+
4. Call `parent()` and verify the parent element is visible.
|
|
21
|
+
5. Call `closest('div')` and verify a matching ancestor is returned.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Button } from '../../../src/components/Button/Button.js';
|
|
2
|
+
import { withProviders } from '../../../src/test-utils.js';
|
|
3
|
+
|
|
4
|
+
it('Verify button bounds and parent element access', async () => {
|
|
5
|
+
await Spectra.mount(withProviders(
|
|
6
|
+
<div><Button label="Bounds Test" /></div>,
|
|
7
|
+
));
|
|
8
|
+
|
|
9
|
+
const button = Spectra.get('~button');
|
|
10
|
+
|
|
11
|
+
// getBounds returns position + size
|
|
12
|
+
const bounds = await button.getBounds();
|
|
13
|
+
expect(bounds.width).toBeGreaterThan(0);
|
|
14
|
+
expect(bounds.height).toBeGreaterThan(0);
|
|
15
|
+
expect(typeof bounds.x).toBe('number');
|
|
16
|
+
expect(typeof bounds.y).toBe('number');
|
|
17
|
+
|
|
18
|
+
// parent() navigates up the DOM tree
|
|
19
|
+
const parent = button.parent();
|
|
20
|
+
await parent.shouldBeVisible();
|
|
21
|
+
|
|
22
|
+
// closest() finds matching ancestor
|
|
23
|
+
const wrapper = await button.closest('div');
|
|
24
|
+
expect(wrapper).not.toBeNull();
|
|
25
|
+
});
|
package/templates/react-component/specs/ButtonComponent/TC-0007-button-wait-and-remove/spec.md
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: TC-0007
|
|
3
|
+
title: Verify button wait states and element removal detection
|
|
4
|
+
priority: Medium
|
|
5
|
+
caseType: Positive
|
|
6
|
+
status: automated
|
|
7
|
+
coverage:
|
|
8
|
+
web: automated
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# TC-0007: Button Wait States
|
|
12
|
+
|
|
13
|
+
Verify that a mounted button satisfies explicit wait conditions such as `waitForClickable()` before asserting visibility.
|
|
14
|
+
|
|
15
|
+
## Test Steps
|
|
16
|
+
|
|
17
|
+
1. Mount `<div><Button label="Wait Test" /></div>`.
|
|
18
|
+
2. Get the button via `Spectra.get('~button')`.
|
|
19
|
+
3. Call `waitForClickable({ timeout: 3000 })` and verify it resolves to `true`.
|
|
20
|
+
4. Verify the button is visible.
|
package/templates/react-component/specs/ButtonComponent/TC-0007-button-wait-and-remove/web.test.tsx
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Button } from '../../../src/components/Button/Button.js';
|
|
2
|
+
import { withProviders } from '../../../src/test-utils.js';
|
|
3
|
+
|
|
4
|
+
it('Verify button wait states and element removal detection', async () => {
|
|
5
|
+
await Spectra.mount(withProviders(
|
|
6
|
+
<div><Button label="Wait Test" /></div>,
|
|
7
|
+
));
|
|
8
|
+
|
|
9
|
+
const button = Spectra.get('~button');
|
|
10
|
+
|
|
11
|
+
// waitForClickable — button should be clickable
|
|
12
|
+
const clickable = await button.waitForClickable({ timeout: 3000 });
|
|
13
|
+
expect(clickable).toBe(true);
|
|
14
|
+
|
|
15
|
+
// waitForUndisplayed on hidden element
|
|
16
|
+
// waitForElementRemoved would need a dynamically removed element — skip for static mount
|
|
17
|
+
await button.shouldBeVisible();
|
|
18
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: TC-0009
|
|
3
|
+
title: Verify input bounds and closest ancestor
|
|
4
|
+
priority: Medium
|
|
5
|
+
caseType: Positive
|
|
6
|
+
status: automated
|
|
7
|
+
coverage:
|
|
8
|
+
web: automated
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# TC-0009: Input Bounds and Closest Ancestor
|
|
12
|
+
|
|
13
|
+
Verify that `Spectra.get('input')` exposes element bounds (position + size) and can locate a matching ancestor via `closest()`.
|
|
14
|
+
|
|
15
|
+
## Test Steps
|
|
16
|
+
|
|
17
|
+
1. Mount `<Input placeholder="Bounds check" />`.
|
|
18
|
+
2. Get the input via `Spectra.get('input')` and read its bounds.
|
|
19
|
+
3. Verify `bounds.width` and `bounds.height` are greater than 0.
|
|
20
|
+
4. Call `closest('div')` and verify a matching ancestor is returned.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Input } from '../../../src/components/Input/Input.js';
|
|
2
|
+
import { withProviders } from '../../../src/test-utils.js';
|
|
3
|
+
|
|
4
|
+
it('Verify input bounds and closest ancestor', async () => {
|
|
5
|
+
await Spectra.mount(withProviders(<Input placeholder="Bounds check" />));
|
|
6
|
+
|
|
7
|
+
const input = Spectra.get('input');
|
|
8
|
+
|
|
9
|
+
const bounds = await input.getBounds();
|
|
10
|
+
expect(bounds.width).toBeGreaterThan(0);
|
|
11
|
+
expect(bounds.height).toBeGreaterThan(0);
|
|
12
|
+
|
|
13
|
+
const closest = await input.closest('div');
|
|
14
|
+
expect(closest).not.toBeNull();
|
|
15
|
+
});
|