Commit 16f15078 authored by Aneta Steimarova's avatar Aneta Steimarova

#713 Gitlab will save as artifakt only log files and error screenshots

parent f08de336
......@@ -45,7 +45,8 @@ iTest-desktop:
when: always
expire_in: 3 days
paths:
- desktop/build/libs/iTest_results/*
- desktop/build/libs/iTest_results/*.log
- desktop/build/libs/iTest_results/*error.png
release:
stage: build
except:
......
......@@ -124,6 +124,7 @@ public abstract class AbstractTestScenario implements Runnable {
public static final String SCENARIO_STEP_ACTOR_VISIBLE = "actor visible";
public static final String SCENARIO_STEP_MMD_VISIBLE = "main menu item visible";
protected static String SCREENSHOT_ERROR = "";
private Thread testThread;
private File currentLogFile = null;
......@@ -759,9 +760,11 @@ public abstract class AbstractTestScenario implements Runnable {
* Problem appears during the scenario step; writing FAIL to log file; taking screenshot
*/
protected void logFail(){
SCREENSHOT_ERROR = "_error";
takeScreenShotBlocking();
writeToLogFile("[FAIL]\n");
writeToLogFile("\tScreenshot screen_" + (screenNum-1) + "_" + currentTestName + SCREENSHOT_EXTENSION + " has been taken.\n");
writeToLogFile("\tScreenshot screen_" + (screenNum-1) + "_" + currentTestName + SCREENSHOT_ERROR + SCREENSHOT_EXTENSION + " has been taken.\n");
SCREENSHOT_ERROR = "";
}
/**
......@@ -1276,7 +1279,7 @@ public abstract class AbstractTestScenario implements Runnable {
return null;
}
saveScreenshot(outputDirectory.child("/screen_" + screenNum++ + "_" + currentTestName + SCREENSHOT_EXTENSION), screen, true);
saveScreenshot(outputDirectory.child("/screen_" + screenNum++ + "_" + currentTestName + SCREENSHOT_ERROR + SCREENSHOT_EXTENSION), screen, true);
screen.dispose();
if(finishCallback!=null){
......
......@@ -147,35 +147,20 @@ public abstract class AbstractTestGame extends AbstractTestScenario {
result &= dragOverTime(xStart,yStart,xFinish,yFinish,firstFingerPointer,duration,30,stage); Log.info(getClass(),"TOUCH " + xFinish + " - " + yFinish);
result &= touchUp(xFinish,yFinish,firstFingerPointer,Input.Buttons.LEFT,stage);
Log.info(getClass(),"TOUCH " + xFinish + " - " + yFinish);
int sizeAfter = menu.getSelectedActions().size();
Action lastAction = menu.getSelectedActions().get(sizeAfter-1).getAction();
ExecutionTimeout moveTimeout = new ExecutionTimeout(5, SCENARIO_STEP_ACTION_MOVE_DONE);
Log.info("TESTING", "set timeout!!!!!!!!!!!!!!!");
while(sizeBefore == sizeAfter || action.getActionNumber() != lastAction.getActionNumber()){
sizeBefore = menu.getSelectedActions().size();
Log.info(getClass(),"TOUCH " + xFinish + " - " + yFinish);
result = touchDown(xStart,yStart,firstFingerPointer,Input.Buttons.LEFT,stage);
result &= dragOverTime(xStart,yStart,xFinish,yFinish,firstFingerPointer,duration,30,stage); Log.info(getClass(),"TOUCH " + xFinish + " - " + yFinish);
result &= touchUp(xFinish,yFinish,firstFingerPointer,Input.Buttons.LEFT,stage);
sizeAfter = menu.getSelectedActions().size();
lastAction = menu.getSelectedActions().get(sizeAfter-1).getAction();
}
moveTimeout.cancelWaiting();
if(!result){
logError("Cannot move action to menu " + action.getActionNumber());
stopTheTest();
}
int sizeAfter = menu.getSelectedActions().size();
if(sizeAfter == 0){
logError("Menu is empty after move action");
stopTheTest();
}
Action lastAction = menu.getSelectedActions().get(sizeAfter-1).getAction();
if(sizeBefore == sizeAfter || action.getActionNumber() != lastAction.getActionNumber()){
logError("Move action failed. Action number: " + action.getActionNumber() + " Start: " + xStart + " - " + yStart + " Finish: " + xFinish + " - " + yFinish);
stopTheTest();
......
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