@@ -8,6 +8,61 @@ declare module "spectron" {
8
8
import * as Electron from "electron" ;
9
9
import * as WebdriverIO from "webdriverio" ;
10
10
11
+ interface AccessibilityAuditOptions {
12
+ /**
13
+ * true to ignore failures with a severity of 'Warning' and only
14
+ * include failures with a severity of 'Severe'. Defaults to false.
15
+ */
16
+ ignoreWarnings ?:boolean ;
17
+
18
+ /**
19
+ * Rule code values such as AX_COLOR_01 to ignore failures for.
20
+ */
21
+ ignoreRules ?:string [ ] ;
22
+ }
23
+
24
+ interface AccessibilityAuditResult {
25
+ /**
26
+ * False when the audit has failures
27
+ */
28
+ failed :boolean ;
29
+
30
+ /**
31
+ * A detailed message about the results
32
+ */
33
+ message :string ;
34
+
35
+ /**
36
+ * An array of detail objects for each failed rule
37
+ */
38
+ results :{
39
+ /**
40
+ * A unique accessibility rule identifier
41
+ */
42
+ code :string ;
43
+
44
+ /**
45
+ * Selector path of each HTML element that failed the rule
46
+ */
47
+ elements :string [ ] ;
48
+
49
+ /**
50
+ * A String message about the failed rule
51
+ */
52
+ message :string ;
53
+
54
+ /**
55
+ * 'Warning' or 'Severe'
56
+ */
57
+ severity :'Warning' | 'Severe' ;
58
+
59
+ /**
60
+ * URL providing more details about the failed rule
61
+ */
62
+ url :string ;
63
+ } [ ] ;
64
+ }
65
+
11
66
export interface SpectronClient extends WebdriverIO . Client < void > {
12
67
/**
13
68
* Focus a window using its title or URL.
@@ -50,6 +105,11 @@ declare module "spectron" {
50
105
* The logs are cleared after they are returned.
51
106
*/
52
107
getMainProcessLogs ( ) :Promise < string [ ] > ;
108
+
109
+ /**
110
+ * Run an accessibility audit in the focused window with the specified options.
111
+ */
112
+ auditAccessibility ( options ?:AccessibilityAuditOptions ) :Promise < AccessibilityAuditResult > ;
53
113
}
54
114
55
115
export interface SpectronWindow extends Electron . BrowserWindow {
0 commit comments