Commit 1c991302 authored by Aneta Steimarova's avatar Aneta Steimarova

#657 Refactoring test NewUserScenario

parent de3b5308
......@@ -85,6 +85,7 @@ public class PanoramaScreen extends AbstractTablexiaScreen<int[][]> {
public static final String SCENARIO_STEP_NEWSPAPERS_SCENE_VISIBLE = "newspapers screen visible";
public static final String SCENARIO_STEP_STREET_SCENE_VISIBLE = "street screen visible";
public static final String NEWSPAPERS = "newspapers";
public static final String NEWSPAPERS_CONTINUE_DIALOG = "newspapers continue dialog";
public static final String STREET_DOOR = "detective office's door";
public static final String DETECTIVES_DIALOG = "detective's dialog";
......@@ -308,6 +309,7 @@ public class PanoramaScreen extends AbstractTablexiaScreen<int[][]> {
}
}
});
balcony.setName(NEWSPAPERS);
}
/**
......
TestStatisticsInTheDarkness
TestEncyclopedia
TestProfile
OfficeTestScenario
\ No newline at end of file
NewUserScenario
NewUserScenario
NewUserScenario
NewUserScenario
NewUserScenario
NewUserScenario
NewUserScenario
NewUserScenario
NewUserScenario
NewUserScenario
NewUserScenario
NewUserScenario
\ No newline at end of file
......@@ -300,6 +300,7 @@ public abstract class AbstractTestScenario implements Runnable {
protected void clickRepeat(int scenarioStepNum, String infoMessage, String actorKey, int count) {
for(int i = 0; i < count; i++) {
clickAt((scenarioStepNum+i) + ". " + infoMessage, actorKey);
wait(200);
}
}
......@@ -335,16 +336,6 @@ public abstract class AbstractTestScenario implements Runnable {
return clickAt((int) click[0].x, (int) click[0].y, actor.getStage());
}
protected boolean clickInTheRectangle(String infoMessage, final Rectangle rect) {
logInfo(infoMessage);
if(!clickInTheRectangle(rect, getTablexia().getActualScreen().getStage())){
logError("Failed to click in the rectangle.");
stopTheTest();
}
logOK();
return true;
}
/**
* Simulates click inside the middle of given rectangle (used for example when we have some area on screen which is part of bigger actor)
*
......@@ -1156,6 +1147,7 @@ public abstract class AbstractTestScenario implements Runnable {
stage
);
touchUp(touchUpX,(int) (stage.getHeight() / 2),0,Input.Buttons.LEFT,stage);
wait(200);
}
AbstractTablexiaScreen.triggerScenarioStepEvent(SCENARIO_STEP_ACTOR_VISIBLE);
clearTimeout();
......
......@@ -47,7 +47,7 @@ public class NewUserScenario extends AbstractTestScenario {
waitForEvent("3. Wait for event newspapers screen visible", PanoramaScreen.SCENARIO_STEP_NEWSPAPERS_SCENE_VISIBLE);
clickInTheRectangle("4. Click in the rectangle - newspapers", PanoramaScreen.createNewspaperBounds(getTablexia().getActualScreen().getStage()));
clickAt("4. Click at newspapers", PanoramaScreen.NEWSPAPERS);
waitForDialog("5. Wait for newspapers dialog", PanoramaScreen.NEWSPAPERS_CONTINUE_DIALOG);
......@@ -59,7 +59,7 @@ public class NewUserScenario extends AbstractTestScenario {
clickRepeat(9, "Click detective office's door", PanoramaScreen.STREET_DOOR, 3);
clickDetectiveDialogs(12);
waitForScreen("20. Wait for screen FormScreen", FormScreen.class);
waitForEvent("20. Wait for event form scene visible",FormScreen.SCENARIO_STEP_FORM_SCENE_VISIBLE);
//Choosing avatar
clickAt("21. Click at avatar image", FormScreen.FORM_AVATAR_IMAGE);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment