From 4b61aa495c635d9acb9ced31821646980131aa58 Mon Sep 17 00:00:00 2001 From: harshilvelotio <67183907+harshilvelotio@users.noreply.github.com> Date: Sat, 4 Jan 2025 10:48:53 +0530 Subject: [PATCH] fix(ui): Added Test fix (#1736) * fix(ui): Added Test fix * fix(ui): Added Tests fix * fix(ui): Added onboarding Test fix * fix(ui): Added Advance option Test fix * correct yaml file --- thirdeye-ui/e2e/pages/create-alert.ts | 6 ++++- thirdeye-ui/e2e/pages/onboarding.ts | 33 +++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/thirdeye-ui/e2e/pages/create-alert.ts b/thirdeye-ui/e2e/pages/create-alert.ts index d47508a94d..d00dce74b5 100644 --- a/thirdeye-ui/e2e/pages/create-alert.ts +++ b/thirdeye-ui/e2e/pages/create-alert.ts @@ -178,7 +178,10 @@ export class CreateAlertPage extends BasePage { const metrics = this.metricsResponseData?.find( (m) => m?.dataset?.name === this.datasetsResponseData[0].name ); - await this.page.getByRole("option", { name: metrics.name }).click(); + await this.page + .getByRole("option", { name: metrics.name }) + .first() + .click(); } async selectStaticFields(isMultiDimensional = false, isSQLQuery = false) { @@ -301,6 +304,7 @@ export class CreateAlertPage extends BasePage { await this.page .getByRole("button", { name: "Add advanced options" }) .click(); + await this.page.click('h6:text("Filtering")'); await this.page.getByTestId("optionedselect-daysOfWeek").click(); await this.page .getByRole("option", { diff --git a/thirdeye-ui/e2e/pages/onboarding.ts b/thirdeye-ui/e2e/pages/onboarding.ts index 0111351038..d98f3cb1aa 100644 --- a/thirdeye-ui/e2e/pages/onboarding.ts +++ b/thirdeye-ui/e2e/pages/onboarding.ts @@ -64,6 +64,16 @@ export class OnboardingPage extends BasePage { ]); } + async resolveDataSourcesApi() { + const [datasetsApiResponse] = await Promise.all([ + this.page.waitForResponse( + (response) => + response.url().includes("/api/data-sources") && + response.status() === 200 + ), + ]); + } + async goToWelcomeLanding() { await this.page.goto("http://localhost:7004/#access_token=''"); await this.page.waitForSelector("h4:has-text('StarTree ThirdEye')", { @@ -82,6 +92,25 @@ export class OnboardingPage extends BasePage { ); } + async checkConfigureCardHeader() { + await expect(this.page.locator("h6").first()).toHaveText( + "Review and configure data" + ); + } + + async checkConfigurePageHeader() { + await expect(this.page.locator("h4")).toHaveText( + "Let's start setting up your data" + ); + + await expect(this.page.locator("h5").first()).toHaveText( + "Complete the following steps." + ); + await expect(this.page.locator("h5").nth(1)).toHaveText( + "Select Datasource" + ); + } + async checkCreateAlertHeader() { await expect(this.page.locator("h4")).toHaveText("Create Alert"); } @@ -98,4 +127,8 @@ export class OnboardingPage extends BasePage { async clickCreateAlertButton() { await this.page.getByRole("button", { name: "Create Alert" }).click(); } + + async clickConfigureDataButton() { + await this.page.getByRole("button", { name: "Configure Data" }).click(); + } }