Skip to content

Commit

Permalink
updated test examples
Browse files Browse the repository at this point in the history
  • Loading branch information
nizienko committed May 25, 2024
1 parent 1d43f12 commit f89c6eb
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 24 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ launch IDEA on remote machines or in Docker containers to check your plugin with

### Setup

The last version of the Remote-Robot is `0.11.22`.
The last version of the Remote-Robot is `0.11.23`.

In the test project:

Expand Down
2 changes: 1 addition & 1 deletion ui-test-example/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ repositories {
}


def remoteRobotVersion = "0.11.22"
def remoteRobotVersion = "0.11.23"

kotlin {
jvmToolchain(17)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import com.intellij.remoterobot.RemoteRobot;
import com.intellij.remoterobot.fixtures.*;
import com.intellij.remoterobot.search.locators.Locator;
import com.intellij.remoterobot.steps.CommonSteps;
import com.intellij.remoterobot.utils.Keyboard;
import org.assertj.swing.core.MouseButton;
import org.intellij.examples.simple.plugin.pages.IdeaFrame;
Expand Down Expand Up @@ -51,14 +52,7 @@ public void waitForIde() {
@AfterEach
public void closeProject(final RemoteRobot remoteRobot) {
step("Close the project", () -> {
if (remoteRobot.isMac()) {
keyboard.hotKey(VK_SHIFT, VK_META, VK_A);
keyboard.enterText("Close Project");
keyboard.enter();
} else {
actionMenu(remoteRobot, "File").click();
actionMenuItem(remoteRobot, "Close Project").click();
}
new CommonSteps(remoteRobot).closeProject();
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ public void createNewCommandLineProject() {
welcomeFrame.createNewProjectLink().click();

final DialogFixture newProjectDialog = welcomeFrame.find(DialogFixture.class, DialogFixture.byTitle("New Project"), Duration.ofSeconds(20));
newProjectDialog.find(JListFixture.class, byXpath("//div[@class='JBList']")).clickItem("New Project", true);
newProjectDialog.findText("Java").click();
newProjectDialog.button("Create").click();
});
Expand All @@ -60,10 +59,10 @@ public void closeTipOfTheDay() {

public void autocomplete(String text) {
step("Autocomplete '" + text + "'", () -> {
final Locator completionMenu = byXpath("//div[@class='HeavyWeightWindow']");
final Locator completionMenu = byXpath("//div[@class='HeavyWeightWindow']//div[@class='LookupList']");
final Keyboard keyboard = new Keyboard(remoteRobot);
keyboard.enterText(text);
waitFor(ofSeconds(5), () -> hasSingleComponent(remoteRobot, completionMenu));
waitFor(ofSeconds(10), () -> hasSingleComponent(remoteRobot, completionMenu));
remoteRobot.find(ComponentFixture.class, completionMenu)
.findText(contains(text))
.click();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import com.intellij.remoterobot.RemoteRobot
import com.intellij.remoterobot.fixtures.CommonContainerFixture
import com.intellij.remoterobot.fixtures.ContainerFixture
import com.intellij.remoterobot.search.locators.byXpath
import com.intellij.remoterobot.steps.CommonSteps
import com.intellij.remoterobot.stepsProcessing.step
import com.intellij.remoterobot.utils.keyboard
import com.intellij.remoterobot.utils.waitFor
Expand Down Expand Up @@ -37,17 +38,7 @@ class CreateCommandLineKotlinTest {

@AfterEach
fun closeProject(remoteRobot: RemoteRobot) = with(remoteRobot) {
idea {
if (remoteRobot.isMac()) {
keyboard {
hotKey(VK_SHIFT, VK_META, VK_A)
enterText("Close Project")
enter()
}
} else {
menuBar.select("File", "Close Project")
}
}
CommonSteps(remoteRobot).closeProject()
}

@Test
Expand Down

0 comments on commit f89c6eb

Please sign in to comment.