Skip to content

Commit 9abe020

Browse files
committed
Fix browser handling and add Chrome termination on Linux
Ensure browsers are properly closed in all scenarios by invoking `closeBrowser()` in the appropriate locations. Additionally, include termination of Chrome processes on Linux systems for better cleanup.
1 parent bdfe02d commit 9abe020

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/test/kotlin/com/magento/idea/magento2plugin/steps/SharedSteps.kt

+3-2
Original file line numberDiff line numberDiff line change
@@ -115,16 +115,16 @@ class SharedSteps(private val remoteRobot: RemoteRobot) {
115115
DialogFixture::class.java, byXpath("//div[@class='MyDialog']")
116116
)
117117
dialog.button("Close").click()
118+
closeBrowser()
118119

119120
try {
120121
Thread.sleep(10000)
121122
} catch (e: InterruptedException) {
122123
Thread.currentThread().interrupt()
123124
throw RuntimeException(e)
124125
}
125-
126-
closeBrowser()
127126
} else {
127+
closeBrowser()
128128
val dialog = remoteRobot.find(
129129
DialogFixture::class.java, byXpath("//div[@class='MyDialog']")
130130
)
@@ -196,6 +196,7 @@ class SharedSteps(private val remoteRobot: RemoteRobot) {
196196
} else if (os.contains("nix") || os.contains("nux")) {
197197
// For Linux-based systems: Kill typical browser processes
198198
Runtime.getRuntime().exec("killall -9 firefox")
199+
Runtime.getRuntime().exec("killall -9 chrome")
199200
}
200201
} catch (e: IOException) {
201202
e.printStackTrace()

0 commit comments

Comments
 (0)