Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ui): Add the final api assertion in create alert flow #1744

Merged
merged 3 commits into from
Jan 10, 2025
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
2 changes: 1 addition & 1 deletion thirdeye-ui/e2e/pages/alert-detail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ export class AlertDetailsPage extends BasePage {

async assertPageComponents() {
await expect(this.page.locator("h4").first()).toHaveText(
/^Anomaly #\d+(\s\w+)?$/
/^Anomaly #\d+(\s\(\w+\))?$/
);
expect(
this.page.locator("li").filter({ hasText: "Anomalies" })
Expand Down
10 changes: 10 additions & 0 deletions thirdeye-ui/e2e/pages/create-alert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,16 @@ export class CreateAlertPage extends BasePage {
this.evaluateResponseData = await evaluateApiResponse.json();
}

async resolveCreateAlertApis() {
const [createAlertApiResponse] = await Promise.all([
this.page.waitForResponse(
(response) =>
response.url().includes("/api/alerts") &&
response.status() === 200
),
]);
}

async resolveMetricsCohortsApis() {
const [cohortsApiResponse] = await Promise.all([
this.page.waitForResponse(
Expand Down
5 changes: 5 additions & 0 deletions thirdeye-ui/e2e/tests/create-alert.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ test("Create Simple Alert", async ({ page }) => {
await createAlertPage.selectDetectionAlgorithm();
await createAlertPage.resolveEvaluateApis();
await createAlertPage.createAlert();
await createAlertPage.resolveCreateAlertApis();
});

test("Create Multi Dimensions Alert", async ({ page }) => {
Expand All @@ -40,6 +41,7 @@ test("Create Multi Dimensions Alert", async ({ page }) => {
await createAlertPage.selectDetectionAlgorithm(true);
await createAlertPage.resolveEvaluateApis();
await createAlertPage.createAlert();
await createAlertPage.resolveCreateAlertApis();
});

test("Create Multi Dimensions SQL Alert", async ({ page }) => {
Expand All @@ -55,6 +57,7 @@ test("Create Multi Dimensions SQL Alert", async ({ page }) => {
await createAlertPage.clickLoadChartButton();
await createAlertPage.resolveEvaluateApis();
await createAlertPage.createAlert();
await createAlertPage.resolveCreateAlertApis();
});

test("Create Alert With Advanced Options", async ({ page }) => {
Expand All @@ -70,6 +73,7 @@ test("Create Alert With Advanced Options", async ({ page }) => {
await createAlertPage.addAdvancedOptions();
await createAlertPage.resolveEvaluateApis();
await createAlertPage.createAlert();
await createAlertPage.resolveCreateAlertApis();
});

test("Create Alert With Custom Metric", async ({ page }) => {
Expand All @@ -83,4 +87,5 @@ test("Create Alert With Custom Metric", async ({ page }) => {
await createAlertPage.selectDetectionAlgorithm();
await createAlertPage.resolveEvaluateApis();
await createAlertPage.createAlert();
await createAlertPage.resolveCreateAlertApis();
});
Loading