Skip to content

Commit

Permalink
Fix button ids on discover test
Browse files Browse the repository at this point in the history
  • Loading branch information
Zacqary committed Jan 16, 2025
1 parent 42e702a commit c3b25e9
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,7 @@ export const RuleActionsConnectorsBody = ({
const connectorCard = (
<EuiCard
data-test-subj="ruleActionsConnectorsModalCard"
data-action-type-id={actionTypeId}
hasBorder
isDisabled={isDisabled}
titleSize="xs"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await testSubjects.setValue('timeWindowSizeNumber', '30');

await testSubjects.click('ruleFormStep-actions');
await retry.waitFor('actions accordion to exist', async () => {
await testSubjects.click('.index-alerting-ActionTypeSelectOption');
return await testSubjects.exists('alertActionAccordion-0');
await retry.waitFor('actions button to exist', async () => {
await testSubjects.click('ruleActionsAddActionButton');
await find.clickByCssSelector('[data-action-type-id=".index"]');
return (await testSubjects.findAll('ruleActionsItem')).length === 1;
});

await monacoEditor.waitCodeEditorReady('kibanaCodeEditor');
Expand All @@ -190,6 +191,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const ruleName = await testSubjects.getAttribute('ruleDetailsNameInput', 'value');
return ruleName === alertName;
});

await testSubjects.click('ruleFormStep-definition');
};

const openDiscoverAlertFlyout = async () => {
Expand Down Expand Up @@ -427,6 +430,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await testSubjects.click('ruleFormStep-details');
await testSubjects.click('ruleFlyoutFooterSaveButton');

await testSubjects.click('ruleFormStep-definition');
const errorElem = await testSubjects.find('esQueryAlertExpressionError');
const errorText = await errorElem.getVisibleText();
expect(errorText).to.eql('Data view should have a time field.');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await testSubjects.setValue('timeWindowSizeNumber', '30');

await testSubjects.click('ruleFormStep-actions');
await retry.waitFor('actions accordion to exist', async () => {
await testSubjects.click('.index-alerting-ActionTypeSelectOption');
return await testSubjects.exists('alertActionAccordion-0');
await retry.waitFor('actions button to exist', async () => {
await testSubjects.click('ruleActionsAddActionButton');
await find.clickByCssSelector('[data-action-type-id=".index"]');
return (await testSubjects.findAll('ruleActionsItem')).length === 1;
});

await monacoEditor.waitCodeEditorReady('kibanaCodeEditor');
Expand All @@ -215,12 +216,15 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
"context_link": "{{context.link}}"
}`);

await testSubjects.click('ruleFormStep-details');
await retry.waitFor('rule name value is correct', async () => {
await testSubjects.click('ruleFormStep-details');

await testSubjects.setValue('ruleDetailsNameInput', alertName);
const ruleName = await testSubjects.getAttribute('ruleDetailsNameInput', 'value');
return ruleName === alertName;
});

await testSubjects.click('ruleFormStep-definition');
};

const openDiscoverAlertFlyout = async () => {
Expand Down Expand Up @@ -464,6 +468,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await testSubjects.click('ruleFormStep-details');
await testSubjects.click('ruleFlyoutFooterSaveButton');

await testSubjects.click('ruleFormStep-definition');
const errorElem = await testSubjects.find('esQueryAlertExpressionError');
const errorText = await errorElem.getVisibleText();
expect(errorText).to.eql('Data view should have a time field.');
Expand Down

0 comments on commit c3b25e9

Please sign in to comment.