mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
Comprehensive discover a11y tests Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This commit is contained in:
parent
5986c82a06
commit
e9fc194ac5
4 changed files with 90 additions and 7 deletions
|
@ -346,6 +346,9 @@ class SavedObjectFinderUi extends React.Component<
|
|||
placeholder={i18n.translate('kibana-react.savedObjects.finder.searchPlaceholder', {
|
||||
defaultMessage: 'Search…',
|
||||
})}
|
||||
aria-label={i18n.translate('kibana-react.savedObjects.finder.searchPlaceholder', {
|
||||
defaultMessage: 'Search…',
|
||||
})}
|
||||
fullWidth
|
||||
value={this.state.query}
|
||||
onChange={e => {
|
||||
|
|
|
@ -20,10 +20,12 @@
|
|||
import { FtrProviderContext } from '../ftr_provider_context';
|
||||
|
||||
export default function({ getService, getPageObjects }: FtrProviderContext) {
|
||||
const PageObjects = getPageObjects(['common', 'timePicker']);
|
||||
const PageObjects = getPageObjects(['common', 'discover', 'header', 'share', 'timePicker']);
|
||||
const a11y = getService('a11y');
|
||||
const esArchiver = getService('esArchiver');
|
||||
const kibanaServer = getService('kibanaServer');
|
||||
const inspector = getService('inspector');
|
||||
const filterBar = getService('filterBar');
|
||||
|
||||
describe('Discover', () => {
|
||||
before(async () => {
|
||||
|
@ -39,5 +41,73 @@ export default function({ getService, getPageObjects }: FtrProviderContext) {
|
|||
it('main view', async () => {
|
||||
await a11y.testAppSnapshot();
|
||||
});
|
||||
|
||||
it('Click save button', async () => {
|
||||
await PageObjects.discover.clickSaveSearchButton();
|
||||
await a11y.testAppSnapshot();
|
||||
});
|
||||
|
||||
it('Save search panel', async () => {
|
||||
await PageObjects.discover.inputSavedSearchTitle('a11ySearch');
|
||||
await a11y.testAppSnapshot();
|
||||
});
|
||||
|
||||
it('Confirm saved search', async () => {
|
||||
await PageObjects.discover.clickConfirmSavedSearch();
|
||||
await a11y.testAppSnapshot();
|
||||
});
|
||||
|
||||
// skipping the test for new because we can't fix it right now
|
||||
it.skip('Click on new to clear the search', async () => {
|
||||
await PageObjects.discover.clickNewSearchButton();
|
||||
await a11y.testAppSnapshot();
|
||||
});
|
||||
|
||||
it('Open load saved search panel', async () => {
|
||||
await PageObjects.discover.openLoadSavedSearchPanel();
|
||||
await a11y.testAppSnapshot();
|
||||
await PageObjects.discover.closeLoadSavedSearchPanel();
|
||||
});
|
||||
|
||||
it('Open inspector panel', async () => {
|
||||
await inspector.open();
|
||||
await a11y.testAppSnapshot();
|
||||
await inspector.close();
|
||||
});
|
||||
|
||||
it('Open add filter', async () => {
|
||||
await PageObjects.discover.openAddFilterPanel();
|
||||
await a11y.testAppSnapshot();
|
||||
});
|
||||
|
||||
it('Select values for a filter', async () => {
|
||||
await filterBar.addFilter('extension.raw', 'is one of', 'jpg');
|
||||
await a11y.testAppSnapshot();
|
||||
});
|
||||
|
||||
it('Load a new search from the panel', async () => {
|
||||
await PageObjects.discover.clickSaveSearchButton();
|
||||
await PageObjects.discover.inputSavedSearchTitle('filterSearch');
|
||||
await PageObjects.discover.clickConfirmSavedSearch();
|
||||
await PageObjects.discover.openLoadSavedSearchPanel();
|
||||
await PageObjects.discover.loadSavedSearch('filterSearch');
|
||||
await a11y.testAppSnapshot();
|
||||
});
|
||||
|
||||
// unable to validate on EUI pop-over
|
||||
it('click share button', async () => {
|
||||
await PageObjects.share.clickShareTopNavButton();
|
||||
await a11y.testAppSnapshot();
|
||||
});
|
||||
|
||||
it('Open sidebar filter', async () => {
|
||||
await PageObjects.discover.openSidebarFieldFilter();
|
||||
await a11y.testAppSnapshot();
|
||||
});
|
||||
|
||||
it('Close sidebar filter', async () => {
|
||||
await PageObjects.discover.closeSidebarFieldFilter();
|
||||
await a11y.testAppSnapshot();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
@ -45,7 +45,6 @@ export const normalizeResult = (report: any) => {
|
|||
export function A11yProvider({ getService }: FtrProviderContext) {
|
||||
const browser = getService('browser');
|
||||
const Wd = getService('__webdriver__');
|
||||
const log = getService('log');
|
||||
|
||||
/**
|
||||
* Accessibility testing service using the Axe (https://www.deque.com/axe/)
|
||||
|
@ -78,11 +77,6 @@ export function A11yProvider({ getService }: FtrProviderContext) {
|
|||
private testAxeReport(report: AxeReport) {
|
||||
const errorMsgs = [];
|
||||
|
||||
for (const result of report.incomplete) {
|
||||
// these items require human review and can't be definitively validated
|
||||
log.warning(printResult(chalk.yellow('UNABLE TO VALIDATE'), result));
|
||||
}
|
||||
|
||||
for (const result of report.violations) {
|
||||
errorMsgs.push(printResult(chalk.red('VIOLATION'), result));
|
||||
}
|
||||
|
|
|
@ -63,6 +63,18 @@ export function DiscoverPageProvider({ getService, getPageObjects }) {
|
|||
});
|
||||
}
|
||||
|
||||
async inputSavedSearchTitle(searchName) {
|
||||
await testSubjects.setValue('savedObjectTitle', searchName);
|
||||
}
|
||||
|
||||
async clickConfirmSavedSearch() {
|
||||
await testSubjects.click('confirmSaveSavedObjectButton');
|
||||
}
|
||||
|
||||
async openAddFilterPanel() {
|
||||
await testSubjects.click('addFilter');
|
||||
}
|
||||
|
||||
async waitUntilSearchingHasFinished() {
|
||||
const spinner = await testSubjects.find('loadingSpinner');
|
||||
await find.waitForElementHidden(spinner, defaultFindTimeout * 10);
|
||||
|
@ -117,6 +129,10 @@ export function DiscoverPageProvider({ getService, getPageObjects }) {
|
|||
await testSubjects.click('discoverOpenButton');
|
||||
}
|
||||
|
||||
async closeLoadSavedSearchPanel() {
|
||||
await testSubjects.click('euiFlyoutCloseButton');
|
||||
}
|
||||
|
||||
async getChartCanvas() {
|
||||
return await find.byCssSelector('.echChart canvas:last-of-type');
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue