Commit 0c7b273d authored by Aneta Steimarova's avatar Aneta Steimarova

#929 Fixed test of game Protocol - putting things to wall

parent 4941bff9
......@@ -24,4 +24,31 @@ 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
......@@ -310,7 +310,7 @@ public class TestGameProtocol extends AbstractTestGame {
float yPosition = roomGroup.getY() + roomGroup.getHeight() * fixRatio[1]/* - gameObject.getCenterPosition().y*/;
logInfo(incGetSteps() + ". Move object [" + gameObject.getType() + "] on the wall [" + wallType + "]");
moveGameObjectToPosition(gameObject, xPosition, yPosition);
moveGameObjectToWallPosition(gameObject, xPosition, yPosition);
}
/**
......@@ -481,6 +481,34 @@ public class TestGameProtocol extends AbstractTestGame {
return angle;
}
private void moveGameObjectToWallPosition(GameObject object, float xFinish, float yFinish) {
final int firstFingerPointer = 0;
final float duration = 0.5f;
Vector2 objectPosition = getActorPosition(object, ActorPosition.BOTTOM_LEFT);
float xPosition = objectPosition.x + ProtocolGame.CARD_SMALL_SIZE / 2;
float yPosition = objectPosition.y + 2*ProtocolGame.CARD_SMALL_SIZE / 3;
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();
if (!result) {
logError("Cannot move gameObject " + object.getType());
stopTheTest();
}
logOK();
waitForEvent(incGetSteps() + ". Wait for drop event", ProtocolGame.DROP_EVENT + object.getType());
returnToFirstCard();
}
private void moveGameObjectToFurniturePosition(GameObject object, float xFinish, float yFinish) {
final int firstFingerPointer = 0;
final float duration = 0.5f;
......
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