Skip to content

Commit df7ae16

Browse files
adjust select agent policy selectors (#476)
1 parent b048f6f commit df7ae16

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

__tests__/e2e/synthetics.journey.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,16 @@ async function selectAgentPolicy({ page }) {
6464
const hosts = await page.isVisible('text="Existing hosts"');
6565
if (hosts) {
6666
await page.click('text="Existing hosts"');
67-
await page.selectOption('[data-test-subj="agentPolicySelect"]', { label: 'Elastic-Agent (elastic-package)' });
67+
await page.click('[data-test-subj="agentPolicySelect"]');
68+
await page.click('text="Elastic-Agent (elastic-package)"');
69+
await page.waitForSelector('text="Elastic-Agent (elastic-package)"');
6870
}
71+
await page.click('[data-test-subj="packagePolicyNameInput"]');
6972
}
7073

7174
async function createIntegrationPolicyName({ page, policyName }) {
7275
await page.waitForSelector('[data-test-subj="packagePolicyNameInput"]', { timeout: 10000 });
7376
await page.fill('[data-test-subj="packagePolicyNameInput"]', policyName);
74-
await selectAgentPolicy({ page });
7577
}
7678

7779
async function confirmAndSavePolicy(page) {
@@ -107,6 +109,8 @@ journey('E2e test synthetics - http', async ({ page }) => {
107109
step('create an http monitor', async () => {
108110
await createIntegrationPolicyName({ page, policyName: journeyName });
109111
await page.fill('[data-test-subj="syntheticsUrlField"]', 'https://elastic.co');
112+
await selectAgentPolicy({ page });
113+
await page.click('[data-test-subj="syntheticsUrlField"]');
110114
await confirmAndSavePolicy(page);
111115
console.info(`Monitor for ${journeyName} created successfully`)
112116
});
@@ -131,6 +135,7 @@ journey('E2e test synthetics - tcp', async ({ page }) => {
131135
await createIntegrationPolicyName({ page, policyName: journeyName });
132136
await page.selectOption('[data-test-subj="syntheticsMonitorTypeField"]', 'tcp');
133137
await page.fill('[data-test-subj="syntheticsTCPHostField"]', 'smtp.gmail.com:587');
138+
await selectAgentPolicy({ page });
134139
await confirmAndSavePolicy(page);
135140
console.info(`Monitor for ${journeyName} created successfully`)
136141
});
@@ -179,6 +184,7 @@ journey('E2e test synthetics - browser', async ({ page }) => {
179184
await page.selectOption('[data-test-subj="syntheticsMonitorTypeField"]', 'browser');
180185
await page.fill('[data-test-subj="syntheticsBrowserZipUrl"]', 'https://github.com/elastic/synthetics-demo/archive/refs/heads/main.zip');
181186
await page.fill('[data-test-subj="syntheticsBrowserZipUrlFolder"]', 'todos/synthetics-tests');
187+
await selectAgentPolicy({ page });
182188
await confirmAndSavePolicy(page);
183189
});
184190

@@ -208,6 +214,7 @@ if (semver.satisfies(stackVersion, '>=8.0.1')) {
208214
await page.goto('https://www.elastic.co');
209215
});
210216
`);
217+
await selectAgentPolicy({ page });
211218
await confirmAndSavePolicy(page);
212219
});
213220

0 commit comments

Comments
 (0)