forked from redhat-developer/intellij-kubernetes
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reworked/refactored CreateResourceByEditTest
Signed-off-by: Oleksii Korniienko <[email protected]>
- Loading branch information
Showing
1 changed file
with
7 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,12 +20,13 @@ | |
import org.jboss.tools.intellij.kubernetes.fixtures.menus.ActionToolbarMenu; | ||
import org.jboss.tools.intellij.kubernetes.fixtures.menus.RightClickMenu; | ||
|
||
import java.awt.event.KeyEvent; | ||
import java.time.Duration; | ||
import java.util.List; | ||
|
||
|
||
import static com.intellij.remoterobot.search.locators.Locators.byXpath; | ||
import static com.intellij.remoterobot.utils.RepeatUtilsKt.waitFor; | ||
import static org.junit.jupiter.api.Assertions.assertTrue; | ||
|
||
/** | ||
* @author [email protected] | ||
|
@@ -70,36 +71,24 @@ public static void deleteResource(RemoteRobot robot, ComponentFixture kubernetes | |
} | ||
|
||
private static RemoteText findResourceNamePosition(RemoteRobot robot, EditorsSplittersFixture editorSplitter, Keyboard myKeyboard){ | ||
myKeyboard.hotKey(KeyEvent.VK_CONTROL, KeyEvent.VK_F); | ||
robot.find(ComponentFixture.class, byXpath("//div[@class='SearchTextArea']")).click(); | ||
myKeyboard.enterText(" name:"); | ||
|
||
scrollToVisible(" name:", robot); | ||
|
||
ComponentFixture textFixture = editorSplitter.getEditorTextFixture(); | ||
List<RemoteText> remoteText = textFixture.findAllText(); | ||
|
||
System.out.println("=================================================================================="); | ||
|
||
for (RemoteText actual_remote_text : remoteText) { | ||
System.out.println(actual_remote_text.getText()); | ||
} | ||
|
||
System.out.println("=================================================================================="); | ||
|
||
int nameId = 0; | ||
boolean nameFound = false; | ||
for (RemoteText actual_remote_text : remoteText){ | ||
System.out.println(actual_remote_text.getText()); | ||
if ("name".equals(actual_remote_text.getText())){ | ||
nameFound = true; | ||
break; | ||
} | ||
nameId++; | ||
} | ||
|
||
System.out.println("=================================================================================="); | ||
|
||
RemoteText namePlace = remoteText.get(nameId+3); // +1 because we need the next one, +1 because between every 2 real elements is space, +1 because here is the ":" | ||
assertTrue(nameFound, "Resource name not found."); | ||
|
||
return namePlace; | ||
return remoteText.get(nameId+3); // +1 because we need the next one, +1 because between every 2 real elements is space, +1 because here is the ":" | ||
} | ||
|
||
private static boolean acceptDeleteDialog(RemoteRobot robot){ | ||
|