Skip to content

Commit 675f88c

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 9abe020 commit 675f88c

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

.github/workflows/uitests.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,6 @@ jobs:
6666
if: matrix.os == 'ubuntu-latest'
6767
run: |
6868
export DISPLAY=:99.0
69-
pkill -f chrome || true
70-
pkill -f chromium || true
7169
./gradlew test -PexcludeTests="**/reference/**,**/linemarker/**,**/inspections/**,**/completion/**,**/actions/**"
7270
7371
# Uncomment if investigation is needed:

src/test/kotlin/com/magento/idea/magento2plugin/pages/IdeaFrame.kt

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ import com.intellij.remoterobot.RemoteRobot
99
import com.intellij.remoterobot.data.RemoteComponent
1010
import com.intellij.remoterobot.fixtures.*
1111
import com.intellij.remoterobot.search.locators.byXpath
12+
import com.intellij.remoterobot.utils.keyboard
13+
import java.awt.event.KeyEvent.VK_ALT
14+
import java.awt.event.KeyEvent.VK_1
1215
import java.time.Duration
1316

1417

@@ -25,7 +28,14 @@ class IdeaFrame(remoteRobot: RemoteRobot, remoteComponent: RemoteComponent) :
2528
get() = actionLink(byXpath("//div[@accessiblename='Enable Magento support for this project?' and @class='JEditorPane']"))
2629

2730
val projectViewTree
28-
get() = find<ContainerFixture>(byXpath("//div[@class='ProjectViewTree']"))
31+
get() = try {
32+
find<ContainerFixture>(byXpath("//div[@class='ProjectViewTree']"))
33+
} catch (e: Exception) {
34+
keyboard {
35+
hotKey(VK_ALT, VK_1)
36+
}
37+
find<ContainerFixture>(byXpath("//div[@class='ProjectViewTree']"))
38+
}
2939

3040
fun isProjectViewVisible(): Boolean {
3141
return try {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class SharedSteps(private val remoteRobot: RemoteRobot) {
3535
ContainerFixture::class.java,
3636
byXpath("//div[@visible_text='New Project']")
3737
)
38-
newProjectButton.click(Point(15, -15))
38+
newProjectButton.click()
3939
Thread.sleep(2_000)
4040

4141
val jTextFieldFixture = find<JTextFieldFixture>(byXpath("//div[@class='TextFieldWithBrowseButton']"))

0 commit comments

Comments
 (0)