Skip to content

Commit 117e67f

Browse files
committed
2080: removed license activation
1 parent f3b22e7 commit 117e67f

File tree

1 file changed

+20
-51
lines changed

1 file changed

+20
-51
lines changed

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

Lines changed: 20 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,20 @@ class SharedSteps(private val remoteRobot: RemoteRobot) {
3131
step("Create Or Open Test Project", Runnable {
3232
try {
3333
remoteRobot.welcomeFrame {
34-
val newProjectButton = remoteRobot.find(
35-
ContainerFixture::class.java,
36-
byXpath("//div[@visible_text='New Project']")
37-
)
38-
newProjectButton.click(Point(15, -15))
34+
try {
35+
val newProjectIcon = remoteRobot.find(
36+
ContainerFixture::class.java,
37+
byXpath("//div[@defaulticon='createNewProjectTab.svg']")
38+
);
39+
newProjectIcon.click();
40+
} catch (exception: Exception) {
41+
val newProjectButton = remoteRobot.find(
42+
ContainerFixture::class.java,
43+
byXpath("//div[@visible_text='New Project']")
44+
)
45+
newProjectButton.click();
46+
}
47+
3948
Thread.sleep(2_000)
4049

4150
val jTextFieldFixture = find<JTextFieldFixture>(byXpath("//div[@class='TextFieldWithBrowseButton']"))
@@ -54,19 +63,6 @@ class SharedSteps(private val remoteRobot: RemoteRobot) {
5463
enableMagentoSupport()
5564
}
5665
} catch (exception: Exception) {
57-
// temporary workaround until we get license for CI
58-
activateIde()
59-
// end temporary workaround
60-
try {
61-
val launchedFromScript = remoteRobot.find(
62-
ContainerFixture::class.java,
63-
byXpath("//div[@class='LinkLabel']")
64-
)
65-
launchedFromScript.click()
66-
} catch (e: Exception) {
67-
// Element does not exist, continue without failing the test
68-
}
69-
7066
createProjectFromExistingFiles()
7167
enableMagentoSupport()
7268
}
@@ -102,38 +98,18 @@ class SharedSteps(private val remoteRobot: RemoteRobot) {
10298
)
10399
}
104100

105-
private fun activateIde() {
106-
if ("true" == System.getenv("GITHUB_ACTIONS")) {
107-
val startTrial =
108-
remoteRobot.find(ContainerFixture::class.java, byXpath("//div[@visible_text='Start trial']"))
109-
startTrial.click()
110-
111-
val startTrialFree = remoteRobot.find(ContainerFixture::class.java, byXpath("//div[@class='s']"))
112-
startTrialFree.click()
113-
114-
val dialog = remoteRobot.find(
115-
DialogFixture::class.java, byXpath("//div[@class='MyDialog']")
116-
)
117-
dialog.button("Close").click()
118-
closeBrowser()
119-
120-
try {
121-
Thread.sleep(10000)
122-
} catch (e: InterruptedException) {
123-
Thread.currentThread().interrupt()
124-
throw RuntimeException(e)
125-
}
126-
} else {
127-
closeBrowser()
101+
private fun enableMagentoSupport() {
102+
try {
103+
//closing AI adv popup
128104
val dialog = remoteRobot.find(
129105
DialogFixture::class.java, byXpath("//div[@class='MyDialog']")
130106
)
131-
dialog.button("Activate").click()
132107
dialog.button("Close").click()
108+
} catch (e: Exception) {
109+
//do nothing
133110
}
134-
}
135111

136-
private fun enableMagentoSupport() {
112+
137113
remoteRobot.idea {
138114
step("Enable Magento Integration") {
139115
waitFor(ofMinutes(1)) { isDumbMode().not() }
@@ -152,13 +128,6 @@ class SharedSteps(private val remoteRobot: RemoteRobot) {
152128

153129
private fun createProjectFromExistingFiles() {
154130
remoteRobot.welcomeFrame {
155-
try {
156-
val launchedFromScript = find<ContainerFixture>(byXpath("//div[@class='LinkLabel']"))
157-
launchedFromScript.click()
158-
} catch (e: Exception) {
159-
// Element does not exist, continue without failing the test
160-
}
161-
162131
createNewProjectFromExistingFilesLink.click()
163132
selectProjectPath()
164133
}

0 commit comments

Comments
 (0)