Skip to content

Commit ddf1bc6

Browse files
committed
update test
1 parent 2ac1435 commit ddf1bc6

2 files changed

Lines changed: 207 additions & 186 deletions

File tree

e2e/logic/POM/codeGraph.ts

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -667,8 +667,29 @@ export default class CodeGraph extends BasePage {
667667
await this.page.mouse.move(centerX, centerY);
668668
}
669669

670-
async getTooltipVisibility(): Promise<string> {
671-
return await this.nodeToolTip.evaluate(el => getComputedStyle(el).visibility);
670+
async isNodeToolTipVisible(): Promise<boolean> {
671+
try {
672+
const count = await this.nodeToolTip.count();
673+
if (count === 0) {
674+
console.error("Tooltip not found");
675+
return false;
676+
}
677+
678+
const box = await this.nodeToolTip.boundingBox();
679+
if (box && box.width > 0 && box.height > 0) {
680+
return true;
681+
}
682+
683+
return await this.nodeToolTip.evaluate(el => {
684+
const style = getComputedStyle(el);
685+
return style.visibility === 'visible' && parseFloat(style.opacity) > 0;
686+
});
687+
} catch (error) {
688+
console.error("Tooltip visibility check failed:", error);
689+
return false;
690+
}
672691
}
673692

693+
694+
674695
}

0 commit comments

Comments
 (0)