Skip to content

Commit 1e899fa

Browse files
committed
Fix flaky test by simplifying active window detection logic
Removed unnecessary active window checks for Firefox in the test code. This simplifies the logic and improves reliability by avoiding environment-specific conditions. Retained the core functionality for simulating key presses.
1 parent 46d6b1b commit 1e899fa

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

src/test/kotlin/com/magento/idea/magento2plugin/actions/content/MarkDirectoryAsMagentoRootTest.kt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,23 +80,17 @@ class MarkDirectoryAsMagentoRootTest {
8080
"""
8181
try {
8282
const KeyEvent = Java.type("java.awt.event.KeyEvent");
83-
const Frames = Java.type("java.awt.Frame");
84-
85-
const activeWindow = Array.from(Frames.getFrames()).find(frame => frame.isActive());
86-
if (activeWindow && activeWindow.getName().includes("Firefox")) {
8783
robot.keyPress(KeyEvent.VK_ALT);
8884
robot.keyPress(KeyEvent.VK_TAB);
8985
Thread.sleep(100);
9086
robot.keyRelease(KeyEvent.VK_TAB);
9187
robot.keyRelease(KeyEvent.VK_ALT);
92-
}
9388
true;
9489
} catch (error) {
9590
false;
9691
}
9792
""".trimIndent()
9893
)
99-
10094
}
10195
// end temporary workaround
10296

0 commit comments

Comments
 (0)