Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const CUSTOM_THRESHOLD_RULE_TYPE_SELECTOR = 'observability.rules.custom_threshol
export function ObservabilityAlertsRulesProvider({ getService }: FtrProviderContext) {
const testSubjects = getService('testSubjects');
const find = getService('find');
const log = getService('log');

const getManageRulesPageHref = async () => {
const manageRulesPageButton = await testSubjects.find('manageRulesPageButton');
Expand All @@ -21,6 +22,7 @@ export function ObservabilityAlertsRulesProvider({ getService }: FtrProviderCont
const clickCreateRuleButton = async () => {
await testSubjects.existOrFail('createRuleButton');
const createRuleButton = await testSubjects.find('createRuleButton');
log.debug(`clicking on ${await createRuleButton.getAttribute('innerText')}`);
return await createRuleButton.click();
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default ({ getService, getPageObjects }: FtrProviderContext) => {
const logger = getService('log');
const retry = getService('retry');
const toasts = getService('toasts');
const PageObjects = getPageObjects(['header']);
const pageObjects = getPageObjects(['header']);

describe('Custom threshold rule', function () {
this.tags('includeFirefox');
Expand Down Expand Up @@ -49,6 +49,7 @@ export default ({ getService, getPageObjects }: FtrProviderContext) => {
logger,
});
await observability.alerts.common.navigateToRulesPage();
await pageObjects.header.waitUntilLoadingHasFinished();
});

after(async () => {
Expand All @@ -59,7 +60,7 @@ export default ({ getService, getPageObjects }: FtrProviderContext) => {

it('shows the custom threshold rule in the observability section', async () => {
await observability.alerts.rulesPage.clickCreateRuleButton();
await PageObjects.header.waitUntilLoadingHasFinished();
await pageObjects.header.waitUntilLoadingHasFinished();
await observability.alerts.rulesPage.clickOnObservabilityCategory();
await observability.alerts.rulesPage.clickOnCustomThresholdRule();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
import expect from 'expect';
import { FtrProviderContext } from '../../../../ftr_provider_context';

export default ({ getService, getPageObject }: FtrProviderContext) => {
const common = getPageObject('common');
export default ({ getService, getPageObjects }: FtrProviderContext) => {
const esArchiver = getService('esArchiver');
const testSubjects = getService('testSubjects');
const kibanaServer = getService('kibanaServer');
const supertest = getService('supertest');
const find = getService('find');
const logger = getService('log');
const retry = getService('retry');
const pageObjects = getPageObjects(['common', 'header']);

describe('Custom threshold preview chart', () => {
const observability = getService('observability');
Expand All @@ -34,6 +34,7 @@ export default ({ getService, getPageObject }: FtrProviderContext) => {
logger,
});
await observability.alerts.common.navigateToRulesPage();
await pageObjects.header.waitUntilLoadingHasFinished();
});

after(async () => {
Expand All @@ -46,7 +47,7 @@ export default ({ getService, getPageObject }: FtrProviderContext) => {
await observability.alerts.rulesPage.clickCreateRuleButton();
await observability.alerts.rulesPage.clickOnObservabilityCategory();
await observability.alerts.rulesPage.clickOnCustomThresholdRule();
await common.sleep(1000);
await pageObjects.common.sleep(1000);
expect(await find.existsByCssSelector('[data-rendering-count="2"]')).toBe(true);
});

Expand Down