Commit 16914b32 authored by Aneta Steimarova's avatar Aneta Steimarova

#777 Statistic tests (except Pursuit) refactored in abstract method in AbstractTestStatistics.

parent 8fd6f2d1
TestGameSafeEasyNoneStars
TestGameSafeEasyOneStars
TestGameSafeEasyTwoStars
TestGameSafeEasyThreeStars
TestGameSafeMediumNoneStars
TestGameSafeMediumOneStar
TestGameSafeMediumTwoStars
TestGameSafeMediumThreeStars
TestGameSafeHardNoneStars
TestGameSafeHardOneStar
TestGameSafeHardTwoStars
TestGameSafeHardThreeStars
TestStatisticsSafe
TestGameProtocolEasyOneStar
TestGameProtocolEasyNoneStar
TestGameProtocolMediumNoneStar
TestGameProtocolMediumOneStar
TestGameProtocolMediumTwoStar
TestGameProtocolHardThreeStar
TestGameProtocolHardOneStar
TestGameProtocolHardNoneStar
TestStatisticsButtons
TestStatisticsRobbery
TestStatisticsCrimeScene
TestStatisticsInTheDarkness
TestStatisticsKidnapping
TestStatisticsNightWatch
TestStatisticsPursuit
TestStatisticsRunes
TestStatisticsShootingRange
TestStatisticsProtocol
TestStatisticsSafe
NewUserScenario
TestScenarioSpecial
TestScenarioHallOfFameRobberyTrophies
TestScenarioHallOfFamePursuitTrophies
TestScenarioHallOfFameKidnappingTrophies
TestScenarioHallOfFameNightWatchTrophies
TestScenarioHallOfFameShootingRangeTrophies
TestScenarioHallOfFameInTheDarknessTrophies
TestScenarioHallOfFameCrimeSceneTrophies
TestScenarioHallOfFameRunesTrophies
TestScenarioHeapOfTrophies
TestGameShootingRangeEasyNoneStar
TestGameShootingRangeEasyOneStar
TestGameShootingRangeEasyTwoStar
TestGameShootingRangeEasyThreeStar
TestGameShootingRangeMediumNoneStar
TestGameShootingRangeMediumOneStar
TestGameShootingRangeMediumTwoStar
TestGameShootingRangeMediumThreeStar
TestGameShootingRangeHardNoneStar
TestGameShootingRangeHardOneStar
TestGameShootingRangeHardTwoStar
TestGameShootingRangeHardThreeStar
TestGameRobberyEasyNoneStar
TestGameRobberyEasyOneStar
TestGameRobberyEasyTwoStar
TestGameRobberyEasyThreeStar
TestGameRobberyMediumNoneStar
TestGameRobberyMediumOneStar
TestGameRobberyMediumTwoStar
TestGameRobberyMediumThreeStar
TestGameRobberyHardNoneStar
TestGameRobberyHardOneStar
TestGameRobberyHardTwoStar
TestGameRobberyHardThreeStar
TestGameInTheDarknessEasy
TestGameInTheDarknessMedium
TestGameInTheDarknessHard
TestGameInTheDarknessEasyScenario
TestGameInTheDarknessMediumScenario
TestGameInTheDarknessHardScenario
TestGameNightWatchEasyNoneStar
TestGameNightWatchEasyOneStar
TestGameNightWatchEasyTwoStar
TestGameNightWatchEasyThreeStar
TestGameNightWatchMediumNoneStar
TestGameNightWatchMediumOneStar
TestGameNightWatchMediumTwoStar
TestGameNightWatchMediumThreeStar
TestGameNightWatchHardNoneStar
TestGameNightWatchHardOneStar
TestGameNightWatchHardTwoStar
TestGameNightWatchHardThreeStar
TestGamePursuitEasyNoneStar
TestGamePursuitEasyOneStar
TestGamePursuitEasyTwoStar
TestGamePursuitEasyThreeStar
TestGamePursuitMediumNoneStar
TestGamePursuitMediumOneStar
TestGamePursuitMediumTwoStar
TestGamePursuitMediumThreeStar
TestGamePursuitHardNoneStar
TestGamePursuitHardOneStar
TestGamePursuitHardTwoStar
TestGamePursuitHardThreeStar
TestGameCrimeSceneEasyNoneStar
TestGameCrimeSceneEasyOneStar
TestGameCrimeSceneEasyTwoStar
TestGameCrimeSceneEasyThreeStar
TestGameCrimeSceneMediumNoneStar
TestGameCrimeSceneMediumOneStar
TestGameCrimeSceneMediumTwoStar
TestGameCrimeSceneMediumThreeStar
TestGameCrimeSceneHardNoneStar
TestGameCrimeSceneHardOneStar
TestGameCrimeSceneHardTwoStar
TestGameCrimeSceneHardThreeStar
TestGameKidnappingEasyNoneStar
TestGameKidnappingEasyOneStar
TestGameKidnappingEasyTwoStar
TestGameKidnappingEasyThreeStar
TestGameKidnappingMediumNoneStar
TestGameKidnappingMediumOneStar
TestGameKidnappingMediumTwoStar
TestGameKidnappingMediumThreeStar
TestGameKidnappingHardNoneStar
TestGameKidnappingHardOneStar
TestGameKidnappingHardTwoStar
TestGameKidnappingHardThreeStar
TestGameRunesEasyNoneStar
TestGameRunesEasyOneStar
TestGameRunesEasyTwoStar
TestGameRunesEasyThreeStar
TestGameRunesMediumNoneStar
TestGameRunesMediumOneStar
TestGameRunesMediumTwoStar
TestGameRunesMediumThreeStar
TestGameRunesHardNoneStar
TestGameRunesHardOneStar
TestGameRunesHardTwoStar
TestGameRunesHardThreeStar
TestGameProtocolEasyOneStar
TestGameProtocolEasyNoneStar
TestGameProtocolMediumNoneStar
TestGameProtocolMediumOneStar
TestGameProtocolMediumTwoStar
TestGameProtocolHardThreeStar
TestGameProtocolHardOneStar
TestGameProtocolHardNoneStar
TestGameSafeEasyNoneStars
TestGameSafeEasyOneStars
TestGameSafeEasyTwoStars
TestGameSafeEasyThreeStars
TestGameSafeMediumNoneStars
TestGameSafeMediumOneStar
TestGameSafeMediumTwoStars
TestGameSafeMediumThreeStars
TestGameSafeHardNoneStars
TestGameSafeHardOneStar
TestGameSafeHardTwoStars
TestGameSafeHardThreeStars
TestStatisticsButtons
TestStatisticsRobbery
TestStatisticsCrimeScene
TestStatisticsInTheDarkness
TestStatisticsKidnapping
TestStatisticsNightWatch
TestStatisticsPursuit
TestStatisticsRunes
TestStatisticsShootingRange
TestStatisticsProtocol
TestStatisticsSafe
TestEncyclopedia
TestProfile
OfficeTestScenario
NewUserScenario
TestScenarioSpecial
TestScenarioHallOfFameRobberyTrophies
TestScenarioHallOfFamePursuitTrophies
TestScenarioHallOfFameKidnappingTrophies
TestScenarioHallOfFameNightWatchTrophies
TestScenarioHallOfFameShootingRangeTrophies
TestScenarioHallOfFameInTheDarknessTrophies
TestScenarioHallOfFameCrimeSceneTrophies
TestScenarioHallOfFameRunesTrophies
TestScenarioHeapOfTrophies
TestGameShootingRangeEasyNoneStar
TestGameShootingRangeEasyOneStar
TestGameShootingRangeEasyTwoStar
TestGameShootingRangeEasyThreeStar
TestGameShootingRangeMediumNoneStar
TestGameShootingRangeMediumOneStar
TestGameShootingRangeMediumTwoStar
TestGameShootingRangeMediumThreeStar
TestGameShootingRangeHardNoneStar
TestGameShootingRangeHardOneStar
TestGameShootingRangeHardTwoStar
TestGameShootingRangeHardThreeStar
TestGameRobberyEasyNoneStar
TestGameRobberyEasyOneStar
TestGameRobberyEasyTwoStar
TestGameRobberyEasyThreeStar
TestGameRobberyMediumNoneStar
TestGameRobberyMediumOneStar
TestGameRobberyMediumTwoStar
TestGameRobberyMediumThreeStar
TestGameRobberyHardNoneStar
TestGameRobberyHardOneStar
TestGameRobberyHardTwoStar
TestGameRobberyHardThreeStar
TestGameInTheDarknessEasy
TestGameInTheDarknessMedium
TestGameInTheDarknessHard
TestGameInTheDarknessEasyScenario
TestGameInTheDarknessMediumScenario
TestGameInTheDarknessHardScenario
TestGameNightWatchEasyNoneStar
TestGameNightWatchEasyOneStar
TestGameNightWatchEasyTwoStar
TestGameNightWatchEasyThreeStar
TestGameNightWatchMediumNoneStar
TestGameNightWatchMediumOneStar
TestGameNightWatchMediumTwoStar
TestGameNightWatchMediumThreeStar
TestGameNightWatchHardNoneStar
TestGameNightWatchHardOneStar
TestGameNightWatchHardTwoStar
TestGameNightWatchHardThreeStar
TestGamePursuitEasyNoneStar
TestGamePursuitEasyOneStar
TestGamePursuitEasyTwoStar
TestGamePursuitEasyThreeStar
TestGamePursuitMediumNoneStar
TestGamePursuitMediumOneStar
TestGamePursuitMediumTwoStar
TestGamePursuitMediumThreeStar
TestGamePursuitHardNoneStar
TestGamePursuitHardOneStar
TestGamePursuitHardTwoStar
TestGamePursuitHardThreeStar
TestGameCrimeSceneEasyNoneStar
TestGameCrimeSceneEasyOneStar
TestGameCrimeSceneEasyTwoStar
TestGameCrimeSceneEasyThreeStar
TestGameCrimeSceneMediumNoneStar
TestGameCrimeSceneMediumOneStar
TestGameCrimeSceneMediumTwoStar
TestGameCrimeSceneMediumThreeStar
TestGameCrimeSceneHardNoneStar
TestGameCrimeSceneHardOneStar
TestGameCrimeSceneHardTwoStar
TestGameCrimeSceneHardThreeStar
TestGameKidnappingEasyNoneStar
TestGameKidnappingEasyOneStar
TestGameKidnappingEasyTwoStar
TestGameKidnappingEasyThreeStar
TestGameKidnappingMediumNoneStar
TestGameKidnappingMediumOneStar
TestGameKidnappingMediumTwoStar
TestGameKidnappingMediumThreeStar
TestGameKidnappingHardNoneStar
TestGameKidnappingHardOneStar
TestGameKidnappingHardTwoStar
TestGameKidnappingHardThreeStar
TestGameRunesEasyNoneStar
TestGameRunesEasyOneStar
TestGameRunesEasyTwoStar
TestGameRunesEasyThreeStar
TestGameRunesMediumNoneStar
TestGameRunesMediumOneStar
TestGameRunesMediumTwoStar
TestGameRunesMediumThreeStar
TestGameRunesHardNoneStar
TestGameRunesHardOneStar
TestGameRunesHardTwoStar
TestGameRunesHardThreeStar
TestGameProtocolEasyOneStar
TestGameProtocolEasyNoneStar
TestGameProtocolMediumNoneStar
TestGameProtocolMediumOneStar
TestGameProtocolMediumTwoStar
TestGameProtocolHardThreeStar
TestGameProtocolHardOneStar
TestGameProtocolHardNoneStar
TestGameSafeEasyNoneStars
TestGameSafeEasyOneStars
TestGameSafeEasyTwoStars
TestGameSafeEasyThreeStars
TestGameSafeMediumNoneStars
TestGameSafeMediumOneStar
TestGameSafeMediumTwoStars
TestGameSafeMediumThreeStars
TestGameSafeHardNoneStars
TestGameSafeHardOneStar
TestGameSafeHardTwoStars
TestGameSafeHardThreeStars
TestStatisticsButtons
TestStatisticsRobbery
TestStatisticsCrimeScene
TestStatisticsInTheDarkness
TestStatisticsKidnapping
TestStatisticsNightWatch
TestStatisticsPursuit
TestStatisticsRunes
TestStatisticsShootingRange
TestStatisticsProtocol
TestStatisticsSafe
TestEncyclopedia
TestProfile
OfficeTestScenario
......@@ -17,27 +17,26 @@
package cz.nic.tablexia.testing;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Input;
import com.badlogic.gdx.scenes.scene2d.Actor;
import com.badlogic.gdx.scenes.scene2d.Group;
import com.badlogic.gdx.scenes.scene2d.Stage;
import com.badlogic.gdx.scenes.scene2d.ui.Container;
import com.badlogic.gdx.scenes.scene2d.ui.Image;
import com.badlogic.gdx.scenes.scene2d.ui.ScrollPane;
import com.badlogic.gdx.scenes.scene2d.ui.Stack;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.concurrent.CountDownLatch;
import cz.nic.tablexia.Tablexia;
import cz.nic.tablexia.game.AbstractTablexiaGame;
import cz.nic.tablexia.game.GameDefinition;
import cz.nic.tablexia.game.difficulty.GameDifficulty;
import cz.nic.tablexia.loader.application.ApplicationTextManager;
import cz.nic.tablexia.menu.AbstractMenu;
import cz.nic.tablexia.menu.game.GameMenuDefinition;
import cz.nic.tablexia.menu.main.MainMenuDefinition;
import cz.nic.tablexia.model.game.GameDAO;
import cz.nic.tablexia.screen.AbstractTablexiaScreen;
import cz.nic.tablexia.screen.statistics.StatisticsGameScoreResolver;
......@@ -70,6 +69,84 @@ public abstract class AbstractTestStatistics extends AbstractTestScenario {
super(tablexia);
}
protected void runStatistics(GameDefinition gameDefinition, GameMenuDefinition gameMenuDefinition){
User user = createUser();
logIn(user);
//set data to databases
setGameData(user, gameDefinition);
//open statistics
waitForEvent(incGetSteps() + ". Wait for event opened ready", AbstractMenu.SCENARIO_STEP_READY_MENU);
clickAt(incGetSteps() +". Click at open/close menu button", AbstractMenu.OPEN_CLOSE_MENU_BUTTON_NAME);
waitForEvent(incGetSteps() +". Wait for event opened menu", AbstractMenu.SCENARIO_STEP_OPENED_MENU);
clickMainMenuButton(incGetSteps() +". Click at Statistics button in the menu", MainMenuDefinition.STATISTICS);
waitForScreen(incGetSteps() +". Wait for screen Statistics", StatisticsScreen.class);
Log.info("TESTING","WANT WAIT TO: " + StatisticsScreen.EVENT_GRAPH_READY+eventReadyCount);
waitForEvent(incGetSteps() + ". Wait for graph ready event",StatisticsScreen.EVENT_GRAPH_READY+eventReadyCount);
eventReadyCount++;
selectDifficultyAndCheckGraph(incGetSteps() + ". Select difficulty and check with graph data",true,false,false);
//test easy game data
checkDaoDataWithGraphData(StatisticsScreen.GRAPH_PANE,user, gameMenuDefinition, GameDifficulty.EASY);
checkPositionOfGraphPoints(StatisticsScreen.GRAPH_PANE,user,gameMenuDefinition,GameDifficulty.EASY);
takeScreenShotBlocking();
clickPointOnGraph(incGetSteps() + ". Click point on graph. Index point = " + 3,StatisticsScreen.GRAPH_PANE,GameDifficulty.EASY,3);
waitForDialog(incGetSteps() + ". Wait for dialog",StatisticsScreen.DIALOG);
checkDialogPointData(incGetSteps() + ". Check dialog data",StatisticsScreen.DIALOG,user,gameMenuDefinition,GameDifficulty.EASY,3,true);
//select medium difficulty
selectDifficultyAndCheckGraph(incGetSteps() + ". Select difficulty and check with graph data",false,true,false);
checkDaoDataWithGraphData(StatisticsScreen.GRAPH_PANE,user,gameMenuDefinition,GameDifficulty.MEDIUM);
checkPositionOfGraphPoints(StatisticsScreen.GRAPH_PANE,user, gameMenuDefinition,GameDifficulty.MEDIUM);
takeScreenShotBlocking();
clickPointOnGraph(incGetSteps() + ". Click point on graph. Index point = " + 0,StatisticsScreen.GRAPH_PANE,GameDifficulty.MEDIUM,0);
waitForDialog(incGetSteps() + ". Wait for dialog",StatisticsScreen.DIALOG);
checkDialogPointData(incGetSteps() + ". Check dialog data",StatisticsScreen.DIALOG,user,gameMenuDefinition,GameDifficulty.MEDIUM,0,true);
//select hard difficulty
selectDifficultyAndCheckGraph(incGetSteps() + ". Select difficulty and check with graph data",false,false,true);
checkDaoDataWithGraphData(StatisticsScreen.GRAPH_PANE,user,gameMenuDefinition,GameDifficulty.HARD);
checkPositionOfGraphPoints(StatisticsScreen.GRAPH_PANE,user,gameMenuDefinition,GameDifficulty.HARD);
takeScreenShotBlocking();
clickPointOnGraph(incGetSteps() + ". Click point on graph. Index point = " + 0,StatisticsScreen.GRAPH_PANE,GameDifficulty.HARD,0);
waitForDialog(incGetSteps() + ". Wait for dialog",StatisticsScreen.DIALOG);
checkDialogPointData(incGetSteps() + ". Check dialog data",StatisticsScreen.DIALOG,user,gameMenuDefinition,GameDifficulty.HARD,0,true);
unSelectAllDifficulties();
selectDifficultyAndCheckGraph(incGetSteps() + ". Select difficulty and check with graph data",true,false,false);
//Test statistic move graph
moveWithGraph(incGetSteps()+ ". Move with graph to left",StatisticsScreen.GRAPH_PANE,true);
takeScreenShotBlocking();
moveWithGraph(incGetSteps()+ ". Move with graph to right",StatisticsScreen.GRAPH_PANE,false);
//control average
clickAt(incGetSteps() +". Switch graph type to average",StatisticsScreen.SWITCH_GRAPH_AVERAGE);
Log.info("TESTING","WANT WAIT TO: " + StatisticsScreen.EVENT_GRAPH_READY+eventReadyCount);
waitForEvent(incGetSteps() + ". Wait for graph ready event",StatisticsScreen.EVENT_GRAPH_READY+eventReadyCount);
eventReadyCount++;
checkAverageScore(incGetSteps() + ". Check average score",StatisticsScreen.GRAPH_PANE,user,gameMenuDefinition,GameDifficulty.EASY);
takeScreenShotBlocking();
}
protected void checkAverageScore(String infoMessage,String actorName,User user,GameMenuDefinition definition,GameDifficulty difficulty){
logInfo(infoMessage);
......
......@@ -95,6 +95,8 @@ public class TestStatisticsButtons extends AbstractTestStatistics {
clickButtonGameAndTest(GameMenuDefinition.RUNES, GameMenuDefinition.RUNES.ordinal()); takeScreenShotBlocking();
clickButtonGameAndTest(GameMenuDefinition.SHOOTING_RANGE, GameMenuDefinition.SHOOTING_RANGE.ordinal()); takeScreenShotBlocking();
clickButtonGameAndTest(GameMenuDefinition.ROBBERY,GameMenuDefinition.ROBBERY.ordinal()); takeScreenShotBlocking();
clickButtonGameAndTest(GameMenuDefinition.PROTOCOL,GameMenuDefinition.PROTOCOL.ordinal()); takeScreenShotBlocking();
clickButtonGameAndTest(GameMenuDefinition.SAFE,GameMenuDefinition.SAFE.ordinal()); takeScreenShotBlocking();
}
......
......@@ -20,13 +20,7 @@ package cz.nic.tablexia.testing;
import cz.nic.tablexia.Tablexia;
import cz.nic.tablexia.game.GameDefinition;
import cz.nic.tablexia.game.difficulty.GameDifficulty;
import cz.nic.tablexia.menu.AbstractMenu;
import cz.nic.tablexia.menu.game.GameMenuDefinition;
import cz.nic.tablexia.menu.main.MainMenuDefinition;
import cz.nic.tablexia.screen.statistics.StatisticsScreen;
import cz.nic.tablexia.shared.model.User;
import cz.nic.tablexia.util.Log;
/**
* Created by lmarik on 9.2.17.
......@@ -39,80 +33,6 @@ public class TestStatisticsCrimeScene extends AbstractTestStatistics {
@Override
protected void onRunTestScenario() {
User user = createUser();
logIn(user);
//set data to databases
setGameData(user, GameDefinition.CRIME_SCENE);
//open statistics
waitForEvent(incGetSteps() + ". Wait for event opened ready", AbstractMenu.SCENARIO_STEP_READY_MENU);
clickAt(incGetSteps() +". Click at open/close menu button", AbstractMenu.OPEN_CLOSE_MENU_BUTTON_NAME);
waitForEvent(incGetSteps() +". Wait for event opened menu", AbstractMenu.SCENARIO_STEP_OPENED_MENU);
clickMainMenuButton(incGetSteps() +". Click at Statistics button in the menu", MainMenuDefinition.STATISTICS);
waitForScreen(incGetSteps() +". Wait for screen Statistics", StatisticsScreen.class);
Log.info("TESTING","WANT WAIT TO: " + StatisticsScreen.EVENT_GRAPH_READY+eventReadyCount);
waitForEvent(incGetSteps() + ". Wait for graph ready event",StatisticsScreen.EVENT_GRAPH_READY+eventReadyCount);
eventReadyCount++;
selectDifficultyAndCheckGraph(incGetSteps() + ". Select difficulty and check with graph data",true,false,false);
//test easy game data
checkDaoDataWithGraphData(StatisticsScreen.GRAPH_PANE,user, GameMenuDefinition.CRIME_SCENE, GameDifficulty.EASY);
checkPositionOfGraphPoints(StatisticsScreen.GRAPH_PANE,user,GameMenuDefinition.CRIME_SCENE,GameDifficulty.EASY);
takeScreenShotBlocking();
clickPointOnGraph(incGetSteps() + ". Click point on graph. Index point = " + 3,StatisticsScreen.GRAPH_PANE,GameDifficulty.EASY,3);
waitForDialog(incGetSteps() + ". Wait for dialog",StatisticsScreen.DIALOG);
checkDialogPointData(incGetSteps() + ". Check dialog data",StatisticsScreen.DIALOG,user,GameMenuDefinition.CRIME_SCENE,GameDifficulty.EASY,3,true);
//select medium difficulty
selectDifficultyAndCheckGraph(incGetSteps() + ". Select difficulty and check with graph data",false,true,false);
checkDaoDataWithGraphData(StatisticsScreen.GRAPH_PANE,user,GameMenuDefinition.CRIME_SCENE,GameDifficulty.MEDIUM);
checkPositionOfGraphPoints(StatisticsScreen.GRAPH_PANE,user, GameMenuDefinition.CRIME_SCENE,GameDifficulty.MEDIUM);
takeScreenShotBlocking();
clickPointOnGraph(incGetSteps() + ". Click point on graph. Index point = " + 0,StatisticsScreen.GRAPH_PANE,GameDifficulty.MEDIUM,0);
waitForDialog(incGetSteps() + ". Wait for dialog",StatisticsScreen.DIALOG);
checkDialogPointData(incGetSteps() + ". Check dialog data",StatisticsScreen.DIALOG,user,GameMenuDefinition.CRIME_SCENE,GameDifficulty.MEDIUM,0,true);
//select hard difficulty
selectDifficultyAndCheckGraph(incGetSteps() + ". Select difficulty and check with graph data",false,false,true);
checkDaoDataWithGraphData(StatisticsScreen.GRAPH_PANE,user,GameMenuDefinition.CRIME_SCENE,GameDifficulty.HARD);
checkPositionOfGraphPoints(StatisticsScreen.GRAPH_PANE,user,GameMenuDefinition.CRIME_SCENE,GameDifficulty.HARD);
takeScreenShotBlocking();
clickPointOnGraph(incGetSteps() + ". Click point on graph. Index point = " + 0,StatisticsScreen.GRAPH_PANE,GameDifficulty.HARD,0);
waitForDialog(incGetSteps() + ". Wait for dialog",StatisticsScreen.DIALOG);
checkDialogPointData(incGetSteps() + ". Check dialog data",StatisticsScreen.DIALOG,user,GameMenuDefinition.CRIME_SCENE,GameDifficulty.HARD,0,true);
unSelectAllDifficulties();
selectDifficultyAndCheckGraph(incGetSteps() + ". Select difficulty and check with graph data",true,false,false);
//CRIME_SCENE - test statistic move graph
moveWithGraph(incGetSteps()+ ". Move with graph to left",StatisticsScreen.GRAPH_PANE,true);
takeScreenShotBlocking();
moveWithGraph(incGetSteps()+ ". Move with graph to right",StatisticsScreen.GRAPH_PANE,false);
//control average
clickAt(incGetSteps() +". Switch graph type to average",StatisticsScreen.SWITCH_GRAPH_AVERAGE);
Log.info("TESTING","WANT WAIT TO: " + StatisticsScreen.EVENT_GRAPH_READY+eventReadyCount);
waitForEvent(incGetSteps() + ". Wait for graph ready event",StatisticsScreen.EVENT_GRAPH_READY+eventReadyCount);
eventReadyCount++;
checkAverageScore(incGetSteps() + ". Check average score",StatisticsScreen.GRAPH_PANE,user,GameMenuDefinition.CRIME_SCENE,GameDifficulty.EASY);
takeScreenShotBlocking();
runStatistics(GameDefinition.CRIME_SCENE, GameMenuDefinition.CRIME_SCENE);
}
}
......@@ -20,12 +20,7 @@ package cz.nic.tablexia.testing;
import cz.nic.tablexia.Tablexia;
import cz.nic.tablexia.game.GameDefinition;
import cz.nic.tablexia.game.difficulty.GameDifficulty;
import cz.nic.tablexia.menu.AbstractMenu;
import cz.nic.tablexia.menu.game.GameMenuDefinition;
import cz.nic.tablexia.menu.main.MainMenuDefinition;
import cz.nic.tablexia.screen.statistics.StatisticsScreen;
import cz.nic.tablexia.shared.model.User;
/**
* Created by lmarik on 9.2.17.
......@@ -38,82 +33,6 @@ public class TestStatisticsInTheDarkness extends AbstractTestStatistics {
@Override
protected void onRunTestScenario() {
User user = createUser();
logIn(user);
//set data to databases
setGameData(user, GameDefinition.IN_THE_DARKNESS);
//open statistics
waitForEvent(incGetSteps() + ". Wait for event opened ready", AbstractMenu.SCENARIO_STEP_READY_MENU);
clickAt(incGetSteps() +". Click at open/close menu button", AbstractMenu.OPEN_CLOSE_MENU_BUTTON_NAME);
waitForEvent(incGetSteps() +". Wait for event opened menu", AbstractMenu.SCENARIO_STEP_OPENED_MENU);
clickMainMenuButton(incGetSteps() +". Click at Statistics button in the menu", MainMenuDefinition.STATISTICS);
waitForScreen(incGetSteps() +". Wait for screen Statistics", StatisticsScreen.class);
waitForEvent(incGetSteps() + ". Wait for graph ready event",StatisticsScreen.EVENT_GRAPH_READY+eventReadyCount);
eventReadyCount++;
selectDifficultyAndCheckGraph(incGetSteps() + ". Select difficulty and check with graph data",true,false,false);
//test easy game data
checkDaoDataWithGraphData(StatisticsScreen.GRAPH_PANE,user, GameMenuDefinition.IN_THE_DARKNESS, GameDifficulty.EASY);
checkPositionOfGraphPoints(StatisticsScreen.GRAPH_PANE,user,GameMenuDefinition.IN_THE_DARKNESS,GameDifficulty.EASY);
takeScreenShotBlocking();
clickPointOnGraph(incGetSteps() + ". Click point on graph. Index point = " + 3,StatisticsScreen.GRAPH_PANE,GameDifficulty.EASY,3);
waitForDialog(incGetSteps() + ". Wait for dialog",StatisticsScreen.DIALOG);
checkDialogPointData(incGetSteps() + ". Check dialog data",StatisticsScreen.DIALOG,user,GameMenuDefinition.IN_THE_DARKNESS,GameDifficulty.EASY,3,true);
//select medium difficulty
selectDifficultyAndCheckGraph(incGetSteps() + ". Select difficulty and check with graph data",false,true,false);
checkDaoDataWithGraphData(StatisticsScreen.GRAPH_PANE,user,GameMenuDefinition.IN_THE_DARKNESS,GameDifficulty.MEDIUM);
checkPositionOfGraphPoints(StatisticsScreen.GRAPH_PANE,user, GameMenuDefinition.IN_THE_DARKNESS,GameDifficulty.MEDIUM);
takeScreenShotBlocking();
clickPointOnGraph(incGetSteps() + ". Click point on graph. Index point = " + 0,StatisticsScreen.GRAPH_PANE,GameDifficulty.MEDIUM,0);
waitForDialog(incGetSteps() + ". Wait for dialog",StatisticsScreen.DIALOG);
checkDialogPointData(incGetSteps() + ". Check dialog data",StatisticsScreen.DIALOG,user,GameMenuDefinition.IN_THE_DARKNESS,GameDifficulty.MEDIUM,0,true);
//select hard difficulty
selectDifficultyAndCheckGraph(incGetSteps() + ". Select difficulty and check with graph data",false,false,true);
checkDaoDataWithGraphData(StatisticsScreen.GRAPH_PANE,user,GameMenuDefinition.IN_THE_DARKNESS,GameDifficulty.HARD);
checkPositionOfGraphPoints(StatisticsScreen.GRAPH_PANE,user,GameMenuDefinition.IN_THE_DARKNESS,GameDifficulty.HARD);
takeScreenShotBlocking();
clickPointOnGraph(incGetSteps() + ". Click point on graph. Index point = " + 0,StatisticsScreen.GRAPH_PANE,GameDifficulty.HARD,0);
waitForDialog(incGetSteps() + ". Wait for dialog",StatisticsScreen.DIALOG);
checkDialogPointData(incGetSteps() + ". Check dialog data",StatisticsScreen.DIALOG,user,GameMenuDefinition.IN_THE_DARKNESS,GameDifficulty.HARD,0,true);
unSelectAllDifficulties();
selectDifficultyAndCheckGraph(incGetSteps() + ". Select difficulty and check with graph data",true,false,false);
//IN_THE_DARKNESS - test statistic move graph
moveWithGraph(incGetSteps()+ ". Move with graph to left",StatisticsScreen.GRAPH_PANE,true);
takeScreenShotBlocking();
moveWithGraph(incGetSteps()+ ". Move with graph to right",StatisticsScreen.GRAPH_PANE,false);
//control average
clickAt(incGetSteps() +". Switch graph type to average",StatisticsScreen.SWITCH_GRAPH_AVERAGE);
waitForEvent(incGetSteps() + ". Wait for graph ready event",StatisticsScreen.EVENT_GRAPH_READY+eventReadyCount);
eventReadyCount++;
checkAverageScore(incGetSteps() + ". Check average score",StatisticsScreen.GRAPH_PANE,user,GameMenuDefinition.IN_THE_DARKNESS,GameDifficulty.EASY);
takeScreenShotBlocking();
runStatistics(GameDefinition.IN_THE_DARKNESS, GameMenuDefinition.IN_THE_DARKNESS);
}
}
......@@ -20,12 +20,7 @@ package cz.nic.tablexia.testing;
import cz.nic.tablexia.Tablexia;
import cz.nic.tablexia.game.GameDefinition;
import cz.nic.tablexia.game.difficulty.GameDifficulty;
import cz.nic.tablexia.menu.AbstractMenu;
import cz.nic.tablexia.menu.game.GameMenuDefinition;
import cz.nic.tablexia.menu.main.MainMenuDefinition;
import cz.nic.tablexia.screen.statistics.StatisticsScreen;
import cz.nic.tablexia.shared.model.User;
/**
* Created by lmarik on 9.2.17.
......@@ -38,78 +33,6 @@ public class TestStatisticsKidnapping extends AbstractTestStatistics {
@Override
protected void onRunTestScenario() {
User user = createUser();
logIn(user);
//set data to databases
setGameData(user, GameDefinition.KIDNAPPING);
//open statistics
waitForEvent(incGetSteps() + ". Wait for event opened ready", AbstractMenu.SCENARIO_STEP_READY_MENU);
clickAt(incGetSteps() +". Click at open/close menu button", AbstractMenu.OPEN_CLOSE_MENU_BUTTON_NAME);
waitForEvent(incGetSteps() +". Wait for event opened menu", AbstractMenu.SCENARIO_STEP_OPENED_MENU);
clickMainMenuButton(incGetSteps() +". Click at Statistics button in the menu", MainMenuDefinition.STATISTICS);
waitForScreen(incGetSteps() +". Wait for screen Statistics", StatisticsScreen.class);
waitForEvent(incGetSteps() + ". Wait for graph ready event",StatisticsScreen.EVENT_GRAPH_READY+eventReadyCount);
eventReadyCount++;
selectDifficultyAndCheckGraph(incGetSteps() + ". Select difficulty and check with graph data",true,false,false);
//test easy game data
checkDaoDataWithGraphData(StatisticsScreen.GRAPH_PANE,user, GameMenuDefinition.KIDNAPPING, GameDifficulty.EASY);
checkPositionOfGraphPoints(StatisticsScreen.GRAPH_PANE,user,GameMenuDefinition.KIDNAPPING,GameDifficulty.EASY);
takeScreenShotBlocking();
clickPointOnGraph(incGetSteps() + ". Click point on graph. Index point = " + 3,StatisticsScreen.GRAPH_PANE,GameDifficulty.EASY,3);
waitForDialog(incGetSteps() + ". Wait for dialog",StatisticsScreen.DIALOG);
checkDialogPointData(incGetSteps() + ". Check dialog data",StatisticsScreen.DIALOG,user,GameMenuDefinition.KIDNAPPING,GameDifficulty.EASY,3,true);
//select medium difficulty
selectDifficultyAndCheckGraph(incGetSteps() + ". Select difficulty and check with graph data",false,true,false);
checkDaoDataWithGraphData(StatisticsScreen.GRAPH_PANE,user,GameMenuDefinition.KIDNAPPING,GameDifficulty.MEDIUM);
checkPositionOfGraphPoints(StatisticsScreen.GRAPH_PANE,user, GameMenuDefinition.KIDNAPPING,GameDifficulty.MEDIUM);
takeScreenShotBlocking();
clickPointOnGraph(incGetSteps() + ". Click point on graph. Index point = " + 0,StatisticsScreen.GRAPH_PANE,GameDifficulty.MEDIUM,0);
waitForDialog(incGetSteps() + ". Wait for dialog",StatisticsScreen.DIALOG);
checkDialogPointData(incGetSteps() + ". Check dialog data",StatisticsScreen.DIALOG,user,GameMenuDefinition.KIDNAPPING,GameDifficulty.MEDIUM,0,true);
//select hard difficulty
selectDifficultyAndCheckGraph(incGetSteps() + ". Select difficulty and check with graph data",false,false,true);
checkDaoDataWithGraphData(StatisticsScreen.GRAPH_PANE,user,GameMenuDefinition.KIDNAPPING,GameDifficulty.HARD);
checkPositionOfGraphPoints(StatisticsScreen.GRAPH_PANE,user,GameMenuDefinition.KIDNAPPING,GameDifficulty.HARD);
takeScreenShotBlocking();
clickPointOnGraph(incGetSteps() + ". Click point on graph. Index point = " + 0,StatisticsScreen.GRAPH_PANE,GameDifficulty.HARD,0);
waitForDialog(incGetSteps() + ". Wait for dialog",StatisticsScreen.DIALOG);
checkDialogPointData(incGetSteps() + ". Check dialog data",StatisticsScreen.DIALOG,user,GameMenuDefinition.KIDNAPPING,GameDifficulty.HARD,0,true);
unSelectAllDifficulties();
selectDifficultyAndCheckGraph(incGetSteps() + ". Select difficulty and check with graph data",true,false,false);
//KIDNAPPING - test statistic move graph
moveWithGraph(incGetSteps()+ ". Move with graph to left",StatisticsScreen.GRAPH_PANE,true);
takeScreenShotBlocking();
moveWithGraph(incGetSteps()+ ". Move with graph to right",StatisticsScreen.GRAPH_PANE,false);
//control average
clickAt(incGetSteps() +". Switch graph type to average",StatisticsScreen.SWITCH_GRAPH_AVERAGE);
waitForEvent(incGetSteps() + ". Wait for graph ready event",StatisticsScreen.EVENT_GRAPH_READY+eventReadyCount);
eventReadyCount++;