Skip to content

Commit b415c60

Browse files
author
jpaten
committed
test: added test string to diagnose click failures (#4329)
1 parent 111af56 commit b415c60

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

e2e/testFunctions.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ const COLUMN_SORT_ICON_TEST_ID = "SouthRoundedIcon";
152152
* @param tab - the tab to check
153153
* @returns - true if the test passes and false if the test fails
154154
*/
155+
// eslint-disable-next-line sonarjs/cognitive-complexity -- Complex code just for diagnostic will be removed later
155156
export async function testSortAzul(
156157
page: Page,
157158
tab: TabDescription
@@ -200,6 +201,27 @@ export async function testSortAzul(
200201
await expect(sortIconLocator).toHaveCSS("opacity", "0");
201202
}
202203
// Click to sort
204+
console.log(
205+
await page.evaluate(() => {
206+
const obstructingElement = document.querySelector(
207+
".MuiPaper-root.MuiPaper-panel.MuiPaper-rounded.css-c8mee3"
208+
);
209+
const obstructingElementRect =
210+
obstructingElement?.getBoundingClientRect();
211+
const obstructingElementRectString = obstructingElementRect
212+
? obstructingElementRect.x +
213+
"," +
214+
obstructingElementRect.y +
215+
":" +
216+
obstructingElementRect.width +
217+
"," +
218+
obstructingElementRect.height
219+
: "No Element";
220+
console.log(
221+
"test " + !!obstructingElement + ", " + obstructingElementRectString
222+
);
223+
})
224+
);
203225
await columnSortLocator.click();
204226
// Expect the first element of the table to still be visible (may not have text)
205227
await expect(

0 commit comments

Comments
 (0)