Commit fea18cdb authored by Aneta Steimarova's avatar Aneta Steimarova

#1016 Made profile test more powerful

parent 6609ec39
......@@ -66,21 +66,101 @@ public class TestProfile extends AbstractTestScenario {
goToProfileSceen(2);
checkProfileData("3. Check user data",user);
checkThereIsNoRank("4. Check badge and progress rank",user);
backToOffice(4);
addGames("5. Add games to user " + user.getName(), user,4);
backToOffice(5);
addGames("6. Add games to user " + user.getName(), user,1);
goToProfileSceen(6);
checkBadgeByRankUser("7. Check badge and progress rank",user);
//RANK_I
goToProfileSceen(7);
checkBadgeByRankUser("8. Check badge and progress rank", user, "RANK_I");
backToOffice(8);
addGames("9. Add games to user " + user.getName(), user,10);
backToOffice(9);
addGames("10. Add games to user " + user.getName(), user,1);
goToProfileSceen(10);
checkBadgeByRankUser("11. Check badge and progress rank",user);
//RANK_II
goToProfileSceen(11);
checkBadgeByRankUser("12. Check badge and progress rank", user, "RANK_II");
backToOffice(13);
addGames("14. Add games to user " + user.getName(), user,1);
//RANK_III
goToProfileSceen(15);
checkBadgeByRankUser("16. Check badge and progress rank", user, "RANK_III");
backToOffice(17);
addGames("18. Add games to user " + user.getName(), user,3);
//RANK_IV
goToProfileSceen(19);
checkBadgeByRankUser("20. Check badge and progress rank", user, "RANK_IV");
backToOffice(21);
addGames("22. Add games to user " + user.getName(), user,3);
//RANK_V
goToProfileSceen(23);
checkBadgeByRankUser("24. Check badge and progress rank", user, "RANK_V");
backToOffice(25);
addGames("26. Add games to user " + user.getName(), user,3);
//RANK_VI
goToProfileSceen(27);
checkBadgeByRankUser("28. Check badge and progress rank", user, "RANK_VI");
backToOffice(29);
addGames("30. Add games to user " + user.getName(), user,3);
//RANK_VII
goToProfileSceen(31);
checkBadgeByRankUser("32. Check badge and progress rank", user, "RANK_VII");
backToOffice(33);
addGames("34. Add games to user " + user.getName(), user,6);
//RANK_VIII
goToProfileSceen(35);
checkBadgeByRankUser("36. Check badge and progress rank", user, "RANK_VIII");
backToOffice(37);
addGames("38. Add games to user " + user.getName(), user,4);
//RANK_IX
goToProfileSceen(39);
checkBadgeByRankUser("40. Check badge and progress rank", user, "RANK_IX");
backToOffice(41);
addGames("42. Add games to user " + user.getName(), user,10);
//RANK_X
goToProfileSceen(43);
checkBadgeByRankUser("44. Check badge and progress rank", user, "RANK_X");
backToOffice(45);
addGames("46. Add games to user " + user.getName(), user,6);
//RANK_XI
goToProfileSceen(47);
checkBadgeByRankUser("48. Check badge and progress rank", user, "RANK_XI");
}
private void checkBadgeByRankUser(String infoMessage,User user){
private void checkThereIsNoRank(String infoMessage,User user){
logInfo(infoMessage);
TablexiaLabel rankLabel = (TablexiaLabel) findActorByName(ProfileScreen.RANK_LABEL);
if(rankLabel!=null) {
logError("User should not have rank yet. ");
stopTheTest();
}
logOK();
takeScreenShotBlocking();
}
private void checkBadgeByRankUser(String infoMessage, User user, String rank){
logInfo(infoMessage);
TablexiaLabel rankLabel = (TablexiaLabel) findActorByName(ProfileScreen.RANK_LABEL);
......@@ -111,6 +191,10 @@ public class TestProfile extends AbstractTestScenario {
logError("Badge image with rank " + userRank.toString() + " not exists");
stopTheTest();
}
if(userRank.toString()!=rank){
logError("User rank " + userRank.toString() + " should be " + rank + "!");
stopTheTest();
}
logOK();
}else {
logError("Same actor not found: "+ProfileScreen.PROGRESS_BAR+" = " + (rankLabel!=null) + " "
......
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