[UA] Fix a11y test (#122539) (#122923)

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit cce8091d5c)

Co-authored-by: Yulia Čech <6585477+yuliacech@users.noreply.github.com>
This commit is contained in:
Kibana Machine 2022-01-13 07:54:37 -05:00 committed by GitHub
parent ee0ca1b47d
commit ca31b15f6d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 1 deletions

View file

@ -96,11 +96,22 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
});
it('with logs collection disabled', async () => {
const loggingEnabled = await PageObjects.upgradeAssistant.isDeprecationLoggingEnabled();
if (loggingEnabled) {
await PageObjects.upgradeAssistant.clickDeprecationLoggingToggle();
}
await retry.waitFor('Deprecation logging to be disabled', async () => {
return !(await PageObjects.upgradeAssistant.isDeprecationLoggingEnabled());
});
await a11y.testAppSnapshot();
});
it('with logs collection enabled', async () => {
await PageObjects.upgradeAssistant.clickDeprecationLoggingToggle();
const loggingEnabled = await PageObjects.upgradeAssistant.isDeprecationLoggingEnabled();
if (!loggingEnabled) {
await PageObjects.upgradeAssistant.clickDeprecationLoggingToggle();
}
await retry.waitFor('UA external links title to be present', async () => {
return testSubjects.isDisplayed('externalLinksTitle');

View file

@ -56,6 +56,10 @@ export class UpgradeAssistantPageObject extends FtrService {
});
}
async isDeprecationLoggingEnabled(): Promise<boolean> {
return await this.testSubjects.exists('externalLinksTitle');
}
async clickResetLastCheckpointButton() {
return await this.retry.try(async () => {
await this.testSubjects.click('resetLastStoredDate');