Skip to content

Commit e5e47cb

Browse files
committed
Added swhitching between tabs
1 parent a7fc8d7 commit e5e47cb

File tree

7 files changed

+17
-29
lines changed

7 files changed

+17
-29
lines changed

build.gradle.kts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ dependencies {
4040

4141
testImplementation("org.junit.vintage:junit-vintage-engine:5.10.0")
4242

43-
implementation("com.googlecode.json-simple:json-simple:1.1.1")
43+
implementation ("org.json:json:20171018")
4444
implementation("org.codehaus.plexus:plexus-utils:3.4.0")
4545
testImplementation("com.automation-remarks:video-recorder-junit5:2.0")
4646
testImplementation("com.intellij.remoterobot:remote-robot:0.11.23")
@@ -53,14 +53,11 @@ dependencies {
5353
bundledPlugins(providers.gradleProperty("platformBundledPlugins").map { it.split(',') })
5454
plugins(providers.gradleProperty("platformPlugins").map { it.split(',') })
5555
plugin("com.intellij.lang.jsgraphql", "243.21565.122")
56-
instrumentationTools()
5756
pluginVerifier()
5857
zipSigner()
5958
testFramework(TestFrameworkType.Platform)
6059

6160
phpstorm("2024.3")
62-
bundledPlugin("com.jetbrains.php")
63-
bundledPlugin("com.intellij.copyright")
6461
}
6562
}
6663

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ pluginUntilBuild = 258.*
77
platformType = PS
88
platformVersion = 2024.3
99
platformPlugins =
10-
platformBundledPlugins = com.intellij.modules.json
10+
platformBundledPlugins = com.intellij.modules.json,com.jetbrains.php,JavaScript,com.intellij.copyright
1111
gradleVersion = 8.10.2
1212
kotlin.stdlib.default.dependency = false
1313
org.gradle.configuration-cache = true

gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ junit = "4.13.2"
44

55
# plugins
66
changelog = "2.2.1"
7-
intelliJPlatform = "2.1.0"
7+
intelliJPlatform = "2.4.0"
88
kotlin = "1.9.25"
99
kover = "0.8.3"
1010
qodana = "2024.2.3"

runTests.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
#!/bin/bash
22

33
./gradlew clean
4-
./gradlew runIdeForUiTests &
4+
./gradlew runIdeForUiTests --scan &
55
RUN_IDE_PID=$!
66

77
sleep 10
88

9-
./gradlew test --no-daemon
9+
./gradlew test --no-daemon --scan
1010

1111
# run certain test
1212
#./gradlew test --tests "com.magento.idea.magento2plugin.actions.content.MarkDirectoryAsMagentoRootTest.testMarkDirectoryAsMagentoRoot" --scan

src/main/java/com/magento/idea/magento2plugin/actions/generation/generator/ModuleComposerJsonGenerator.java

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,8 @@
2121
import java.util.List;
2222
import java.util.Properties;
2323
import org.jetbrains.annotations.NotNull;
24-
import org.json.simple.JSONObject;
25-
import org.json.simple.parser.JSONParser;
26-
import org.json.simple.parser.ParseException;
24+
import org.json.JSONException;
25+
import org.json.JSONObject;
2726

2827
public class ModuleComposerJsonGenerator extends FileGenerator {
2928

@@ -176,11 +175,7 @@ private Pair<String, String> getDependencyData(
176175
if (!(composerJsonFile instanceof JsonFile)) {
177176
return Pair.create("", "");
178177
}
179-
final JSONParser parser = new JSONParser();
180-
final Object obj = parser.parse(
181-
composerJsonFile.getText()
182-
);
183-
final JSONObject jsonObject = (JSONObject) obj;
178+
final JSONObject jsonObject = new JSONObject(composerJsonFile.getText());
184179

185180
if (jsonObject.get("name") == null) {
186181
return Pair.create("", "");
@@ -199,7 +194,7 @@ private Pair<String, String> getDependencyData(
199194
} else {
200195
return Pair.create("", "");
201196
}
202-
} catch (ParseException exception) { //NOPMD
197+
} catch (JSONException exception) { //NOPMD
203198
// It's fine
204199
}
205200

src/main/java/com/magento/idea/magento2uct/execution/output/ReportBuilder.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
import java.util.List;
3131
import java.util.Locale;
3232
import org.jetbrains.annotations.NotNull;
33-
import org.json.simple.JSONObject;
33+
import org.json.JSONObject;
3434

3535
public class ReportBuilder {
3636

@@ -148,9 +148,9 @@ public JsonFile build() {
148148
final JsonObject issueObject = jsonElementGenerator.createObject("\"lineNumber\": "
149149
+ issue.getLine() + ","
150150
+ "\"level\": \"" + issue.getLevel() + "\","//NOPMD
151-
+ "\"message\": \"" + JSONObject.escape(issue.getMessage()) + "\","
151+
+ "\"message\": " + JSONObject.quote(issue.getMessage()) + ","
152152
+ "\"code\": \"" + issue.getCode() + "\","
153-
+ "\"fileName\": \"" + JSONObject.escape(issue.getFilename()) + "\","
153+
+ "\"fileName\": " + JSONObject.quote(issue.getFilename()) + ","
154154
+ "\"validationType\": \"" + issue.getValidationType() + "\""
155155
);
156156
if (issuesValueBuilder.length() > 0) {

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

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -74,19 +74,16 @@ class MarkDirectoryAsMagentoRootTest {
7474
startTrialFree.click()
7575
val dialog = find<DialogFixture>(byXpath("//div[@class='MyDialog']"))
7676
dialog.button("Close").click()
77-
77+
Thread.sleep(2_000)
7878
step("Switch back to PhpStorm IDE window if Firefox overlay detected") {
79-
waitFor(ofMinutes(2)) {
80-
remoteRobot.callJs(
79+
remoteRobot.runJs(
8180
"""
8281
try {
83-
const Robot = Java.type("java.awt.Robot");
8482
const KeyEvent = Java.type("java.awt.event.KeyEvent");
8583
const Frames = Java.type("java.awt.Frame");
86-
const robot = new Robot();
87-
const activeWindow = Array.from(Frames.getFrames()).find(frame => frame.isActive());
84+
85+
const activeWindow = Array.from(Frames.getFrames()).find(frame => frame.isActive());
8886
if (activeWindow && activeWindow.getName().includes("Firefox")) {
89-
print("Firefox overlay detected, switching to PhpStorm...");
9087
robot.keyPress(KeyEvent.VK_ALT);
9188
robot.keyPress(KeyEvent.VK_TAB);
9289
Thread.sleep(100);
@@ -95,12 +92,11 @@ class MarkDirectoryAsMagentoRootTest {
9592
}
9693
true;
9794
} catch (error) {
98-
print("Error during script execution: " + error);
9995
false;
10096
}
10197
""".trimIndent()
10298
)
103-
}
99+
104100
}
105101
// end temporary workaround
106102

0 commit comments

Comments
 (0)