Skip to content

Commit 9ea2092

Browse files
committed
Simplify browser termination logic in test cleanup.
Removed redundant commands and streamlined the process for killing browser processes across different operating systems. This change reduces unnecessary overhead and ensures a more consistent cleanup approach.
1 parent 7a6ef3b commit 9ea2092

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

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

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -183,19 +183,13 @@ class MarkDirectoryAsMagentoRootTest {
183183
try {
184184
if (os.contains("win")) {
185185
// For Windows: Close common browsers like Chrome, Firefox, etc.
186-
Runtime.getRuntime().exec("taskkill /F /IM chrome.exe")
187186
Runtime.getRuntime().exec("taskkill /F /IM firefox.exe")
188-
Runtime.getRuntime().exec("taskkill /F /IM msedge.exe")
189187
} else if (os.contains("mac")) {
190188
// For macOS: Kill browsers using `pkill`
191-
Runtime.getRuntime().exec("pkill -f 'Google Chrome'")
192-
Runtime.getRuntime().exec("pkill -f 'Firefox'")
193-
Runtime.getRuntime().exec("pkill -f 'Safari'")
189+
Runtime.getRuntime().exec("killall -9 safari")
194190
} else if (os.contains("nix") || os.contains("nux")) {
195191
// For Linux-based systems: Kill typical browser processes
196-
Runtime.getRuntime().exec("pkill -f 'chrome'")
197-
Runtime.getRuntime().exec("pkill -f 'firefox'")
198-
Runtime.getRuntime().exec("pkill -f 'edge'")
192+
Runtime.getRuntime().exec("killall -9 firefox")
199193
}
200194
} catch (e: IOException) {
201195
e.printStackTrace()

0 commit comments

Comments
 (0)