[Accessibility] A <label> for time bucket size selector on discover (#38396)

* Replace <span> with a <label for=''> used as a label for a dropdown <select>
* Change CSS selector for functional test
This commit is contained in:
Philipp B 2019-06-12 21:46:10 +03:00 committed by GitHub
parent f877c78e95
commit 722559129d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View file

@ -129,16 +129,18 @@
>
<header class="dscTimechart__header">
<div class="small">
<span
<label
for="dscResultsIntervalSelector"
tooltip="{{::'kbn.discover.howToChangeTheTimeTooltip' | i18n: {defaultMessage: 'To change the time, click the clock icon in the navigation bar'} }}"
>
{{toMoment(timeRange.from)}} - {{toMoment(timeRange.to)}}
</span>
</label>
&mdash;
<span class="form-inline">
<select
id="dscResultsIntervalSelector"
class="dscResults__interval form-control"
ng-model="state.interval"
ng-options="interval.val as interval.display for interval in intervalOptions | filter: intervalEnabled"

View file

@ -41,7 +41,7 @@ export function DiscoverPageProvider({ getService, getPageObjects }) {
}
async getChartTimespan() {
const el = await find.byCssSelector('.small > span:nth-child(1)');
const el = await find.byCssSelector('.small > label[for="dscResultsIntervalSelector"]');
return await el.getVisibleText();
}