Commit 46774d9c authored by Aneta Steimarova's avatar Aneta Steimarova

#772 #757 Desktop and iOS build type in build.gradle changed from itest to...

#772 #757 Desktop and iOS build type in build.gradle changed from itest to iTest; created test for statistic - game Safe
parent cdc60b75
......@@ -65,7 +65,7 @@ task iTestJar(type: Jar) {
doFirst {
manifest {
attributes 'Main-Class': project.iTestLauncherClassName
attributes 'Build-Type': 'itest'
attributes 'Build-Type': 'iTest'
attributes 'Version-Name': tablexiaVersionName
attributes 'Assets-Cheksums': getMapConvertedToString(rootProject.ext.assetsChecksum)
}
......
......@@ -130,7 +130,7 @@ tasks.create(name: "launchITestOnIPadSimulator", type: org.robovm.gradle.tasks.I
doFirst {
project.ext.set("output.classesDir", new File("ios/build/classes/iTest"))
robovm.iosSignIdentity = TABLEXIA_IOS_SIGNING_IDENTITY_DEVEL
updateRoboVMProperties("itest", applicationIdITest, iTestLauncherClassName, 'Icon_itest', sentryDSNFallbackValue)
updateRoboVMProperties("iTest", applicationIdITest, iTestLauncherClassName, 'Icon_itest', sentryDSNFallbackValue)
}
}
......@@ -138,7 +138,7 @@ tasks.create(name: "launchITestOnIPhoneSimulator", type: org.robovm.gradle.tasks
doFirst {
project.ext.set("output.classesDir", new File("ios/build/classes/iTest"))
robovm.iosSignIdentity = TABLEXIA_IOS_SIGNING_IDENTITY_DEVEL
updateRoboVMProperties("itest", applicationIdITest, iTestLauncherClassName, 'Icon_itest', sentryDSNFallbackValue)
updateRoboVMProperties("iTest", applicationIdITest, iTestLauncherClassName, 'Icon_itest', sentryDSNFallbackValue)
}
}
......@@ -146,7 +146,7 @@ tasks.create(name: "launchITestOnIOSDevice", type: org.robovm.gradle.tasks.IOSDe
doFirst {
project.ext.set("output.classesDir", new File("ios/build/classes/iTest"))
robovm.iosSignIdentity = TABLEXIA_IOS_SIGNING_IDENTITY_DEVEL
updateRoboVMProperties("itest", applicationIdITest, iTestLauncherClassName, 'Icon_itest', sentryDSNFallbackValue)
updateRoboVMProperties("iTest", applicationIdITest, iTestLauncherClassName, 'Icon_itest', sentryDSNFallbackValue)
}
}
......
......@@ -10,3 +10,4 @@ TestGameSafeHardNoneStars
TestGameSafeHardOneStar
TestGameSafeHardTwoStars
TestGameSafeHardThreeStars
TestStatisticsSafe
......@@ -120,6 +120,7 @@
TestStatisticsPursuit
TestStatisticsRunes
TestStatisticsShootingRange
TestStatisticsSafe
TestEncyclopedia
TestProfile
OfficeTestScenario
......@@ -268,6 +268,7 @@ public class TestRunner {
listOfTests.add(TestStatisticsPursuit.class);
listOfTests.add(TestStatisticsRunes.class);
listOfTests.add(TestStatisticsShootingRange.class);
listOfTests.add(TestStatisticsSafe.class);
listOfTests.add(TestEncyclopedia.class);
listOfTests.add(TestProfile.class);
listOfTests.add(OfficeTestScenario.class);
......
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 aneta on 8.11.17.
*/
public class TestStatisticsSafe extends AbstractTestStatistics {
public TestStatisticsSafe(Tablexia tablexia) {
super(tablexia);
}
@Override
protected void onRunTestScenario() {
User user = createUser();
logIn(user);
//set data to databases
setGameData(user, GameDefinition.SAFE);
//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.SAFE, GameDifficulty.EASY);
checkPositionOfGraphPoints(StatisticsScreen.GRAPH_PANE,user,GameMenuDefinition.SAFE,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.SAFE,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.SAFE,GameDifficulty.MEDIUM);
checkPositionOfGraphPoints(StatisticsScreen.GRAPH_PANE,user, GameMenuDefinition.SAFE,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.SAFE,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.SAFE,GameDifficulty.HARD);
checkPositionOfGraphPoints(StatisticsScreen.GRAPH_PANE,user,GameMenuDefinition.SAFE,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.SAFE,GameDifficulty.HARD,0,true);
unSelectAllDifficulties();
selectDifficultyAndCheckGraph(incGetSteps() + ". Select difficulty and check with graph data",true,false,false);
//SAFE - 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.SAFE,GameDifficulty.EASY);
takeScreenShotBlocking();
}
}
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