This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
api_reference.yaml
1076 lines (929 loc) · 38.3 KB
/
api_reference.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# Copyright 2020-2021 VMware, Inc.
# SPDX-License-Identifier: MIT
openapi: '3.0.2'
info:
title: Crest
version: '1.0.0'
description: |
Crest quickly tests any HTML web page for a simple way to solve your accessibility testing problems. Provide a website URL to our callable API and expose potential WCAG violations.
<hr />
## Getting Started with Crest in 5 Minutes
To get you started quickly let’s dive into the necessary steps needed to set up the environment.
### To use Crest as a Python Library
#### Using Pip
1. Install Crest using python package manager (Make sure pip is installed in your system).
```python
pip install pythoncrest
```
### To use Crest as a Service
#### Using Conda
1. Download and Install Miniconda from [conda.io](https://docs.conda.io/en/latest/miniconda.html)
2. For Windows, launch Miniconda prompt shell. For MacOS, launch the terminal.
3. Clone the Crest repository. More details can be found at [docs.github.com](https://docs.github.com/en/free-pro-team@latest/github/creating-cloning-and-archiving-repositories/cloning-a-repository)
4. Go to "crest" folder in your terminal/prompt shell. Run command.
```python
conda env create -f environment.yml
conda activate crest
```
5. Install chromedriver. The details can be found in [chromium.org](https://chromedriver.chromium.org/downloads).
6. Download and Install google-chrome-stable from [ubuntuupdates.org](https://www.ubuntuupdates.org/package/google_chrome/stable/main/base/google-chrome-stable).
7. Once all the required libraries are installed, go to 'src/crest' folder and run the below command in your terminal/prompt shell.
```python
FLASK_APP=server.py FLASK_ENV=development flask run --port 3000 --host 0.0.0.0
```
#### Using Docker
1. Clone the repository. More details can be found at [docs.github.com](https://docs.github.com/en/free-pro-team@latest/github/creating-cloning-and-archiving-repositories/cloning-a-repository).
2. Download and Install docker from [docker.com](https://docs.docker.com/get-docker/). Note: Make sure your docker server as well as crest image is running.
3. Go to "crest" folder in your terminal/prompt shell. Run command.
```python
docker build -t crest .
```
4. Once the docker image is created, run it by executing the following command.
```python
docker container run --name crest_container -p 3000:3000 crest
```
**Note: A machine learning model will be downloaded from [huggingface.co](https://huggingface.co/gargam/roberta-base-crest) when you use the Heading Analysis/ Crest Single API for the first time. It will be saved in your system's cache for future use and could take approximately 2 GB of your system's memory.**
termsOfService: "https://github.com/vmware/crest/blob/main/LICENSE"
contact:
name: "API developer"
email: "[email protected]"
license:
name: "MIT"
url: "https://github.com/vmware/crest/blob/main/LICENSE"
servers:
- url: "http://{server-ip}:{port}/"
description: "Development Server"
variables:
server-ip:
default: localhost
description: If the server is spinned up in your local environment
port:
default: '3000'
components:
schemas:
issue_item:
type: object
description: A JSON object that contains information about the issue.
required:
- "count"
- "description"
- "id"
- "level"
properties:
count:
type: integer
format: int32
description: Represents the count of the issue.
description:
type: string
description: Brief description of the issue.
id:
type: string
description: Issue ID name given by Crest.
level:
type: string
description: Refers to the conformance level defined by WCAG.
xpaths:
type: array
description: Location of failed elements identified by paths and css selectors. Default is xpaths. However, the key i.e. "xpaths" will be changed to "selectors" if reporttype 4 is given.
failure_status:
type: object
description: A JSON object represents the type of exception that occurred.
required:
- "error"
- "success"
properties:
error:
type: string
description: Type of exception occured in the server.
success:
type: string
description: "'true' indicates successful execution of script to test page. 'false' indicates that the page is not testable."
failure_response:
type: object
description: A JSON object that provides details about the failure response.
required:
- "status"
properties:
status:
$ref: '#/components/schemas/failure_status'
success_status:
type: object
description: A JSON object that provides details about the success response.
required:
- "httpstatuscode"
- "success"
properties:
httpstatuscode:
type: integer
description: Status code recieved from the server.
success:
type: string
description: "'true' indicates successful execution of script to test page. 'false' indicates that the page is not testable."
focus_indicator_items:
type: object
description: List of Issue IDs that are checked by the Keyboard Focus Indicator Functionality.
properties:
cr_focus_low:
$ref: '#/components/schemas/issue_item'
cr_focus_missing:
$ref: '#/components/schemas/issue_item'
focus_indicator_errors:
type: object
description: Error details related to the Focus Indicator Issue IDs.
properties:
count:
description: Represents the count of the issue.
type: integer
description:
description: A brief description of the error.
type: string
items:
$ref: '#/components/schemas/focus_indicator_items'
focus_indicator_categories:
type: object
description: Identifies type of issue (errors or alerts).
properties:
error:
$ref: '#/components/schemas/focus_indicator_errors'
focus_indicator_statistics:
type: object
description: Statistics details related to the Focus Indicator Functionality.
required:
- "allitemcount"
- "pageurl"
- "time"
- "totalelements"
properties:
allitemcount:
type: integer
description: Total number of elements that are having issues.
pageurl:
type: string
description: The URL that has been tested.
time:
type: number
description: Time taken to perform the testing.
totalelements:
type: integer
description: Total elements that has been tested.
focus_indicator_success_response:
type: object
description: A JSON object that contains information of the Focus Indicator success response.
required:
- categories
- statistics
- status
properties:
categories:
$ref: '#/components/schemas/focus_indicator_categories'
statistics:
$ref: '#/components/schemas/focus_indicator_statistics'
status:
$ref: '#/components/schemas/success_status'
cc_transcript_issue_item:
type: object
description: A JSON object that contains information of the CC and Transcript check Issue Item.
required:
- "count"
- "description"
- "id"
- "level"
properties:
count:
type: integer
format: int32
description: Represents the count of the issue.
description:
type: string
description: Brief description of the issue.
id:
type: string
description: Issue ID name given by Crest.
level:
type: string
description: Refers to the conformance level defined by WCAG.
cc_transcript_statistics:
type: object
description: Statistics details related to the CC and Transcript Functionality.
required:
- "allitemcount"
- "pageurl"
- "time"
- "totalelements"
- "totalaudios"
- "totalvideos"
properties:
allitemcount:
type: integer
description: Total number of elements that are having issues.
pageurl:
type: string
description: The URL that has been tested.
time:
type: number
description: Time taken to perform the testing.
totalelements:
type: integer
description: Total elements that has been tested.
totalaudios:
type: integer
description: Total audios that are present on the webpage.
totalvideos:
type: integer
description: Total videos that are present on the webpage.
cc_transcript_items:
type: object
description: A JSON object represents issues related to the Closed Captioning and Transcript check.
properties:
cr_captions_missing:
$ref: '#/components/schemas/cc_transcript_issue_item'
cr_transcript_missing:
$ref: '#/components/schemas/cc_transcript_issue_item'
cc_transcript_errors:
type: object
description: Error details related to the CC and Transcript Issue IDs.
properties:
count:
description: Number of errors
type: integer
description:
description: Description of the error
type: string
items:
$ref: '#/components/schemas/cc_transcript_items'
cc_transcript_categories:
type: object
description: Identifies type of issue (errors or alerts).
properties:
error:
$ref: '#/components/schemas/cc_transcript_errors'
cc_transcript_success_response:
type: object
description: A JSON object that contains information of the CC and Transcript success response.
required:
- categories
- statistics
- status
properties:
categories:
$ref: '#/components/schemas/cc_transcript_categories'
statistics:
$ref: '#/components/schemas/cc_transcript_statistics'
status:
$ref: '#/components/schemas/success_status'
heading_analysis_statistics:
type: object
description: Statistics details related to the Heading Analysis Functionality.
required:
- "allitemcount"
- "pageurl"
- "time"
- "totalelements"
properties:
allitemcount:
type: integer
description: Total number of elements that are having issues.
pageurl:
type: string
description: The URL that has been tested.
time:
type: number
description: Time taken to perform the testing.
totalelements:
type: integer
description: Total elements that has been tested.
heading_analysis_items:
type: object
description: A JSON object represents issues related to the Heading Analysis check.
properties:
cr_heading_unrelated:
$ref: '#/components/schemas/issue_item'
heading_analysis_alerts:
type: object
description: Alert details related to the Heading Analysis Issue IDs.
properties:
count:
description: Represents the number of alerts
type: integer
description:
description: A brief description of the alert.
type: string
items:
$ref: '#/components/schemas/heading_analysis_items'
heading_analysis_categories:
type: object
description: Identifies type of issue (errors or alerts).
properties:
alert:
$ref: '#/components/schemas/heading_analysis_alerts'
heading_analysis_success_response:
type: object
description: A JSON object that contains information of the Heading Analysis success response.
required:
- categories
- statistics
- status
properties:
categories:
$ref: '#/components/schemas/heading_analysis_categories'
statistics:
$ref: '#/components/schemas/heading_analysis_statistics'
status:
$ref: '#/components/schemas/success_status'
clarity_composition_issue_item:
type: object
description: A JSON object that contains information of the Clarity composition check Issue Item.
required:
- "count"
- "description"
- "id"
- "level"
properties:
count:
type: integer
format: int32
description: Represents the count of the issue.
description:
type: string
description: Brief description of the issue.
id:
type: string
description: Issue ID name given by Crest.
clarity_composition_statistics:
type: object
description: Statistics details related to the Clarity composition Functionality.
required:
- "allitemcount"
- "pageurl"
- "time"
- "totalelements"
properties:
allitemcount:
type: integer
description: Total number of elements that are having issues.
pageurl:
type: string
description: The URL that has been tested.
time:
type: number
description: Time taken to perform the testing.
totalelements:
type: integer
description: Total Clarity Design components that have been tested.
clarity_composition_items:
type: object
description: A JSON object represents issues related to the Clarity Composition check.
additionalProperties:
$ref: '#/components/schemas/cc_transcript_issue_item'
clarity_composition_errors:
type: object
description: Error details related to the Clarity composition issue.
properties:
count:
description: Number of errors
type: integer
description:
description: Description of the error
type: string
items:
$ref: '#/components/schemas/clarity_composition_items'
clarity_composition_categories:
type: object
description: Identifies type of issue (errors or alerts).
properties:
error:
$ref: '#/components/schemas/clarity_composition_errors'
clarity_composition_success_response:
type: object
description: A JSON object that contains information of the Clarity Composition success response.
required:
- categories
- statistics
- status
properties:
categories:
$ref: '#/components/schemas/clarity_composition_categories'
statistics:
$ref: '#/components/schemas/clarity_composition_statistics'
status:
$ref: '#/components/schemas/success_status'
request_body:
type: object
description: |
The request body contains a parameter "url" that a user wants to test the WCAG violations on. The "reporttype" parameter represents the type of locator a user wants in return.
required:
- url
properties:
url:
description: A URL to check WCAG violations on. It should be a valid URL.
type: string
reporttype:
description: "reporttype is either xpath(value: 3) or css selector(value: 4)"
type: integer
crest_error_items:
type: object
description: Error Issue IDs details related to Crest.
properties:
cr_focus_low:
$ref: '#/components/schemas/issue_item'
cr_focus_missing:
$ref: '#/components/schemas/issue_item'
cr_captions_missing:
$ref: '#/components/schemas/cc_transcript_issue_item'
cr_transcript_missing:
$ref: '#/components/schemas/cc_transcript_issue_item'
crest_errors:
type: object
description: Details related to Error that contains count, description, etc.
properties:
count:
description: Represents the count of the errors.
type: integer
description:
description: Description of the error
type: string
items:
$ref: '#/components/schemas/crest_error_items'
crest_alert_items:
type: object
description: Alert Issue IDs details related to Crest.
properties:
cr_heading_unrelated:
$ref: '#/components/schemas/issue_item'
crest_alerts:
type: object
description: Details related to Alert that contains count, description, etc.
properties:
count:
description: Represents the count of the alerts.
type: integer
description:
description: A brief description of the alert.
type: string
items:
$ref: '#/components/schemas/crest_alert_items'
crest_categories:
type: object
description: Identifies type of issue (errors or alerts).
properties:
alert:
$ref: '#/components/schemas/crest_alerts'
error:
$ref: '#/components/schemas/crest_errors'
crest_statistics:
type: object
description: Statistics details related to Crest.
required:
- "allitemcount"
- "pageurl"
- "time"
- "totalelements"
- "totalaudios"
- "totalvideos"
properties:
allitemcount:
type: integer
description: Total number of elements that are having issues.
pageurl:
type: string
description: The URL that has been tested.
time:
type: number
description: Time taken to perform the testing.
totalelements:
type: integer
description: Total elements that has been tested.
totalaudios:
type: integer
description: Total audios that are present on the webpage.
totalvideos:
type: integer
description: Total videos that are present on the webpage.
crest_success_response:
type: object
description: A JSON object that contains information of Crest's success response.
required:
- categories
- statistics
- status
properties:
categories:
$ref: '#/components/schemas/crest_categories'
statistics:
$ref: '#/components/schemas/crest_statistics'
status:
$ref: '#/components/schemas/success_status'
tags:
- name: "Perceivable"
description: Information and user interface components must be presentable to users in ways they can perceive.
- name: "Operable"
description: User interface components and navigation must be operable.
- name: "Understandable"
description: Information and the operation of user interface must be understandable.
- name: "Robust"
description: Content must be robust enough that it can be interpreted by by a wide variety of user agents, including assistive technologies.
- name: "TestMePage"
description: TestMePage is to test any functionality on this page to ensure the right working of APIs.
- name: "Test All"
description: APIs that can test multiple functionalities in a single API call.
paths:
/crest/api/all:
post:
operationId: all
tags:
- "Test All"
summary: "Single API to test all functionalities provided by Crest"
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/request_body'
example:
url: "http://www.abc.com"
reporttype: 3
required: true
responses:
'200':
description: The Success response contains `categories` that aggregate all the Error and Alert related issues.
content:
application/json:
schema:
$ref: '#/components/schemas/crest_success_response'
example:
categories:
alert:
count: 1
description: "Alerts"
items:
cr_heading_unrelated:
count: 1
description: "Possibly unrelated heading"
id: "cr_heading_unrelated"
level: "AA"
xpaths: ['/html[1]/body[1]/div[1]/a[1]']
error:
count: 4
description: "Errors"
items:
cr_focus_low:
count: 1
description: "Low contrast on Focus"
id: "cr_focus_low"
level: "AA"
xpaths: ['/html[1]/body[1]/div[1]/a[1]']
cr_focus_missing:
count: 1
description: "Focus not visible"
id: "cr_focus_missing"
level: "AA"
xpaths: ['/html[1]/body[1]/div[1]/a[1]']
cr_captions_missing:
count: 1
description: "Captions missing"
id: "cr_captions_missing"
level: "A"
cr_transcript_missing:
count: 1
description: "Podcast transcript missing"
id: "cr_transcript_missing"
level: "A"
statistics:
allitemcount: 5
pageurl: "http://www.abc.com"
time: 5.13
totalelements: 60
totalaudios: 1
totalvideos: 1
status:
httpstatuscode: 200
success: "True"
'400':
description: Bad Request, missing something, or the request body wasn't correct.
content:
application/json:
schema:
$ref: '#/components/schemas/failure_response'
example:
status:
error: Failed with exception [WebDriverException]
success: "false"
description: |
Crest can perform multiple tests in a single API call. It checks WCAG violations on a webpage and provides XPaths/CSS selectors of the violated elements. It currently supports the following functionalities and their detailed information can be found on their documentation page.
1. [Keyboard Focus Indicator](../../perceivable/keyboard-focus-indicator/post/)
2. [Closed Captioning and Transcript](../../perceivable/cc-transcript/post/)
3. [Heading Analysis](../../operable/heading-analysis/post/)
/crest/api/perceivable/keyboard-focus-indicator:
post:
operationId: keyboardFocusIndicator
tags:
- "Perceivable"
summary: "This API tests all focusable elements on a webpage by comparing the color contrast between the keyboard focus indicator and the component itself in its active vs. inactive states."
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/request_body'
example:
url: "http://www.abc.com"
reporttype: 3
required: true
responses:
'200':
description: The Success response contains `categories` that aggregate all the Error and Alert related issues.
content:
application/json:
schema:
$ref: '#/components/schemas/focus_indicator_success_response'
example:
categories:
error:
count: 2
description: "Errors"
items:
cr_focus_low:
count: 1
description: "Low contrast on Focus"
id: "cr_focus_low"
level: "AA"
xpaths: ['/html[1]/body[1]/div[1]/a[1]']
cr_focus_missing:
count: 1
description: "Focus not visible"
id: "cr_focus_missing"
level: "AA"
xpaths: ['/html[1]/body[1]/div[1]/a[2]']
statistics:
allitemcount: 2
pageurl: "http://www.abc.com"
time: 5.13
totalelements: 60
status:
httpstatuscode: 200
success: "True"
'400':
description: Bad Request, missing something, or the request body wasn't correct.
content:
application/json:
schema:
$ref: '#/components/schemas/failure_response'
example:
status:
error: Failed with exception [WebDriverException]
success: "false"
description: |
This API tests all focusable elements on a webpage by comparing the color contrast between the keyboard focus indicator and the component itself in its active vs. inactive states. It covers the following Issue IDs:
**Issue ID: cr_focus_low**
*Definition*
When active interface controls (buttons, links, forms, page tabs, etc.) receive keyboard focus, the visual focus indicator does not meet the required color contrast ratio of at least 3:1.
*User Impact*
Low-vision users may have trouble seeing the visual keyboard focus indicator and may not be able to orient themselves on the page to effectively navigate content. Colorblind users may also be affected.
*Recommendation*
Ensure that the visual keyboard focus indicator provides a sufficient color contrast ratio of at least 3:1 with adjacent colors (background and/or the control colors). Possible solutions include: using the CSS outline property to provide an outline around the focused element, and inverting the foreground and background colors.
*Success Criterion*
1.4.11 Non-text Contrast (Level AA)
*Related Success Criteria (if applicable):*
2.4.7 Focus Visible (Level AA)
More details can be found at [Understanding Success Criterion 1.4.11](https://www.w3.org/WAI/WCAG21/Understanding/non-text-contrast.html).
**Issue ID: cr_focus_missing**
*Definition*
There is no visual keyboard focus indication when using TAB or SHIFT+TAB, and/or arrow keys (when applicable) to navigate through the controls (buttons, links, forms, page tabs, etc.) of the website.
*User Impact*
Sighted keyboard-only users are not able to orient themselves on the page and will not be able to effectively navigate content.
*Recommendation*
All interactive content must provide a visual indication of keyboard focus. Focus can be provided in a number of ways including change background, invert colors, border, outline, and other visual methods. Avoid the use of the "outline: none" CSS property.
*Success Criterion*
2.4.7 Focus Visible (Level AA)
*Related Success Criteria (if applicable):*
1.4.11 Non-text Contrast (Level AA)
More details can be found at [Understanding Success Criterion 2.4.7](https://www.w3.org/WAI/WCAG21/Understanding/focus-visible.html).
/crest/api/perceivable/cc-transcript:
post:
operationId: ccAndTranscript
tags:
- "Perceivable"
summary: "This API’s task is to check for missing captions or transcripts associated with embedded videos and audio files on a webpage."
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/request_body'
example:
url: "http://www.abc.com"
reporttype: 3
required: true
responses:
'200':
description: The Success response contains `categories` that aggregate all the Error and Alert related issues.
content:
application/json:
schema:
$ref: '#/components/schemas/cc_transcript_success_response'
example:
categories:
error:
count: 2
description: "Errors"
items:
cr_captions_missing:
count: 1
description: "Captions missing"
id: "cr_captions_missing"
level: "A"
cr_transcript_missing:
count: 1
description: "Podcast transcript missing"
id: "cr_transcript_missing"
level: "A"
statistics:
allitemcount: 2
pageurl: "http://www.abc.com"
time: 5.13
totalelements: 2
totalaudios: 1
totalvideos: 1
status:
httpstatuscode: 200
success: "True"
'400':
description: Bad Request, missing something, or the request body wasn't correct.
content:
application/json:
schema:
$ref: '#/components/schemas/failure_response'
example:
status:
error: Failed with exception [WebDriverException]
success: "false"
description: |
This API’s task is to check for missing captions or transcripts associated with embedded videos and audio files on a webpage. It covers the following Issue IDs:
**Issue ID: cr_transcript_missing**
*Definition*
Audio-only content such as podcasts and audio recordings of speeches and press conferences are not made available by transcript.
*User Impact*
When transcripts are provided for audio-only content, people who are deaf or deaf-blind will have access to the information visually or through the use of electronic braille.
*Recommendation*
Provide a transcript for audio-only content.
*Success Criterion*
1.2.1 Prerecorded Audio-only and Video-only (Level A)
*Related Success Criteria (if applicable):*
1.2.3 Audio Description or Media Alternative (Prerecorded) (Level A)
More details can be found at [Understanding Success Criterion 1.2.1](https://www.w3.org/WAI/WCAG21/Understanding/audio-only-and-video-only-prerecorded.html).
**Issue ID: cr_captions_missing**
*Definition*
Synchronized captions are not provided for video or other multimedia content that contains audio.
*User Impact*
Users who are deaf or hard of hearing will not have access to important information conveyed in audio. Captions also provide an enhanced experience for users with cognitive differences such as ADHD or learning disabilities. Additionally, captions are useful in certain situations such as environments with loud background noise or situations where sound is not allowed (e.g. the library without headphones, or near a sleeping baby).
*Recommendation*
Provide captions for all important audio information in video and multimedia content.
*Success Criterion*
1.2.2 Captions (Prerecorded) (Level A)
*Related Success Criteria (if applicable):*
2.2.2 Pause, Stop, Hide (Level A) <br />
1.1.1 Non-text Content (Level A)
More details can be found at [Understanding Success Criterion 1.2.2](https://www.w3.org/TR/UNDERSTANDING-WCAG20/media-equiv-captions.html).
/crest/api/operable/heading-analysis:
post:
operationId: headingAnalysis
tags:
- "Operable"
summary: "This API uses machine learning models and inspects whether the text below each heading is related to the heading content or not."
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/request_body'
example:
url: "http://www.abc.com"
reporttype: 3
required: true
responses:
'200':
description: The Success response contains `categories` that aggregate all the Error and Alert related issues.
content:
application/json:
schema:
$ref: '#/components/schemas/heading_analysis_success_response'
example:
categories:
alert:
count: 1
description: "Alerts"
items:
cr_heading_unrelated:
count: 1
description: "Possibly unrelated heading"
id: "cr_heading_unrelated"
level: "AA"
xpaths: ['/html[1]/body[1]/div[1]/a[1]']
statistics:
allitemcount: 1
pageurl: "http://www.abc.com"
time: 5.13
totalelements: 60
status:
httpstatuscode: 200
success: "True"
'400':
description: Bad Request, missing something, or the request body wasn't correct.
content:
application/json:
schema:
$ref: '#/components/schemas/failure_response'
example:
status:
error: Failed with exception [WebDriverException]
success: "false"
description: |
This API uses machine learning models and inspects whether the text below each heading is related to the heading content or not. It covers the following Issue IDs:
**Issue ID: cr_heading_unrelated**
*Definition*
The content immediately following a heading identified by machine learning is possibly unrelated to the topic or purpose.
*User Impact*
Blind screen reader users rely on headings to navigate page content. When headings are misleading and do not reflect the topic or purpose, users can become disoriented and have difficulty navigating the page. Users with learning differences may also have difficulty understanding page content when headings are unrelated to content.
*Recommendation*
Provide clear and descriptive headings that accurately describe the immediatley following content.
*Success Criterion*
2.4.6 Headings and Labels (Level AA)
*Related Success Criteria (if applicable):*
1.3.1 Info and Relationships (Level A)
More details can be found at [Understanding Success Criterion 2.4.6](https://www.w3.org/TR/UNDERSTANDING-WCAG20/navigation-mechanisms-descriptive.html).
/crest/api/composition/clarity:
post:
operationId: clarityComposition
tags:
- "Composition"
summary: "This API's task is to check for disallowed composition of Clarity Design components."
requestBody:
content: