aria-ease 6.12.1 → 6.12.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/dist/cli.cjs +17 -7
- package/dist/cli.js +1 -1
- package/dist/{contractTestRunnerPlaywright-H24LQ45R.js → contractTestRunnerPlaywright-47DCBO4A.js} +17 -7
- package/dist/{contractTestRunnerPlaywright-NL3JNJYH.js → contractTestRunnerPlaywright-UJKXRXBS.js} +17 -7
- package/dist/index.cjs +40 -7
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +24 -1
- package/dist/src/combobox/index.cjs +3 -0
- package/dist/src/combobox/index.js +3 -0
- package/dist/src/utils/test/{contractTestRunnerPlaywright-5FT6K2WN.js → contractTestRunnerPlaywright-AZ4QKLYT.js} +17 -7
- package/dist/src/utils/test/dsl/index.cjs +20 -0
- package/dist/src/utils/test/dsl/index.d.cts +1 -1
- package/dist/src/utils/test/dsl/index.d.ts +1 -1
- package/dist/src/utils/test/dsl/index.js +20 -0
- package/dist/src/utils/test/index.cjs +17 -7
- package/dist/src/utils/test/index.js +1 -1
- package/dist/{test-FYSJXQWO.js → test-6Y4CIQOM.js} +1 -1
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -1977,13 +1977,21 @@ var init_AssertionRunner = __esm({
|
|
|
1977
1977
|
/**
|
|
1978
1978
|
* Validate focus assertion
|
|
1979
1979
|
*/
|
|
1980
|
-
async validateFocus(target, targetName, failureMessage, testDescription) {
|
|
1980
|
+
async validateFocus(target, targetName, expectedFocus, failureMessage, testDescription) {
|
|
1981
1981
|
try {
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1982
|
+
if (expectedFocus) {
|
|
1983
|
+
await (0, test_exports.expect)(target).toBeFocused({ timeout: this.timeoutMs });
|
|
1984
|
+
return {
|
|
1985
|
+
success: true,
|
|
1986
|
+
passMessage: `${targetName} has focus as expected. Test: "${testDescription}".`
|
|
1987
|
+
};
|
|
1988
|
+
} else {
|
|
1989
|
+
await (0, test_exports.expect)(target).not.toBeFocused({ timeout: this.timeoutMs });
|
|
1990
|
+
return {
|
|
1991
|
+
success: true,
|
|
1992
|
+
passMessage: `${targetName} does not have focus as expected. Test: "${testDescription}".`
|
|
1993
|
+
};
|
|
1994
|
+
}
|
|
1987
1995
|
} catch {
|
|
1988
1996
|
const actualFocus = await this.page.evaluate(() => {
|
|
1989
1997
|
const focused = document.activeElement;
|
|
@@ -2069,7 +2077,9 @@ var init_AssertionRunner = __esm({
|
|
|
2069
2077
|
}
|
|
2070
2078
|
return { success: false, failMessage: "Missing expectedValue for toHaveValue assertion" };
|
|
2071
2079
|
case "toHaveFocus":
|
|
2072
|
-
return this.validateFocus(target, assertion.target, assertion.failureMessage || "", testDescription);
|
|
2080
|
+
return this.validateFocus(target, assertion.target, true, assertion.failureMessage || "", testDescription);
|
|
2081
|
+
case "notToHaveFocus":
|
|
2082
|
+
return this.validateFocus(target, assertion.target, false, assertion.failureMessage || "", testDescription);
|
|
2073
2083
|
case "toHaveRole":
|
|
2074
2084
|
if (assertion.expectedValue !== void 0) {
|
|
2075
2085
|
return this.validateRole(target, assertion.target, assertion.expectedValue, assertion.failureMessage || "", testDescription);
|
package/dist/cli.js
CHANGED
|
@@ -122,7 +122,7 @@ program.command("audit").description("Run axe-core powered accessibility audit o
|
|
|
122
122
|
process.exit(1);
|
|
123
123
|
});
|
|
124
124
|
program.command("test").description("Run core a11y accessibility standard tests on UI components").action(async () => {
|
|
125
|
-
const { runTest } = await import("./test-
|
|
125
|
+
const { runTest } = await import("./test-6Y4CIQOM.js");
|
|
126
126
|
runTest();
|
|
127
127
|
});
|
|
128
128
|
program.command("build").description("Build accessibility artifacts").addCommand(
|
package/dist/{contractTestRunnerPlaywright-H24LQ45R.js → contractTestRunnerPlaywright-47DCBO4A.js}
RENAMED
|
@@ -558,13 +558,21 @@ var AssertionRunner = class {
|
|
|
558
558
|
/**
|
|
559
559
|
* Validate focus assertion
|
|
560
560
|
*/
|
|
561
|
-
async validateFocus(target, targetName, failureMessage, testDescription) {
|
|
561
|
+
async validateFocus(target, targetName, expectedFocus, failureMessage, testDescription) {
|
|
562
562
|
try {
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
563
|
+
if (expectedFocus) {
|
|
564
|
+
await (0, test_exports.expect)(target).toBeFocused({ timeout: this.timeoutMs });
|
|
565
|
+
return {
|
|
566
|
+
success: true,
|
|
567
|
+
passMessage: `${targetName} has focus as expected. Test: "${testDescription}".`
|
|
568
|
+
};
|
|
569
|
+
} else {
|
|
570
|
+
await (0, test_exports.expect)(target).not.toBeFocused({ timeout: this.timeoutMs });
|
|
571
|
+
return {
|
|
572
|
+
success: true,
|
|
573
|
+
passMessage: `${targetName} does not have focus as expected. Test: "${testDescription}".`
|
|
574
|
+
};
|
|
575
|
+
}
|
|
568
576
|
} catch {
|
|
569
577
|
const actualFocus = await this.page.evaluate(() => {
|
|
570
578
|
const focused = document.activeElement;
|
|
@@ -650,7 +658,9 @@ var AssertionRunner = class {
|
|
|
650
658
|
}
|
|
651
659
|
return { success: false, failMessage: "Missing expectedValue for toHaveValue assertion" };
|
|
652
660
|
case "toHaveFocus":
|
|
653
|
-
return this.validateFocus(target, assertion.target, assertion.failureMessage || "", testDescription);
|
|
661
|
+
return this.validateFocus(target, assertion.target, true, assertion.failureMessage || "", testDescription);
|
|
662
|
+
case "notToHaveFocus":
|
|
663
|
+
return this.validateFocus(target, assertion.target, false, assertion.failureMessage || "", testDescription);
|
|
654
664
|
case "toHaveRole":
|
|
655
665
|
if (assertion.expectedValue !== void 0) {
|
|
656
666
|
return this.validateRole(target, assertion.target, assertion.expectedValue, assertion.failureMessage || "", testDescription);
|
package/dist/{contractTestRunnerPlaywright-NL3JNJYH.js → contractTestRunnerPlaywright-UJKXRXBS.js}
RENAMED
|
@@ -558,13 +558,21 @@ var AssertionRunner = class {
|
|
|
558
558
|
/**
|
|
559
559
|
* Validate focus assertion
|
|
560
560
|
*/
|
|
561
|
-
async validateFocus(target, targetName, failureMessage, testDescription) {
|
|
561
|
+
async validateFocus(target, targetName, expectedFocus, failureMessage, testDescription) {
|
|
562
562
|
try {
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
563
|
+
if (expectedFocus) {
|
|
564
|
+
await (0, test_exports.expect)(target).toBeFocused({ timeout: this.timeoutMs });
|
|
565
|
+
return {
|
|
566
|
+
success: true,
|
|
567
|
+
passMessage: `${targetName} has focus as expected. Test: "${testDescription}".`
|
|
568
|
+
};
|
|
569
|
+
} else {
|
|
570
|
+
await (0, test_exports.expect)(target).not.toBeFocused({ timeout: this.timeoutMs });
|
|
571
|
+
return {
|
|
572
|
+
success: true,
|
|
573
|
+
passMessage: `${targetName} does not have focus as expected. Test: "${testDescription}".`
|
|
574
|
+
};
|
|
575
|
+
}
|
|
568
576
|
} catch {
|
|
569
577
|
const actualFocus = await this.page.evaluate(() => {
|
|
570
578
|
const focused = document.activeElement;
|
|
@@ -650,7 +658,9 @@ var AssertionRunner = class {
|
|
|
650
658
|
}
|
|
651
659
|
return { success: false, failMessage: "Missing expectedValue for toHaveValue assertion" };
|
|
652
660
|
case "toHaveFocus":
|
|
653
|
-
return this.validateFocus(target, assertion.target, assertion.failureMessage || "", testDescription);
|
|
661
|
+
return this.validateFocus(target, assertion.target, true, assertion.failureMessage || "", testDescription);
|
|
662
|
+
case "notToHaveFocus":
|
|
663
|
+
return this.validateFocus(target, assertion.target, false, assertion.failureMessage || "", testDescription);
|
|
654
664
|
case "toHaveRole":
|
|
655
665
|
if (assertion.expectedValue !== void 0) {
|
|
656
666
|
return this.validateRole(target, assertion.target, assertion.expectedValue, assertion.failureMessage || "", testDescription);
|
package/dist/index.cjs
CHANGED
|
@@ -1434,13 +1434,21 @@ var init_AssertionRunner = __esm({
|
|
|
1434
1434
|
/**
|
|
1435
1435
|
* Validate focus assertion
|
|
1436
1436
|
*/
|
|
1437
|
-
async validateFocus(target, targetName, failureMessage, testDescription) {
|
|
1437
|
+
async validateFocus(target, targetName, expectedFocus, failureMessage, testDescription) {
|
|
1438
1438
|
try {
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1439
|
+
if (expectedFocus) {
|
|
1440
|
+
await (0, test_exports.expect)(target).toBeFocused({ timeout: this.timeoutMs });
|
|
1441
|
+
return {
|
|
1442
|
+
success: true,
|
|
1443
|
+
passMessage: `${targetName} has focus as expected. Test: "${testDescription}".`
|
|
1444
|
+
};
|
|
1445
|
+
} else {
|
|
1446
|
+
await (0, test_exports.expect)(target).not.toBeFocused({ timeout: this.timeoutMs });
|
|
1447
|
+
return {
|
|
1448
|
+
success: true,
|
|
1449
|
+
passMessage: `${targetName} does not have focus as expected. Test: "${testDescription}".`
|
|
1450
|
+
};
|
|
1451
|
+
}
|
|
1444
1452
|
} catch {
|
|
1445
1453
|
const actualFocus = await this.page.evaluate(() => {
|
|
1446
1454
|
const focused = document.activeElement;
|
|
@@ -1526,7 +1534,9 @@ var init_AssertionRunner = __esm({
|
|
|
1526
1534
|
}
|
|
1527
1535
|
return { success: false, failMessage: "Missing expectedValue for toHaveValue assertion" };
|
|
1528
1536
|
case "toHaveFocus":
|
|
1529
|
-
return this.validateFocus(target, assertion.target, assertion.failureMessage || "", testDescription);
|
|
1537
|
+
return this.validateFocus(target, assertion.target, true, assertion.failureMessage || "", testDescription);
|
|
1538
|
+
case "notToHaveFocus":
|
|
1539
|
+
return this.validateFocus(target, assertion.target, false, assertion.failureMessage || "", testDescription);
|
|
1530
1540
|
case "toHaveRole":
|
|
1531
1541
|
if (assertion.expectedValue !== void 0) {
|
|
1532
1542
|
return this.validateRole(target, assertion.target, assertion.expectedValue, assertion.failureMessage || "", testDescription);
|
|
@@ -3451,6 +3461,9 @@ function makeComboboxAccessible({ comboboxInputId, comboboxButtonId, listBoxId,
|
|
|
3451
3461
|
}
|
|
3452
3462
|
break;
|
|
3453
3463
|
case "Tab":
|
|
3464
|
+
if (isOpen && activeIndex >= 0 && activeIndex < visibleItems.length) {
|
|
3465
|
+
selectOption(visibleItems[activeIndex]);
|
|
3466
|
+
}
|
|
3454
3467
|
if (isOpen) {
|
|
3455
3468
|
closeListbox();
|
|
3456
3469
|
}
|
|
@@ -3878,6 +3891,17 @@ var COMBOBOX_STATES = {
|
|
|
3878
3891
|
],
|
|
3879
3892
|
assertion: isMainFocused
|
|
3880
3893
|
},
|
|
3894
|
+
"main.notFocused": {
|
|
3895
|
+
setup: [
|
|
3896
|
+
{
|
|
3897
|
+
when: ["keyboard"],
|
|
3898
|
+
steps: () => [
|
|
3899
|
+
//what to do here?
|
|
3900
|
+
]
|
|
3901
|
+
}
|
|
3902
|
+
],
|
|
3903
|
+
assertion: isMainNotFocused
|
|
3904
|
+
},
|
|
3881
3905
|
"input.filled": {
|
|
3882
3906
|
setup: [
|
|
3883
3907
|
{
|
|
@@ -4066,6 +4090,15 @@ function isMainFocused() {
|
|
|
4066
4090
|
}
|
|
4067
4091
|
];
|
|
4068
4092
|
}
|
|
4093
|
+
function isMainNotFocused() {
|
|
4094
|
+
return [
|
|
4095
|
+
{
|
|
4096
|
+
target: "main",
|
|
4097
|
+
assertion: "notToHaveFocus",
|
|
4098
|
+
failureMessage: "Expected main to not have focused."
|
|
4099
|
+
}
|
|
4100
|
+
];
|
|
4101
|
+
}
|
|
4069
4102
|
function isInputFilled() {
|
|
4070
4103
|
return [
|
|
4071
4104
|
{
|
package/dist/index.d.cts
CHANGED
|
@@ -232,7 +232,7 @@ type StaticAssertion = {
|
|
|
232
232
|
};
|
|
233
233
|
type DynamicAssertion = {
|
|
234
234
|
target: string;
|
|
235
|
-
assertion: "toBeVisible" | "notToBeVisible" | "toHaveAttribute" | "toHaveValue" | "toHaveFocus" | "toHaveRole";
|
|
235
|
+
assertion: "toBeVisible" | "notToBeVisible" | "toHaveAttribute" | "toHaveValue" | "toHaveFocus" | "notToHaveFocus" | "toHaveRole";
|
|
236
236
|
attribute?: string;
|
|
237
237
|
expectedValue?: string;
|
|
238
238
|
failureMessage?: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -232,7 +232,7 @@ type StaticAssertion = {
|
|
|
232
232
|
};
|
|
233
233
|
type DynamicAssertion = {
|
|
234
234
|
target: string;
|
|
235
|
-
assertion: "toBeVisible" | "notToBeVisible" | "toHaveAttribute" | "toHaveValue" | "toHaveFocus" | "toHaveRole";
|
|
235
|
+
assertion: "toBeVisible" | "notToBeVisible" | "toHaveAttribute" | "toHaveValue" | "toHaveFocus" | "notToHaveFocus" | "toHaveRole";
|
|
236
236
|
attribute?: string;
|
|
237
237
|
expectedValue?: string;
|
|
238
238
|
failureMessage?: string;
|
package/dist/index.js
CHANGED
|
@@ -1144,6 +1144,9 @@ function makeComboboxAccessible({ comboboxInputId, comboboxButtonId, listBoxId,
|
|
|
1144
1144
|
}
|
|
1145
1145
|
break;
|
|
1146
1146
|
case "Tab":
|
|
1147
|
+
if (isOpen && activeIndex >= 0 && activeIndex < visibleItems.length) {
|
|
1148
|
+
selectOption(visibleItems[activeIndex]);
|
|
1149
|
+
}
|
|
1147
1150
|
if (isOpen) {
|
|
1148
1151
|
closeListbox();
|
|
1149
1152
|
}
|
|
@@ -1571,6 +1574,17 @@ var COMBOBOX_STATES = {
|
|
|
1571
1574
|
],
|
|
1572
1575
|
assertion: isMainFocused
|
|
1573
1576
|
},
|
|
1577
|
+
"main.notFocused": {
|
|
1578
|
+
setup: [
|
|
1579
|
+
{
|
|
1580
|
+
when: ["keyboard"],
|
|
1581
|
+
steps: () => [
|
|
1582
|
+
//what to do here?
|
|
1583
|
+
]
|
|
1584
|
+
}
|
|
1585
|
+
],
|
|
1586
|
+
assertion: isMainNotFocused
|
|
1587
|
+
},
|
|
1574
1588
|
"input.filled": {
|
|
1575
1589
|
setup: [
|
|
1576
1590
|
{
|
|
@@ -1759,6 +1773,15 @@ function isMainFocused() {
|
|
|
1759
1773
|
}
|
|
1760
1774
|
];
|
|
1761
1775
|
}
|
|
1776
|
+
function isMainNotFocused() {
|
|
1777
|
+
return [
|
|
1778
|
+
{
|
|
1779
|
+
target: "main",
|
|
1780
|
+
assertion: "notToHaveFocus",
|
|
1781
|
+
failureMessage: "Expected main to not have focused."
|
|
1782
|
+
}
|
|
1783
|
+
];
|
|
1784
|
+
}
|
|
1762
1785
|
function isInputFilled() {
|
|
1763
1786
|
return [
|
|
1764
1787
|
{
|
|
@@ -2204,7 +2227,7 @@ Error: ${error instanceof Error ? error.message : String(error)}`
|
|
|
2204
2227
|
const devServerUrl = await checkDevServer(url);
|
|
2205
2228
|
if (devServerUrl) {
|
|
2206
2229
|
console.log(`\u{1F3AD} Running Playwright tests on ${devServerUrl}`);
|
|
2207
|
-
const { runContractTestsPlaywright } = await import("./contractTestRunnerPlaywright-
|
|
2230
|
+
const { runContractTestsPlaywright } = await import("./contractTestRunnerPlaywright-UJKXRXBS.js");
|
|
2208
2231
|
contract = await runContractTestsPlaywright(componentName, devServerUrl, strictness, config, configBaseDir);
|
|
2209
2232
|
} else {
|
|
2210
2233
|
throw new Error(
|
|
@@ -157,6 +157,9 @@ function makeComboboxAccessible({ comboboxInputId, comboboxButtonId, listBoxId,
|
|
|
157
157
|
}
|
|
158
158
|
break;
|
|
159
159
|
case "Tab":
|
|
160
|
+
if (isOpen && activeIndex >= 0 && activeIndex < visibleItems.length) {
|
|
161
|
+
selectOption(visibleItems[activeIndex]);
|
|
162
|
+
}
|
|
160
163
|
if (isOpen) {
|
|
161
164
|
closeListbox();
|
|
162
165
|
}
|
|
@@ -155,6 +155,9 @@ function makeComboboxAccessible({ comboboxInputId, comboboxButtonId, listBoxId,
|
|
|
155
155
|
}
|
|
156
156
|
break;
|
|
157
157
|
case "Tab":
|
|
158
|
+
if (isOpen && activeIndex >= 0 && activeIndex < visibleItems.length) {
|
|
159
|
+
selectOption(visibleItems[activeIndex]);
|
|
160
|
+
}
|
|
158
161
|
if (isOpen) {
|
|
159
162
|
closeListbox();
|
|
160
163
|
}
|
|
@@ -537,13 +537,21 @@ var AssertionRunner = class {
|
|
|
537
537
|
/**
|
|
538
538
|
* Validate focus assertion
|
|
539
539
|
*/
|
|
540
|
-
async validateFocus(target, targetName, failureMessage, testDescription) {
|
|
540
|
+
async validateFocus(target, targetName, expectedFocus, failureMessage, testDescription) {
|
|
541
541
|
try {
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
542
|
+
if (expectedFocus) {
|
|
543
|
+
await expect(target).toBeFocused({ timeout: this.timeoutMs });
|
|
544
|
+
return {
|
|
545
|
+
success: true,
|
|
546
|
+
passMessage: `${targetName} has focus as expected. Test: "${testDescription}".`
|
|
547
|
+
};
|
|
548
|
+
} else {
|
|
549
|
+
await expect(target).not.toBeFocused({ timeout: this.timeoutMs });
|
|
550
|
+
return {
|
|
551
|
+
success: true,
|
|
552
|
+
passMessage: `${targetName} does not have focus as expected. Test: "${testDescription}".`
|
|
553
|
+
};
|
|
554
|
+
}
|
|
547
555
|
} catch {
|
|
548
556
|
const actualFocus = await this.page.evaluate(() => {
|
|
549
557
|
const focused = document.activeElement;
|
|
@@ -629,7 +637,9 @@ var AssertionRunner = class {
|
|
|
629
637
|
}
|
|
630
638
|
return { success: false, failMessage: "Missing expectedValue for toHaveValue assertion" };
|
|
631
639
|
case "toHaveFocus":
|
|
632
|
-
return this.validateFocus(target, assertion.target, assertion.failureMessage || "", testDescription);
|
|
640
|
+
return this.validateFocus(target, assertion.target, true, assertion.failureMessage || "", testDescription);
|
|
641
|
+
case "notToHaveFocus":
|
|
642
|
+
return this.validateFocus(target, assertion.target, false, assertion.failureMessage || "", testDescription);
|
|
633
643
|
case "toHaveRole":
|
|
634
644
|
if (assertion.expectedValue !== void 0) {
|
|
635
645
|
return this.validateRole(target, assertion.target, assertion.expectedValue, assertion.failureMessage || "", testDescription);
|
|
@@ -63,6 +63,17 @@ var COMBOBOX_STATES = {
|
|
|
63
63
|
],
|
|
64
64
|
assertion: isMainFocused
|
|
65
65
|
},
|
|
66
|
+
"main.notFocused": {
|
|
67
|
+
setup: [
|
|
68
|
+
{
|
|
69
|
+
when: ["keyboard"],
|
|
70
|
+
steps: () => [
|
|
71
|
+
//what to do here?
|
|
72
|
+
]
|
|
73
|
+
}
|
|
74
|
+
],
|
|
75
|
+
assertion: isMainNotFocused
|
|
76
|
+
},
|
|
66
77
|
"input.filled": {
|
|
67
78
|
setup: [
|
|
68
79
|
{
|
|
@@ -251,6 +262,15 @@ function isMainFocused() {
|
|
|
251
262
|
}
|
|
252
263
|
];
|
|
253
264
|
}
|
|
265
|
+
function isMainNotFocused() {
|
|
266
|
+
return [
|
|
267
|
+
{
|
|
268
|
+
target: "main",
|
|
269
|
+
assertion: "notToHaveFocus",
|
|
270
|
+
failureMessage: "Expected main to not have focused."
|
|
271
|
+
}
|
|
272
|
+
];
|
|
273
|
+
}
|
|
254
274
|
function isInputFilled() {
|
|
255
275
|
return [
|
|
256
276
|
{
|
|
@@ -36,7 +36,7 @@ type StaticAssertion = {
|
|
|
36
36
|
};
|
|
37
37
|
type DynamicAssertion = {
|
|
38
38
|
target: string;
|
|
39
|
-
assertion: "toBeVisible" | "notToBeVisible" | "toHaveAttribute" | "toHaveValue" | "toHaveFocus" | "toHaveRole";
|
|
39
|
+
assertion: "toBeVisible" | "notToBeVisible" | "toHaveAttribute" | "toHaveValue" | "toHaveFocus" | "notToHaveFocus" | "toHaveRole";
|
|
40
40
|
attribute?: string;
|
|
41
41
|
expectedValue?: string;
|
|
42
42
|
failureMessage?: string;
|
|
@@ -36,7 +36,7 @@ type StaticAssertion = {
|
|
|
36
36
|
};
|
|
37
37
|
type DynamicAssertion = {
|
|
38
38
|
target: string;
|
|
39
|
-
assertion: "toBeVisible" | "notToBeVisible" | "toHaveAttribute" | "toHaveValue" | "toHaveFocus" | "toHaveRole";
|
|
39
|
+
assertion: "toBeVisible" | "notToBeVisible" | "toHaveAttribute" | "toHaveValue" | "toHaveFocus" | "notToHaveFocus" | "toHaveRole";
|
|
40
40
|
attribute?: string;
|
|
41
41
|
expectedValue?: string;
|
|
42
42
|
failureMessage?: string;
|
|
@@ -61,6 +61,17 @@ var COMBOBOX_STATES = {
|
|
|
61
61
|
],
|
|
62
62
|
assertion: isMainFocused
|
|
63
63
|
},
|
|
64
|
+
"main.notFocused": {
|
|
65
|
+
setup: [
|
|
66
|
+
{
|
|
67
|
+
when: ["keyboard"],
|
|
68
|
+
steps: () => [
|
|
69
|
+
//what to do here?
|
|
70
|
+
]
|
|
71
|
+
}
|
|
72
|
+
],
|
|
73
|
+
assertion: isMainNotFocused
|
|
74
|
+
},
|
|
64
75
|
"input.filled": {
|
|
65
76
|
setup: [
|
|
66
77
|
{
|
|
@@ -249,6 +260,15 @@ function isMainFocused() {
|
|
|
249
260
|
}
|
|
250
261
|
];
|
|
251
262
|
}
|
|
263
|
+
function isMainNotFocused() {
|
|
264
|
+
return [
|
|
265
|
+
{
|
|
266
|
+
target: "main",
|
|
267
|
+
assertion: "notToHaveFocus",
|
|
268
|
+
failureMessage: "Expected main to not have focused."
|
|
269
|
+
}
|
|
270
|
+
];
|
|
271
|
+
}
|
|
252
272
|
function isInputFilled() {
|
|
253
273
|
return [
|
|
254
274
|
{
|
|
@@ -1385,13 +1385,21 @@ var init_AssertionRunner = __esm({
|
|
|
1385
1385
|
/**
|
|
1386
1386
|
* Validate focus assertion
|
|
1387
1387
|
*/
|
|
1388
|
-
async validateFocus(target, targetName, failureMessage, testDescription) {
|
|
1388
|
+
async validateFocus(target, targetName, expectedFocus, failureMessage, testDescription) {
|
|
1389
1389
|
try {
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1390
|
+
if (expectedFocus) {
|
|
1391
|
+
await test.expect(target).toBeFocused({ timeout: this.timeoutMs });
|
|
1392
|
+
return {
|
|
1393
|
+
success: true,
|
|
1394
|
+
passMessage: `${targetName} has focus as expected. Test: "${testDescription}".`
|
|
1395
|
+
};
|
|
1396
|
+
} else {
|
|
1397
|
+
await test.expect(target).not.toBeFocused({ timeout: this.timeoutMs });
|
|
1398
|
+
return {
|
|
1399
|
+
success: true,
|
|
1400
|
+
passMessage: `${targetName} does not have focus as expected. Test: "${testDescription}".`
|
|
1401
|
+
};
|
|
1402
|
+
}
|
|
1395
1403
|
} catch {
|
|
1396
1404
|
const actualFocus = await this.page.evaluate(() => {
|
|
1397
1405
|
const focused = document.activeElement;
|
|
@@ -1477,7 +1485,9 @@ var init_AssertionRunner = __esm({
|
|
|
1477
1485
|
}
|
|
1478
1486
|
return { success: false, failMessage: "Missing expectedValue for toHaveValue assertion" };
|
|
1479
1487
|
case "toHaveFocus":
|
|
1480
|
-
return this.validateFocus(target, assertion.target, assertion.failureMessage || "", testDescription);
|
|
1488
|
+
return this.validateFocus(target, assertion.target, true, assertion.failureMessage || "", testDescription);
|
|
1489
|
+
case "notToHaveFocus":
|
|
1490
|
+
return this.validateFocus(target, assertion.target, false, assertion.failureMessage || "", testDescription);
|
|
1481
1491
|
case "toHaveRole":
|
|
1482
1492
|
if (assertion.expectedValue !== void 0) {
|
|
1483
1493
|
return this.validateRole(target, assertion.target, assertion.expectedValue, assertion.failureMessage || "", testDescription);
|
|
@@ -228,7 +228,7 @@ Error: ${error instanceof Error ? error.message : String(error)}`
|
|
|
228
228
|
const devServerUrl = await checkDevServer(url);
|
|
229
229
|
if (devServerUrl) {
|
|
230
230
|
console.log(`\u{1F3AD} Running Playwright tests on ${devServerUrl}`);
|
|
231
|
-
const { runContractTestsPlaywright } = await import('./contractTestRunnerPlaywright-
|
|
231
|
+
const { runContractTestsPlaywright } = await import('./contractTestRunnerPlaywright-AZ4QKLYT.js');
|
|
232
232
|
contract = await runContractTestsPlaywright(componentName, devServerUrl, strictness, config, configBaseDir);
|
|
233
233
|
} else {
|
|
234
234
|
throw new Error(
|
|
@@ -240,7 +240,7 @@ Error: ${error instanceof Error ? error.message : String(error)}`
|
|
|
240
240
|
const devServerUrl = await checkDevServer(url);
|
|
241
241
|
if (devServerUrl) {
|
|
242
242
|
console.log(`\u{1F3AD} Running Playwright tests on ${devServerUrl}`);
|
|
243
|
-
const { runContractTestsPlaywright } = await import("./contractTestRunnerPlaywright-
|
|
243
|
+
const { runContractTestsPlaywright } = await import("./contractTestRunnerPlaywright-47DCBO4A.js");
|
|
244
244
|
contract = await runContractTestsPlaywright(componentName, devServerUrl, strictness, config, configBaseDir);
|
|
245
245
|
} else {
|
|
246
246
|
throw new Error(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aria-ease",
|
|
3
|
-
"version": "6.12.
|
|
3
|
+
"version": "6.12.2",
|
|
4
4
|
"description": "Accessibility infrastructure for the entire frontend engineering lifecycle. Build accessible patterns, run automated audits, verify component interactions, and gate deployments — all in one system.",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"type": "module",
|