Commit 083686e7 authored by Aneta Steimarova's avatar Aneta Steimarova

#929 Added wait for score table dialog actor visible

parent b54a2402
......@@ -7,4 +7,14 @@ TestScenarioHeapOfTrophies
TestScenarioHeapOfTrophies
TestScenarioHeapOfTrophies
TestScenarioHeapOfTrophies
TestScenarioHeapOfTrophies
\ No newline at end of file
TestScenarioHeapOfTrophies
NewUserScenario
NewUserScenario
NewUserScenario
NewUserScenario
NewUserScenario
NewUserScenario
NewUserScenario
NewUserScenario
NewUserScenario
NewUserScenario
\ No newline at end of file
......@@ -401,13 +401,28 @@ public class TestScenarioHeapOfTrophies extends AbstractTestScenario {
clickAt(stepNumber + "a. Click at heap of trophies", HallOfFameScreen.TROPHY_HEAP_NAME);
waitForDialog(stepNumber + "b. Wait for score table dialog", HallOfFameScreen.SCORE_TABLE_DIALOG_NAME);
checkScoreTable(stepNumber, user, score);
writeVisibleActorsToLogFile();
waitForScoreTableVisible(HallOfFameScreen.SCORE_TABLE_DIALOG_NAME);
writeVisibleActorsToLogFile();
clickAt(stepNumber + "d. Click at score table", HallOfFameScreen.SCORE_TABLE_DIALOG_NAME);
}
private void writeVisibleActorsToLogFile() {
SnapshotArray<Actor> stageActors = TablexiaApplication.getStage().getRoot().getChildren();
logInfo("\t Stage actors: ");
writeToLogFile("\t Stage actors: ");
for (Actor stageActor : stageActors){
logInfo(stageActor.getName() + " ");
writeToLogFile(stageActor.getName() + " ");
}
logInfo("\n");
clickAt(stepNumber + "d. Click at score table", HallOfFameScreen.SCORE_TABLE_DIALOG_NAME);
writeToLogFile("\n");
}
private void waitForScoreTableVisible(String scoreTableDialogName) {
setTimeout(DEFAULT_TASK_TIMEOUT, scoreTableDialogName);
Actor scoreTable = findActorByName(scoreTableDialogName);
while(scoreTable == null){
scoreTable = findActorByName(scoreTableDialogName);
}
clearTimeout();
}
private void checkScoreTable(int number, User user, int... score) {
......
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