Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <version>4.12</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-databind</artifactId>
- <version>2.7.0</version>
- </dependency>
- </dependencies>
- <!--
- }
- return value;
- }
- public MobileElement getLabelElementByName(String labelName){
- for(int i=0;i<accountOptionLabel.size();i++){
- String text=CommonTask.getText(accountOptionLabel.get(i),"");
- testInfo("label name " + text);
- if(text.equals(labelName)){
- return accountOptionLabel.get(i);
- }
- }
- return null;
- }
- public Integer getLabelPositionByName(String labelName){
- for(int i=0;i<accountOptionLabel.size();i++){
- String text=CommonTask.getText(accountOptionLabel.get(i),"");
- testInfo("position by name: " + text);
- if(text.equals(labelName)){
- return i;
- }
- }
- return null;
- }
- public String getValueByName(String name){
- Integer i=getLabelPositionByName(name);
- String text=CommonTask.getText(accountOptionValue.get(i),"");
- testInfo("value by name : " + text);
- return text;
- }
- public Integer getWSGarnishmentNbr(){
- JsonArray jsonArray = getAccountListFor(AccountType.CURRENT_ACCOUNT, AccountFetchOption.NICKNAME_PRODUCT_GARNISHMENT);
- for (JsonElement anAccountListArray : jsonArray) {
- JsonObject idObj = anAccountListArray.getAsJsonObject();
- if (idObj.get("holds") != null) {
- JsonArray holdsFirstArray = idObj.get("holds").getAsJsonArray();
- return holdsFirstArray.size();
- }
- }
- return null;
- }
- }
- package com.athena.appium.pages.templates;
- import com.athena.appium.pages.templates.beans.Template;
- import com.athena.appium.pages.templates.beans.TemplateValues;
- import com.athena.appium.utils.commonMethods.CommonTask;
- import com.athena.appium.utils.testdata.TestData;
- import io.appium.java_client.AppiumDriver;
- import io.appium.java_client.MobileElement;
- import io.appium.java_client.pagefactory.AndroidFindAll;
- import io.appium.java_client.pagefactory.AndroidFindBy;
- import java.util.ArrayList;
- import java.util.List;
- public class TemplateDetailsPage extends TemplatesPage {
- @AndroidFindAll({@AndroidFindBy(id= TestData.APP_LOCATOR_PRE + ":id/tv_toolbar_title"),
- @AndroidFindBy(id= TestData.APP_LOCATOR + ":id/tv_toolbar_title")})
- private MobileElement templateDetailsHeader;
- @AndroidFindAll({@AndroidFindBy(id=TestData.APP_LOCATOR_PRE + ":id/ib_favourite"),
- @AndroidFindBy(id=TestData.APP_LOCATOR + ":id/ib_favourite")})
- private MobileElement templateDetailsFavourite;
- @AndroidFindAll({@AndroidFindBy(id=TestData.APP_LOCATOR_PRE + ":id/contact_image"),
- @AndroidFindBy(id=TestData.APP_LOCATOR + ":id/contact_image")})
- private MobileElement templateDetailsContactImg;
- @AndroidFindAll({@AndroidFindBy(id=TestData.APP_LOCATOR_PRE + ":id/contact_name"),
- @AndroidFindBy(id=TestData.APP_LOCATOR + ":id/contact_name")})
- private MobileElement templateDetailsContactName;
- @AndroidFindAll({@AndroidFindBy(id=TestData.APP_LOCATOR_PRE + ":id/new_payment_button"),
- @AndroidFindBy(id=TestData.APP_LOCATOR + ":id/new_payment_button")})
- private MobileElement templateDetailsPaymentButton;
- @AndroidFindAll({@AndroidFindBy(id=TestData.APP_LOCATOR_PRE + ":id/row_title"),
- @AndroidFindBy(id=TestData.APP_LOCATOR + ":id/row_title")})
- private List<MobileElement> templateDetailsRowTitle;
- @AndroidFindAll({@AndroidFindBy(id=TestData.APP_LOCATOR_PRE + ":id/row_details"),
- @AndroidFindBy(id=TestData.APP_LOCATOR + ":id/row_details")})
- private List<MobileElement> templateDetailsRow;
- public TemplateDetailsPage(AppiumDriver driver) {
- super(driver);
- }
- public List<String> getDetailsPageLabels(){
- List<String> lst = new ArrayList<>();
- for(int i=0;i<templateDetailsRowTitle.size();i++){
- lst.add(CommonTask.getText(templateDetailsRowTitle.get(i),"det page labels"));
- }
- return lst;
- }
- public TemplateValues getTemplateLabels(String actionId){
- TemplateValues labels = new TemplateValues();
- labels.setName(CommonTask.getText(templateDetailsRowTitle.get(0),"get template name label"));
- labels.setFromAccount(CommonTask.getText(templateDetailsRowTitle.get(1),"get template from account " +
- "label"));
- CommonTask.shortSwipeVertical(driver);
- labels.setToAccount(CommonTask.getText(templateDetailsRowTitle.get(2),"get template to account " +
- "label"));
- if(actionId.equals("0111")|| actionId.equals("0137")){
- labels.setBeneficiary(CommonTask.getText(templateDetailsRowTitle.get(3), "get template " +
- "beneficiary name label"));
- CommonTask.shortSwipeVertical(driver);
- labels.setDetails(CommonTask.getText(templateDetailsRowTitle.get(4), "get template details " +
- "label"));
- }
- if(actionId.equals("0003")|| actionId.equals("0009")||actionId.equals("0110")){
- labels.setDetails(CommonTask.getText(templateDetailsRowTitle.get(3), "get template details " +
- "label"));
- }
- return labels;
- }
- public TemplateValues getTemplateValues(String actionId){
- TemplateValues labels = new TemplateValues();
- labels.setName(CommonTask.getText(templateDetailsRow.get(0),"get template name value"));
- labels.setFromAccount(CommonTask.getText(templateDetailsRow.get(1),"get template from account" +
- " value"));
- labels.setToAccount(CommonTask.getText(templateDetailsRow.get(2),"get template to account value"));
- CommonTask.shortSwipeVertical(driver);
- if(actionId.equals("0111")|| actionId.equals("0137")){
- labels.setBeneficiary(CommonTask.getText(templateDetailsRow.get(3), "get template " +
- "beneficiary name value"));
- CommonTask.shortSwipeVertical(driver);
- labels.setDetails(CommonTask.getText(templateDetailsRow.get(4), "get template details value"));
- }
- if(actionId.equals("0003")|| actionId.equals("0009")||actionId.equals("0110")){
- labels.setDetails(CommonTask.getText(templateDetailsRow.get(3), "get template details value"));
- }
- return labels;
- }
- public List<String> getDetailsPageValues(){
- List<String> ls=new ArrayList<>();
- for(int i=0;i<templateDetailsRow.size();i++){
- ls.add(CommonTask.getText(templateDetailsRow.get(i),"det page values"));
- }
- return ls;
- }
- }
- package com.athena.appium.pages.templates;
- public class TemplatesConstants {
- //general
- public static final String TEMPLATE_NAME1="conturiproprii";
- // public static final String TEMPLATE_NAME2="testluci";
- public static final String TEMPLATE_NAME3="test";
- public static final String TEMPLATE_NAME4="testluci";
- //labels EN
- public static final String TEMPLATES_TAB_NAME_EN="Templates";
- public static final String TEMPLATES_HEADER_NAME_EN="Templates";
- public static final String TEMPLATES_FAVOURITES_TITLE_EN="Favourites";
- public static final String TEMPLATES_ALLTEMPLATES_TITLE_EN="All templates";
- public static final String TEMPLATES_ALLFAVOURITES_EN="All favourites";
- public static final String TEMPLATE_DETAILS_TEMPLATE_NAME_EN="TEMPLATE NAME";
- public static final String TEMPLATE_DETAILS_FROM_ACCOUNT_EN="FROM ACCOUNT";
- public static final String TEMPLATE_DETAILS_TO_ACCOUNT_EN="TO ACCOUNT";
- public static final String TEMPLATE_DETAILS_PAYMENT_DETAILS_EN="PAYMENT DETAILS";
- public static final String TEMPLATE_DETAILS_BENEFICIARY_NAME_EN="BENEFICIARY NAME";
- //labels RO
- public static final String TEMPLATES_TAB_NAME_RO="Sabloane";
- public static final String TEMPLATES_HEADER_NAME_RO="Sabloane";
- public static final String TEMPLATES_FAVOURITES_TITLE_RO="Favorite";
- public static final String TEMPLATES_ALLTEMPLATES_TITLE_RO="Toate sabloanele";
- public static final String TEMPLATES_ALLFAVOURITES_RO="Toate sabloanele favorite";
- public static final String TEMPLATE_DETAILS_TEMPLATE_NAME_RO="NUME SABLON";
- public static final String TEMPLATE_DETAILS_FROM_ACCOUNT_RO="DIN CONTUL";
- public static final String TEMPLATE_DETAILS_TO_ACCOUNT_RO="IN CONTUL";
- public static final String TEMPLATE_DETAILS_PAYMENT_DETAILS_RO="DETALII PLATA";
- public static final String TEMPLATE_DETAILS_BENEFICIARY_NAME_RO="NUME BENEFICIAR";
- }
- package com.athena.appium.pages.templates;
- import com.athena.appium.utils.Log4Test;
- import com.athena.appium.utils.commonMethods.CommonRestTask;
- import com.athena.appium.utils.commonMethods.CommonTask;
- import com.athena.appium.utils.enums.EndPoint;
- import com.athena.appium.utils.testdata.TestData;
- import com.athena.appium.pages.DashboardPage;
- import com.athena.appium.pages.templates.beans.AccountsInfo;
- import com.athena.appium.pages.templates.beans.Template;
- import com.fasterxml.jackson.core.type.TypeReference;
- import io.appium.java_client.AppiumDriver;
- import io.appium.java_client.MobileBy;
- import io.appium.java_client.MobileElement;
- import io.appium.java_client.pagefactory.AndroidFindAll;
- import io.appium.java_client.pagefactory.AndroidFindBy;
- import com.fasterxml.jackson.databind.ObjectMapper;
- import org.apache.log4j.Logger;
- import org.testng.Assert;
- import java.io.IOException;
- import java.util.Collections;
- import java.util.List;
- /**
- * Created by LucianaD
- */
- public class TemplatesPage extends DashboardPage {
- private static final Logger LOGGER = Logger.getLogger(TemplatesPage.class);
- public TemplatesPage(AppiumDriver driver) {
- super(driver);
- }
- @AndroidFindAll({@AndroidFindBy(id = TestData.APP_LOCATOR_PRE + ":id/nav_templates_btn"),
- @AndroidFindBy(id = TestData.APP_LOCATOR + ":id/nav_templates_btn")})
- private MobileElement templatesBtn;
- @AndroidFindAll({@AndroidFindBy(id = TestData.APP_LOCATOR_PRE + ":id/template_label"),
- @AndroidFindBy(id = TestData.APP_LOCATOR + ":id/template_label")})
- private MobileElement templatesTab;
- @AndroidFindAll({@AndroidFindBy(id = TestData.APP_LOCATOR_PRE + ":id/tv_toolbar_title"),
- @AndroidFindBy(id = TestData.APP_LOCATOR + ":id/tv_toolbar_title")})
- private MobileElement templatesHeader;
- @AndroidFindAll({ @AndroidFindBy(id = TestData.APP_LOCATOR_PRE + ":id/search_src_text"),
- @AndroidFindBy(id = TestData.APP_LOCATOR + ":id/search_src_text")})
- private MobileElement templatesSearch;
- @AndroidFindAll({ @AndroidFindBy(id = TestData.APP_LOCATOR_PRE + ":id/search_close_btn"),
- @AndroidFindBy(id = TestData.APP_LOCATOR + ":id/search_close_btn")})
- private MobileElement templatesSearchCloseButton;
- @AndroidFindAll({@AndroidFindBy(id = TestData.APP_LOCATOR_PRE + ":id/fav_contact_image"),
- @AndroidFindBy(id = TestData.APP_LOCATOR + ":id/fav_contact_image")})
- private List<MobileElement> templatesFavContactImage;
- @AndroidFindAll({@AndroidFindBy(id = TestData.APP_LOCATOR_PRE + ":id/favourites_title"),
- @AndroidFindBy(id = TestData.APP_LOCATOR + ":id/favourites_title")})
- private MobileElement templatesFavouritesTitle;
- @AndroidFindAll({@AndroidFindBy(id = TestData.APP_LOCATOR_PRE + ":id/show_more_textview"),
- @AndroidFindBy(id = TestData.APP_LOCATOR + ":id/show_more_textview")})
- private MobileElement templatesAllFavourites;
- @AndroidFindAll({@AndroidFindBy(id = TestData.APP_LOCATOR_PRE + ":id/templates_title"),
- @AndroidFindBy(id = TestData.APP_LOCATOR + ":id/templates_title")})
- private MobileElement templatesAllTemplatesTitle;
- @AndroidFindAll({@AndroidFindBy(id = TestData.APP_LOCATOR_PRE + ":id/contact_image"),
- @AndroidFindBy(id = TestData.APP_LOCATOR + ":id/contact_image")})
- private List<MobileElement> templatesContactImage;
- @AndroidFindAll({@AndroidFindBy(id = TestData.APP_LOCATOR_PRE + ":id/contact_name"),
- @AndroidFindBy(id = TestData.APP_LOCATOR + ":id/contact_name")})
- private List<MobileElement> templatesContactName;
- @AndroidFindAll({@AndroidFindBy(id = TestData.APP_LOCATOR_PRE + ":id/contact_iban"),
- @AndroidFindBy(id = TestData.APP_LOCATOR + ":id/contact_iban")})
- private List<MobileElement> templatesContactIban;
- @AndroidFindAll({@AndroidFindBy(id = TestData.APP_LOCATOR_PRE + ":id/new_payment_button"),
- @AndroidFindBy(id = TestData.APP_LOCATOR + ":id/new_payment_button")})
- private List<MobileElement> templatesNewPaymentButton;
- @AndroidFindAll({@AndroidFindBy( id = TestData.APP_LOCATOR_PRE + ":id/add_to_favourites_button"),
- @AndroidFindBy(id = TestData.APP_LOCATOR + ":id/add_to_favourites_button")})
- private List<MobileElement> templatesAddToFavButton;
- @AndroidFindAll({@AndroidFindBy(id = TestData.APP_LOCATOR_PRE + ":id/delete_contact_button"),
- @AndroidFindBy(id = TestData.APP_LOCATOR + ":id/delete_contact_button")})
- private List<MobileElement> templatesDeleteContactButton;
- @AndroidFindAll({@AndroidFindBy(id = TestData.APP_LOCATOR_PRE + ":id/contact_row"),
- @AndroidFindBy(id = TestData.APP_LOCATOR + ":id/contact_row")})
- private List<MobileElement> templatesContactRow;
- @AndroidFindAll({@AndroidFindBy(id = TestData.APP_LOCATOR_PRE + ":id/no_templates_title"),
- @AndroidFindBy(id = TestData.APP_LOCATOR + ":id/no_templates_title")})
- private MobileElement noTemplatesLabel;
- @AndroidFindBy(id = "android:id/button1")
- private MobileElement templatesDeleteButton;
- @AndroidFindBy(id = "android:id/button2")
- private MobileElement templatesDeleteCancelButton;
- @AndroidFindAll( {@AndroidFindBy(id = TestData.APP_LOCATOR_PRE + ":id/tv_message"),
- @AndroidFindBy(id = TestData.APP_LOCATOR + ":id/tv_message")})
- private MobileElement templatesConfirmationDeleteMessage;
- private ObjectMapper mapper = new ObjectMapper();
- public String getTextNoTemplates() {
- String textNoTemp = CommonTask.getText(noTemplatesLabel, "no templates text");
- return textNoTemp;
- }
- public String getTextTemplatesTab() {
- String textTempTab = CommonTask.getText(templatesTab, "templates tab");
- return textTempTab;
- }
- public Boolean isEnabledTemplatesTab() {
- Boolean enabledTempTab = CommonTask.isEnabled(templatesBtn, "templates tab enabled");
- return enabledTempTab;
- }
- public String getTextTemplatesHeader() {
- String textTempHeader = CommonTask.getText(templatesHeader, "templates header");
- return textTempHeader;
- }
- public String getTextAllTemplatesTitle() {
- String textAllTemp = CommonTask.getText(templatesAllTemplatesTitle, "all templates ");
- return textAllTemp;
- }
- public String getTextFavouritesTitle() {
- String textFav = CommonTask.getText(templatesFavouritesTitle, "favourites title");
- return textFav;
- }
- public String getTextTemplateName() {
- if (templatesContactName.size() > 0) {
- return CommonTask.getText(templatesContactName.get(0), "template name");
- }
- return null;
- }
- public Boolean isEditableTemplatesSearch() {
- return CommonTask.isElementEnabledAndDisplayed(templatesSearch, "search Icon");
- }
- public void tapTemplatesFilter() {
- CommonTask.tapButton(driver, templatesSearch, "templates filter");
- }
- public void setTemplatesSearchField(String textToSearch) {
- CommonTask.sendKeys(templatesSearch, textToSearch, "templates search field");
- driver.hideKeyboard();
- }
- public void clearTemplatesSearchField() {
- CommonTask.tapButton(driver, templatesSearchCloseButton, "templates close");
- }
- /**
- * Returns the position of the given contactLabelName in the templates contact name list
- * Returns null if not found
- *
- * @param contactLabelName
- * @return
- */
- private Integer getIndexTemplatesContactName(String contactLabelName) {
- for (int i = 0; i < templatesContactName.size(); i++) {
- String textFound = CommonTask.getText(templatesContactName.get(i), "");
- if (textFound.equalsIgnoreCase(contactLabelName)) {
- return i;
- }
- }
- return null;
- }
- public boolean hasTemplatesContactName(String contactLabelName) {
- for (int i = 0; i < templatesContactName.size(); i++) {
- String textFound = CommonTask.getText(templatesContactName.get(i), "");
- if (textFound.equalsIgnoreCase(contactLabelName)) {
- return true;
- }
- }
- return false;
- }
- public void clickTemplatesContactNameLabel(String contactName) {
- Integer index = getIndexTemplatesContactName(contactName);
- if (index != null) {
- templatesContactName.get(index).click();
- }
- }
- public void clickTemplatesFavouriteButton(String contactName) {
- Integer index = getIndexTemplatesContactName(contactName);
- if (index != null) {
- CommonTask.tapButton(driver, templatesAddToFavButton.get(index), "add to favourite button");
- }
- }
- /**
- * Active the favourite if is not already enabled.
- * @param template
- */
- public void enableTemplateFavouriteButton(Template template){
- if(!template.getFavorite()){
- clickTemplatesFavouriteButton(template.getName());
- }
- }
- public void clickTemplatesNewPaymentButton(String contactName) {
- Integer index = getIndexTemplatesContactName(contactName);
- if (index != null) {
- CommonTask.tapButton(driver, templatesNewPaymentButton.get(index), " new payment button");
- }
- }
- public void deleteTemplatesContactButton(String contactName) {
- Integer index = getIndexTemplatesContactName(contactName);
- if (index != null) {
- CommonTask.tapButton(driver, templatesDeleteContactButton.get(index), " delete contact button");
- }
- }
- public void deleteTemplatesConfirmation() {
- CommonTask.tapButton(driver, templatesDeleteButton, "delete template");
- CommonTask.getText(templatesConfirmationDeleteMessage, "confirmation delete template message");
- }
- public void deleteTemplatesCancel() {
- CommonTask.tapButton(driver, templatesDeleteButton, "camcel delete template");
- }
- public List<Template> getListOfTemplatesFromWS() {
- String response = CommonRestTask.getStringFromEndpoint(EndPoint.TEMPLATES.getValue(), cookie);
- Log4Test.info(response);
- List<Template> templates = null;
- if (response != null && !response.isEmpty()) {
- try {
- templates = mapper.readValue(response, new TypeReference<List<Template>>() {
- });
- // Collections.sort(templates);;
- } catch (IOException e) {
- LOGGER.warn("Read value exception", e);
- Assert.fail("Cannot read templates from WS");
- }
- }
- return templates;
- }
- public List<AccountsInfo> getListOfAccountsFromWS() {
- String response = CommonRestTask.getStringFromEndpoint(EndPoint.ACCOUNT_LIST_OPT.getValue(), cookie);
- Log4Test.info(EndPoint.ACCOUNT_LIST_OPT.getValue());
- Log4Test.info(response);
- List<AccountsInfo> accounts = null;
- if (response != null && !response.isEmpty()) {
- try {
- accounts = mapper.readValue(response, new TypeReference<List<AccountsInfo>>() {
- });
- //Collections.sort(accounts);;
- } catch (IOException e) {
- LOGGER.warn("Read value exception", e);
- Assert.fail("Cannot read templates from WS");
- }
- }
- return accounts;
- }
- public String getAllTemplatesTitle(){
- List<Template> listOfTemplatesFromWS = getListOfTemplatesFromWS();
- if (listOfTemplatesFromWS != null && listOfTemplatesFromWS.size() > 0) {
- return getTextAllTemplatesTitle();
- } else {
- return TemplatesConstants.TEMPLATES_ALLTEMPLATES_TITLE_EN;
- }
- }
- public Template getFirstTemplateFromWs(){
- List<Template> templates = getListOfTemplatesFromWS();
- if(templates!=null && templates.size()>0) {
- return templates.get(0);
- }else{
- Assert.fail("No templates defined in WS!");
- return null;
- }
- }
- public Template getSecondTemplateFromWs(){
- List<Template> templates = getListOfTemplatesFromWS();
- if(templates!=null && templates.size()>1) {
- return templates.get(1);
- }else{
- Assert.fail("No templates defined in WS!");
- return null;
- }
- }
- public Template getTemplateFromWSWithActId(String actionId){
- List<Template> templates = getListOfTemplatesFromWS();
- for(int i=0;i<templates.size();i++){
- Template temp=templates.get(i);
- if(actionId.equals(temp.getActionId())){
- return temp;
- }
- }
- return null;
- }
- public AccountsInfo getAccountDetailsFromWS(String iban) {
- String accountId = TemplatesUtils.getAccountIdFromIban(iban);
- String response = CommonRestTask.getStringFromEndpoint
- (EndPoint.ACCOUNT_LIST.getValue("?id=" + accountId + "&typeId=20&fetchOptions=NICKNAME"), cookie);
- Log4Test.info("getAccountDetailsFromWS ##############" + response);
- Log4Test.info("getAccountDetailsFromWS ##############" + EndPoint.ACCOUNT_LIST
- .getValue("?id=" + accountId + "&fetchOptions=NICKNAME"));
- AccountsInfo info = null;
- if (response != null && !response.isEmpty()) {
- try {
- info = mapper.readValue(response, AccountsInfo.class);
- } catch (IOException e) {
- LOGGER.warn("Read value exception", e);
- }
- }
- Log4Test.info(response);
- return info;
- }
- }
- package com.athena.appium.pages.templates;
- public class TemplatesUtils {
- public final static int ACCOUNT_ID_LENGTH=10;
- public static String getAccountIdFromIban(String iban){
- int x=iban.length();
- int z=x-ACCOUNT_ID_LENGTH;
- return iban.substring(z);
- }
- }
- package com.athena.appium.pages.templates.beans;
- import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
- @JsonIgnoreProperties(ignoreUnknown = true)
- public class AccountsInfo {
- private String iban;
- private String nickname;
- public String getIban() {
- return iban;
- }
- public void setIban(String iban) {
- this.iban = iban;
- }
- public String getNickname() {
- return nickname;
- }
- public void setNickname(String nickname) {
- this.nickname = nickname;
- }
- }
- package com.athena.appium.pages.templates.beans;
- import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
- @JsonIgnoreProperties(ignoreUnknown = true)
- public class Payee {
- private String fullName;
- public String getFullName() {
- return fullName;
- }
- public void setFullName(String fullName) {
- this.fullName = fullName;
- }
- }
- package com.athena.appium.pages.templates.beans;
- import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
- import java.util.List;
- @JsonIgnoreProperties(ignoreUnknown = true)
- public class Template implements Comparable<Template>{
- private String actionId;
- private String currency;
- private List<String> details;
- private TemplateAccount fromAccount;
- private TemplateAccount toAccount;
- private Long templateId;
- private String name;
- private String beneficiaryName;
- private Boolean smAvailability;
- private Boolean favorite;
- private String avatarName;
- private Payee payee;
- public String getCurrency() {
- return currency;
- }
- public void setCurrency(String currency) {
- this.currency = currency;
- }
- public TemplateAccount getFromAccount() {
- return fromAccount;
- }
- public void setFromAccount(TemplateAccount fromAccount) {
- this.fromAccount = fromAccount;
- }
- public TemplateAccount getToAccount() {
- return toAccount;
- }
- public void setToAccount(TemplateAccount toAccount) {
- this.toAccount = toAccount;
- }
- public Long getTemplateId() {
- return templateId;
- }
- public void setTemplateId(Long templateId) {
- this.templateId = templateId;
- }
- public String getName() {
- return name;
- }
- public void setName(String name) {
- this.name = name;
- }
- public String getBeneficiaryName() {
- return beneficiaryName;
- }
- public void setBeneficiaryName(String beneficiaryName) {
- this.beneficiaryName = beneficiaryName;
- }
- public Boolean getSmAvailability() {
- return smAvailability;
- }
- public void setSmAvailability(Boolean smAvailability) {
- this.smAvailability = smAvailability;
- }
- public Boolean getFavorite() {
- return favorite;
- }
- public void setFavorite(Boolean favorite) {
- this.favorite = favorite;
- }
- public String getAvatarName() {
- return avatarName;
- }
- public void setAvatarName(String avatarName) {
- this.avatarName = avatarName;
- }
- public String getActionId() {
- return actionId;
- }
- public void setActionId(String actionId) {
- this.actionId = actionId;
- }
- public List<String> getDetails() {
- return details;
- }
- public void setDetails(List<String> details) {
- this.details = details;
- }
- public Payee getPayee() {
- return payee;
- }
- public void setPayee(Payee payee) {
- this.payee = payee;
- }
- @Override
- public int compareTo(Template o) {
- return this.getName().compareTo(o.getName());
- }
- }
- package com.athena.appium.pages.templates.beans;
- import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
- @JsonIgnoreProperties(ignoreUnknown = true)
- public class TemplateAccount {
- private String iban;
- private String owner;
- public String getIban() {
- return iban;
- }
- public void setIban(String iban) {
- this.iban = iban;
- }
- public String getOwner() {
- return owner;
- }
- public void setOwner(String owner) {
- this.owner = owner;
- }
- }
- package com.athena.appium.pages.templates.beans;
- public class TemplateValues {
- private String name;
- private String toAccount;
- private String fromAccount;
- private String details;
- private String beneficiary;
- public String getName() {
- return name;
- }
- public void setName(String name) {
- this.name = name;
- }
- public String getToAccount() {
- return toAccount;
- }
- public void setToAccount(String toAccount) {
- this.toAccount = toAccount;
- }
- public String getFromAccount() {
- return fromAccount;
- }
- public void setFromAccount(String fromAccount) {
- this.fromAccount = fromAccount;
- }
- public String getDetails() {
- return details;
- }
- public void setDetails(String details) {
- this.details = details;
- }
- public String getBeneficiary() {
- return beneficiary;
- }
- public void setBeneficiary(String beneficiary) {
- this.beneficiary = beneficiary;
- }
- }
- package com.athena.appium.tests.pf_tests;
- import com.athena.appium.utils.enums.Language;
- import com.athena.appium.utils.testdata.TestData;
- import com.athena.appium.listeners.ExtentTestListener;
- import com.athena.appium.pages.product_and_product_attributes.Accounts.AccountFetchOption;
- import com.athena.appium.pages.product_and_product_attributes.Accounts.AccountType;
- import com.athena.appium.pages.product_and_product_attributes.Details.DetailsPage;
- import com.athena.appium.pages.product_and_product_attributes.Garnishments.GarnishmentAccountOverviewPage;
- import com.google.gson.JsonArray;
- import io.appium.java_client.AppiumDriver;
- import io.appium.java_client.MobileElement;
- import org.testng.Assert;
- import org.testng.annotations.Test;
- public class GarnishmentDetailesTest extends ExtentTestListener {
- private static final String GARNISH_POPRIRI_RO="Popriri";
- @Test(description = " RO Verify garnishment account ")
- public void testGarnishmentROPF() throws Exception {
- AppiumDriver driver = getDriver();
- DetailsPage garAccOver =new DetailsPage(driver);
- garAccOver.selectLanguageProfile(Language.RO);
- garAccOver.login(TestData.PF,TestData.PI_AUTO_USER,TestData.GENERAL_PASSWORD_02);
- garAccOver.tapAccount(TestData.PF, garAccOver.getAccountTypeName(AccountType.CURRENT_ACCOUNT_WITH_GARNISHMENT));
- garAccOver.tapOnDetailsButton();
- MobileElement elem =garAccOver.getLabelElementByName(GARNISH_POPRIRI_RO);
- Assert.assertNotNull(elem);
- String nbrOfGarnishment=garAccOver.getValueByName(GARNISH_POPRIRI_RO);
- String wsNbr=garAccOver.getWSGarnishmentNbr()+"";
- Assert.assertEquals(nbrOfGarnishment,wsNbr);
- testInfo("nbr of garnishment from ui: " + nbrOfGarnishment + " nbr of garnishment from WS : " + wsNbr);
- }
- }
- }
- return endPointResult;
- }
- public static String getStringFromEndpoint(String endPoint, Map<String, String> cookies) {
- Response endPointResult = given()
- .urlEncodingEnabled(false)
- .header("Content-Type", TestData.APP_JSON)
- .cookies(cookies)
- .when()
- .get(endPoint)
- .then()
- .extract().response();
- return endPointResult.asString();
- }
- }
- DIRECT_DEBIT_LIST("/directdebit/v1/mandate/list"),
- QUICK_PAYMENTS("/payments-ws/v1/quick-payments/payments?includeBalance=true"),
- DEPOSIT_ELIGIBLE_ACCOUNTS("/accounts-ws/v2/accounts/eligible/tm"),
- WS_TIME("/utils-service/v1/now");
- WS_TIME("/utils-service/v1/now"),
- TEMPLATES("/payment-templates/v1/template/list"),
- ACCOUNTS_BY_ID("/accounts-ws/v1/accounts"),
- ACCOUNT_LIST_OPT("/accounts-ws/v1/accounts/list?fetchOptions=NICKNAME");
- public static final String baseURI = "https://ro-" + TestData.ENV + ".rbro.rbg.cc/services";
- public static final String TEST_AUTO_USER_05 = "testautouser05";
- public static final String TEST_AUTO_USER_06 = "testautouser07";
- public static final String Test_AUTO="vn-84-vly";
- public static final String GENERAL_PASSWORD_02="test1234";
- // -------------- PRELIVE USERS ----------------------
- public static final String TEST_AUTO_PRE_06 = "testpf16";
- public static final String TEST_AUTO_PRE_01 = "testpf16";
- public static final String TEST_AUTO_PF_PRE = "testpf16";
- public static final String PI_AUTO_USER = "testpf16";
- public static final String TEST_PF_34 = "testpf34";
- public static final String PI_AUTO_USER16 = "testpf16";
- public static final String PI_AUTO_USER17 = "testpf17";
- public static final String PI_AUTO_USER10 = "testpf10";
- // --------------- GENERAL USER PRE/TEST --------------
- public static final String USER_PROFILE_GROUP = "UserProfile";
- public static final String ACCOUNT_STATEMENT_GROUP = "AccountStatement";
- public static final String NEED_HELP_GROUP = "NeedHelp";
- public static final String TEMPLATES_GROUP ="Templates";
- // ---------- Type Group
- public static final String LABELS_GROUP = "UI";
- public static final String FNCT_GROUP = "Functionality";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement