Skip to content

Commit

Permalink
Test a change to see if it makes test less flaky.
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaz-s1 committed Sep 29, 2023
1 parent ce48140 commit eeda943
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion e2e/inputs.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,16 @@ test('New Input - DataSet PowerQuery', async ({ page }) => {
});

test('New Input - DataSet Alerts', async ({ page }) => {
test.setTimeout(3 * 60 * 1000);

await openDialog(page, "DataSet Alerts");

console.log("Fill the form")
const queryName = ('QuErY_A_' + (Math.random() * 1e18)).slice(0, 15)
console.log("Create query: ", queryName);

await page.locator('div').filter({ hasText: /^\*?NameEnter a unique name for the data input$/ }).locator('[data-test="textbox"]').fill(queryName);
await page.locator('div').filter({ hasText: /^\*?IntervalTime interval of input in seconds\.$/ }).locator('[data-test="textbox"]').fill("60")
await page.locator('div').filter({ hasText: /^\*?IntervalTime interval of input in seconds\.$/ }).locator('[data-test="textbox"]').fill("20")
await page.locator('form div').filter({ hasText: /^\*?Start TimeRelative time to query back. Use short form relative time, e.g.: 24h/ }).locator('[data-test="textbox"]').fill("60m")

await page.getByLabel("Select a value").click();
Expand All @@ -84,6 +86,11 @@ test('New Input - DataSet Alerts', async ({ page }) => {

await checkRowExists(page, queryName);

// Alerts are evaluated + alert state is reported every 1 minute so we need to wait at least 2 minutes to avoid
// flaky tests. 3 minutes would be even better
console.log("Waiting ~2 minutes since alerts are evaluated and state is reported only every 1 minute")
await page.waitForTimeout(2 * 65 * 1000);

await goToSplunkSearch(page);

await searchSplunk(page, `source="dataset_alerts://${queryName}"`)
Expand Down

0 comments on commit eeda943

Please sign in to comment.