Commit e1b45438 authored by Aneta Steimarova's avatar Aneta Steimarova

#929 Fixed tests for Crime Scene game on Android device

parent 0c7b273d
......@@ -57,6 +57,7 @@ import cz.nic.tablexia.game.games.crime_scene.model.bonus.BonusSoundsSetting;
import cz.nic.tablexia.loader.application.ApplicationAtlasManager;
import cz.nic.tablexia.loader.application.ApplicationInternalTextureManager;
import cz.nic.tablexia.loader.application.ApplicationTextManager;
import cz.nic.tablexia.screen.AbstractTablexiaScreen;
import cz.nic.tablexia.shared.model.Game;
import cz.nic.tablexia.shared.model.resolvers.CrimeSceneScoreResolver;
import cz.nic.tablexia.util.Log;
......@@ -88,6 +89,7 @@ public class CrimeSceneGame extends AbstractTablexiaGame<CrimeSceneGameState> {
public static final String EVENT_START_PLAY = "event start play";
public static final String EVENT_FINISH_SOUND = "event finish sound index: ";
public static final String EVENT_ACTION_CONTROLLED = "event control action: ";
public static final String EVENT_HIGHLIGHTED_GO = "higlighted object shown";
public static final int ACTION_CARD_DRAG_SIZE = 100;
......@@ -784,6 +786,7 @@ public class CrimeSceneGame extends AbstractTablexiaGame<CrimeSceneGameState> {
public void setHighlightedGameObject(GameObject highlightedGameObject) {
this.highlightedGameObject = highlightedGameObject;
if(highlightedGameObject!=null) AbstractTablexiaScreen.triggerScenarioStepEvent(EVENT_HIGHLIGHTED_GO);
}
......
......@@ -25,12 +25,9 @@ import com.badlogic.gdx.utils.Timer;
import cz.nic.tablexia.game.games.crime_scene.CrimeSceneGame;
import cz.nic.tablexia.game.games.crime_scene.gameobject.GameObject;
import cz.nic.tablexia.screen.AbstractTablexiaScreen;
import cz.nic.tablexia.util.entity.Touch;
public class DesktopCrimeSceneDragListener extends CrimeSceneDragListener {
public static final String EVENT_HIGHLIGHTED_GO = "higlighted object shown";
private Timer timer;
private static final float DELAY = 0.15f;
Touch lastRecordedTouchDown;
......@@ -97,7 +94,6 @@ public class DesktopCrimeSceneDragListener extends CrimeSceneDragListener {
public void run() {
gameObject.changeToCardDrawable();
crimeSceneGame.setHighlightedGameObject(gameObject);
AbstractTablexiaScreen.triggerScenarioStepEvent(EVENT_HIGHLIGHTED_GO);
crimeSceneGame.highlightGameObject(gameObject);
}
}, DELAY);
......
NewUserScenario
TestScenarioSpecial
TestScenarioHallOfFameRobberyTrophies
TestScenarioHeapOfTrophies
TestGameShootingRangeEasyNoneStar
TestGameRobberyMediumOneStar
TestGameInTheDarknessMedium
TestGameNightWatchMediumNoneStar
TestGamePursuitHardThreeStar
TestGameCrimeSceneHardOneStar
TestGameKidnappingEasyTwoStar
TestGameRunesMediumThreeStar
TestGameProtocolEasyOneStar
TestGameProtocolEasyTwoStar
TestGameProtocolEasyThreeStar
TestGameProtocolMediumOneStar
TestGameProtocolMediumTwoStar
TestGameProtocolMediumThreeStar
TestGameProtocolHardOneStar
TestGameProtocolHardTwoStar
TestGameProtocolHardThreeStar
TestGameProtocolEasyOneStar
TestGameProtocolEasyTwoStar
TestGameProtocolEasyThreeStar
TestGameProtocolMediumOneStar
TestGameProtocolMediumTwoStar
TestGameProtocolMediumThreeStar
TestGameProtocolHardOneStar
TestGameProtocolHardTwoStar
TestGameProtocolHardThreeStar
TestGameProtocolEasyOneStar
TestGameProtocolEasyTwoStar
TestGameProtocolEasyThreeStar
TestGameProtocolMediumOneStar
TestGameProtocolMediumTwoStar
TestGameProtocolMediumThreeStar
TestGameProtocolHardOneStar
TestGameProtocolHardTwoStar
TestGameProtocolHardThreeStar
TestGameProtocolEasyOneStar
TestGameProtocolEasyTwoStar
TestGameProtocolEasyThreeStar
TestGameProtocolMediumOneStar
TestGameProtocolMediumTwoStar
TestGameProtocolMediumThreeStar
TestGameProtocolHardOneStar
TestGameProtocolHardTwoStar
TestGameProtocolHardThreeStar
TestGameProtocolEasyOneStar
TestGameProtocolEasyTwoStar
TestGameProtocolEasyThreeStar
TestGameProtocolMediumOneStar
TestGameProtocolMediumTwoStar
TestGameProtocolMediumThreeStar
TestGameProtocolHardOneStar
TestGameProtocolHardTwoStar
TestGameProtocolHardThreeStar
TestGameProtocolEasyOneStar
TestGameProtocolEasyTwoStar
TestGameProtocolEasyThreeStar
TestGameProtocolMediumOneStar
TestGameProtocolMediumTwoStar
TestGameProtocolMediumThreeStar
TestGameProtocolHardOneStar
TestGameProtocolHardTwoStar
TestGameProtocolHardThreeStar
\ No newline at end of file
TestGameSafeHardNoneStars
TestStatisticsInTheDarkness
TestEncyclopedia
TestProfile
OfficeTestScenario
\ No newline at end of file
......@@ -275,7 +275,7 @@ public class TestGameCrimeScene extends AbstractTestGame {
}
logOK();
waitForEvent(incGetSteps() + ". Wait for event higlighted object shown", DesktopCrimeSceneDragListener.EVENT_HIGHLIGHTED_GO);
waitForEvent(incGetSteps() + ". Wait for event higlighted object shown", CrimeSceneGame.EVENT_HIGHLIGHTED_GO);
}
......
......@@ -491,10 +491,8 @@ public class TestGameProtocol extends AbstractTestGame {
Stage stage = object.getStage();
clickAt((int)xFinish, (int)yFinish, stage);
takeScreenShotBlocking();
boolean result = touchDown(xPosition, yPosition, 0, Input.Buttons.LEFT, stage);
result &= dragOverTime((int) xPosition, (int) yPosition, (int) xFinish, (int) yFinish, firstFingerPointer, duration, 30, stage);
takeScreenShotBlocking();
result &= touchUp(xFinish, yFinish, 0, Input.Buttons.LEFT, stage);
takeScreenShotBlocking();
......@@ -520,10 +518,8 @@ public class TestGameProtocol extends AbstractTestGame {
Stage stage = object.getStage();
clickAt((int)xFinish, (int)yFinish, stage);
takeScreenShotBlocking();
boolean result = touchDown(xPosition, yPosition, 0, Input.Buttons.LEFT, stage);
result &= dragOverTime((int) xPosition, (int) yPosition, (int) xFinish, (int) yFinish, firstFingerPointer, duration, 30, stage);
takeScreenShotBlocking();
result &= touchUp(xFinish, yFinish, 0, Input.Buttons.LEFT, stage);
takeScreenShotBlocking();
......@@ -555,6 +551,7 @@ public class TestGameProtocol extends AbstractTestGame {
boolean result = touchDown(xPosition, yPosition, 0, Input.Buttons.LEFT, stage);
result &= dragOverTime((int) xPosition, (int) yPosition, (int) xFinish, (int) yFinish, firstFingerPointer, duration, 30, stage);
result &= touchUp(xFinish, yFinish, 0, Input.Buttons.LEFT, stage);
takeScreenShotBlocking();
if (!result) {
logError("Cannot move gameObject " + object.getType());
......
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