Skip to content

Commit fccddbb

Browse files
authored
Ansarmie/v3/accessibility labels roles tootips (#973)
* Fix several Accessibility bugs including Tooltip behavior and Non present labels and roles * Fix every name, Focus Tooltip and Role * Fix Selenium IDE Controls title overlapping the controls in small screen sizes * Fix linting errors * Fix Google link test * Undo unnecessary change from js to jsx * Minor Lint error
1 parent 8525e30 commit fccddbb

File tree

38 files changed

+361
-71
lines changed

38 files changed

+361
-71
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,5 +63,6 @@
6363
"stylelint-prettier": "^1.0.3",
6464
"putasset": "^4.3.2",
6565
"grizzly": "^4.0.1"
66-
}
66+
},
67+
"dependencies": {}
6768
}

packages/selenium-ide/src/neo/components/ActionButtons/ActionButton/index.jsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,25 +21,32 @@ import classNames from 'classnames'
2121
import './style.css'
2222

2323
export default class ActionButton extends React.Component {
24+
static defaultProps = {
25+
'aria-label': '',
26+
}
2427
render() {
2528
const props = { ...this.props }
2629

2730
delete props.isActive
2831
return (
2932
<button
3033
type="button"
34+
data-event="focus mouseenter"
35+
data-event-off="blur mouseleave"
3136
{...props}
3237
className={classNames(
3338
'btn-action',
3439
{ active: this.props.isActive },
3540
this.props.className
3641
)}
42+
aria-label={props['aria-label']}
3743
/>
3844
)
3945
}
4046

4147
static propTypes = {
4248
className: PropTypes.string.isRequired,
4349
isActive: PropTypes.bool,
50+
'aria-label': PropTypes.string,
4451
}
4552
}

packages/selenium-ide/src/neo/components/ActionButtons/Add/index.jsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,14 @@
1616
// under the License.
1717

1818
import React from 'react'
19+
import PropTypes from 'prop-types'
1920
import ActionButton from '../ActionButton'
2021
import classNames from 'classnames'
2122

2223
export default class AddButton extends React.Component {
24+
static defaultProps = {
25+
'aria-label': 'Add',
26+
}
2327
render() {
2428
return (
2529
<ActionButton
@@ -28,4 +32,7 @@ export default class AddButton extends React.Component {
2832
/> // eslint-disable-line react/prop-types
2933
)
3034
}
35+
static propTypes = {
36+
'aria-label': PropTypes.string,
37+
}
3138
}

packages/selenium-ide/src/neo/components/ActionButtons/Clear/index.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export default class ClearButton extends React.Component {
2626
data-tip="<p>Clear log</p>"
2727
{...this.props}
2828
className={classNames('si-clear', this.props.className)}
29+
aria-label="Clear log"
2930
/> // eslint-disable-line react/prop-types
3031
)
3132
}

packages/selenium-ide/src/neo/components/ActionButtons/DisableBreakpoints/index.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ export default class DisableBreakpointsButton extends React.Component {
3030
)}</span></p>`}
3131
{...this.props}
3232
className={classNames('si-disable-breakpoints', this.props.className)}
33+
aria-label="Disable breakpoints"
3334
/> // eslint-disable-line react/prop-types
3435
)
3536
}

packages/selenium-ide/src/neo/components/ActionButtons/New/index.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ export default class NewButton extends React.Component {
3131
)}</span></p>`}
3232
{...props}
3333
className={classNames('si-new-project', this.props.className)}
34+
aria-label="Create new project"
3435
/> // eslint-disable-line react/prop-types
3536
)
3637
}

packages/selenium-ide/src/neo/components/ActionButtons/Open/index.jsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,28 @@ export class OpenInput extends React.Component {
7070
}}
7171
type="file"
7272
onChange={this.handleChange}
73+
onFocus={() => {
74+
if (this.label) {
75+
this.label.dispatchEvent(new Event('focusexternal'))
76+
}
77+
}}
78+
onBlur={() => {
79+
if (this.label) {
80+
this.label.dispatchEvent(new Event('blurexternal'))
81+
}
82+
}}
7383
/>
7484
<label
85+
ref={label => {
86+
this.label = label
87+
}}
7588
data-tip={`<p>Open project <span style="color: #929292;padding-left: 5px;">${parse(
7689
'o',
7790
{ primaryKey: true }
7891
)}</span></p>`}
92+
// We need special events because Focus and Blur are lost before the tooltip is shown
93+
data-event="focusexternal mouseenter"
94+
data-event-off="blurexternal mouseleave"
7995
htmlFor={this.id}
8096
onFocus={() => {
8197
this.input.focus()

packages/selenium-ide/src/neo/components/ActionButtons/PauseExceptions/index.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export default class PauseExceptionsButton extends React.Component {
2626
data-tip="<p>Pause on exceptions</p>"
2727
{...this.props}
2828
className={classNames('si-break-exceptions', this.props.className)}
29+
aria-label="Pause on exceptions"
2930
/> // eslint-disable-line react/prop-types
3031
)
3132
}

packages/selenium-ide/src/neo/components/ActionButtons/PlayAll/index.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ export default class PlayAllButton extends React.Component {
2828
'r',
2929
{ primaryKey: true, shiftKey: true }
3030
)}</span></p>`}
31+
aria-label="Run all tests in suite"
3132
{...this.props}
3233
className={classNames('si-play-all', this.props.className)}
3334
/> // eslint-disable-line react/prop-types

packages/selenium-ide/src/neo/components/ActionButtons/Record/index.jsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,17 @@ export default class Record extends React.Component {
4242
{ primaryKey: true }
4343
)}</span></p>`
4444
}
45+
data-event="focus mouseenter"
46+
data-event-off="blur mouseleave"
4547
>
4648
<ActionButton
4749
disabled={this.props.disabled}
4850
isActive={this.props.isRecording}
4951
onClick={this.props.onClick}
5052
className="si-record"
53+
aria-label={
54+
this.props.isRecording ? 'Stop recording' : 'Start recording'
55+
}
5156
/>
5257
</div>
5358
)

0 commit comments

Comments
 (0)