Skip to content

Commit 2cd7dfe

Browse files
committed
Add conditional workaround for CI environment in tests
The test now checks if it's running in the GitHub Actions environment before executing the trial activation workaround. Additionally, a new step was added to handle a "Don't show again" prompt during project setup. This ensures smoother test execution across environments.
1 parent 9f74bd6 commit 2cd7dfe

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

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

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,17 +69,22 @@ class MarkDirectoryAsMagentoRootTest {
6969
@Video
7070
fun testMarkDirectoryAsMagentoRoot(remoteRobot: RemoteRobot) = with(remoteRobot) {
7171
// temporary workaround until we get license for CI
72-
val startTrial = find<ContainerFixture>(byXpath("//div[@visible_text='Start trial']"))
73-
startTrial.click()
74-
val startTrialFree = find<ContainerFixture>(byXpath("//div[@class='s']"))
75-
startTrialFree.click()
76-
val dialog = find<DialogFixture>(byXpath("//div[@class='MyDialog']"))
77-
dialog.button("Close").click()
78-
Thread.sleep(10_000)
79-
closeBrowser()
72+
if (System.getenv("GITHUB_ACTIONS") == "true") {
73+
val startTrial = find<ContainerFixture>(byXpath("//div[@visible_text='Start trial']"))
74+
startTrial.click()
75+
val startTrialFree = find<ContainerFixture>(byXpath("//div[@class='s']"))
76+
startTrialFree.click()
77+
val dialog = find<DialogFixture>(byXpath("//div[@class='MyDialog']"))
78+
dialog.button("Close").click()
79+
Thread.sleep(10_000)
80+
closeBrowser()
81+
}
8082
// end temporary workaround
8183

8284
welcomeFrame {
85+
val launchedFromScript = find<ContainerFixture>(byXpath("//div[@text='Don't show again']"))
86+
launchedFromScript.click()
87+
8388
createNewProjectFromExistingFilesLink.click()
8489
dialog("Open File or Project") {
8590
// Set the path for the copied test data

0 commit comments

Comments
 (0)