Skip to content

Commit

Permalink
fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Naseem77 committed Jan 31, 2025
1 parent aaedf00 commit 451b02d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
13 changes: 4 additions & 9 deletions e2e/logic/POM/codeGraph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,13 +259,11 @@ export default class CodeGraph extends BasePage {
}

async clickOnTipBtn(): Promise<void> {
const isVisible = await waitForElementToBeVisible(this.tipBtn);
if (!isVisible) throw new Error("'Tip' button is not visible!");
await this.tipBtn.click();
}

async isTipMenuVisible(): Promise<boolean> {
// await this.page.waitForTimeout(500);
await this.page.waitForTimeout(500);
return await waitForElementToBeVisible(this.genericMenu);
}

Expand Down Expand Up @@ -454,19 +452,16 @@ export default class CodeGraph extends BasePage {
}

async clickOnRemoveNodeViaElementMenu(): Promise<void> {
await this.elementMenu.waitFor({ state: "visible", timeout: 10000})
const button = this.elementMenuButton("Remove");
const button = this.elementMenuButton("Remove");
const isVisible = await waitForElementToBeVisible(button);
if (!isVisible) throw new Error("'View Node' button is not visible!");
await button.click();
}

async nodeClick(x: number, y: number): Promise<void> {
await this.page.waitForTimeout(500);
console.log(`Clicking node at: X=${x}, Y=${y}`);
await this.canvasElement.hover({ position: { x, y } });
await this.page.waitForTimeout(500); // Allow hover to take effect
console.log("Hover successful");
await this.canvasElement.click({ position: { x, y }, button: 'right' });
console.log("Right-click performed");
}

async selectCodeGraphCheckbox(checkbox: string): Promise<void> {
Expand Down
4 changes: 2 additions & 2 deletions e2e/tests/navBar.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ test.describe(' Navbar tests', () => {

test("Validate Tip popup visibility and closure functionality", async () => {
const navBar = await browser.createNewPage(CodeGraph, urls.baseUrl);
await navBar.clickonTipBtn();
await navBar.clickOnTipBtn();
expect(await navBar.isTipMenuVisible()).toBe(true);
await navBar.clickonTipMenuCloseBtn();
await navBar.clickOnTipMenuCloseBtn();
expect(await navBar.isTipMenuVisible()).toBe(false);
});
});

0 comments on commit 451b02d

Please sign in to comment.