Skip to content

Commit

Permalink
fix(ui): Added Test fix (#1736)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
harshilvelotio authored Jan 4, 2025
1 parent c0b60db commit 4b61aa4
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
6 changes: 5 additions & 1 deletion thirdeye-ui/e2e/pages/create-alert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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", {
Expand Down
33 changes: 33 additions & 0 deletions thirdeye-ui/e2e/pages/onboarding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')", {
Expand All @@ -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");
}
Expand All @@ -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();
}
}

0 comments on commit 4b61aa4

Please sign in to comment.