Protractor tests.
diff --git a/Pages/Deposits.js b/Pages/Deposits.js
index 1216d31..e692b13 100644
--- a/Pages/Deposits.js
+++ b/Pages/Deposits.js
@@ -10,14 +10,24 @@
var radioSavings = $$("md-radio-group md-radio-button").get(1);
var radioShare = $$("md-radio-group md-radio-button").get(2);
var shortNameInput = $("fims-id-input[controlname='identifier'] input");
-var nameInput = $(".mat-input-infix input[controlname='name']");
-var descriptionInput = $(".mat-input-infix input[controlname='description']");
+var nameInput = $(".mat-input-infix input[formcontrolname='name']");
+var descriptionInput = $(".mat-input-infix input[formcontrolname='description']");
var minimumBalanceInput = $("fims-number-input[controlname='minimumBalance'] input");
var currencySelect = $("md-select[formcontrolname='currencyCode']");
+var radioGroupInterest = $("md-radio-group[formcontrolname='termInterestPayable']");
+var radioMaturity = radioGroupInterest.$$("md-radio-button").get(0);
+var radioAnnually = radioGroupInterest.$$("md-radio-button").get(1);
+var radioQuarterly = radioGroupInterest.$$("md-radio-button").get(2);
+var radioMonthly = radioGroupInterest.$$("md-radio-button").get(3);
+var checkboxFlexibleInterest = $("md-checkbox[formcontrolname='flexible']")
var interestInput = $("fims-number-input[controlname='interest'] input");
var termPeriodInput = $(".mat-input-infix input[formcontrolname='termPeriod']");
var fixedTermEnabledToggle = $("md-slide-toggle[formcontrolname='fixedTermEnabled']");
-var termTimeUnit = $("md-radio-group[formcontrolname='fixedTermEnabled']");
+var termTimeUnit = $("md-radio-group[formcontrolname='termTimeUnit']");
+var radioMonth = termTimeUnit.$$("md-radio-button input").get(0);
+var radioYear = termTimeUnit.$$("md-radio-button input").get(1);
+
+
var cashAccountInput = $("fims-account-select[formcontrolname='cashAccountIdentifier'] input");
var expenseAccountInput = $("fims-account-select[formcontrolname='expenseAccountIdentifier'] input");
var accrueAccountInput = $("fims-account-select[formcontrolname='accrueAccountIdentifier'] input");
@@ -28,9 +38,10 @@
goToDepositsViaSidePanel: function() {
$("a[href='/deposits']").click();
},
- verifyCardHasTitle: function() {
+ verifyCardHasTitle: function(text) {
+ browser.wait(EC.visibilityOf(titleRow), 5000);
form_title = titleRow.getText();
- expect(form_title).toEqual("Manage Deposit Products");
+ expect(form_title).toEqual(text);
},
clickButtonCreateDepositAccount: function(){
browser.wait(EC.visibilityOf(createDeposit), 5000);
@@ -65,22 +76,52 @@
descriptionInput.click().sendKeys(text);
},
enterTextIntoMinimumBalanceInputField: function(text) {
- minimumBalanceInput.click().sendKeys(text);
+ minimumBalanceInput.click().clear().sendKeys(text);
+ },
+ verifyRadioAnnuallyIsSelected: function(){
+ expect(radioAnnually.getAttribute('class')).toMatch('mat-radio-checked');
+ },
+ verifyCheckboxFlexibleInterestNotChecked: function(){
+ //expect(checkboxFlexibleInterest.getAttribute('class')).toNotMatch('mat-checkbox-checked');
+ browser.wait(EC.not(EC.elementToBeSelected(checkboxFlexibleInterest)), 3000);
},
enterTextIntoInterestInputField: function(text) {
- interestInput.click().sendKeys(text);
+ interestInput.click().clear().sendKeys(text);
},
enterTextIntoTermPeriodInputField: function(text) {
termPeriodInput.click().sendKeys(text);
},
verifyFixedTermToggleSetToOff: function(){
- //
+ toggleClass = fixedTermEnabledToggle.getAttribute('class');
+ expect(toggleClass).not.toContain("mat-checked");
+ },
+ verifyFixedTermToggleSetToOn: function(){
+ toggleClass = fixedTermEnabledToggle.getAttribute('class');
+ expect(toggleClass).toContain("mat-checked");
+ },
+ toggleFixedTermToOn: function() {
+ this.verifyFixedTermToggleSetToOff();
+ $(".mat-slide-toggle-content").click();
+ this.verifyFixedTermToggleSetToOn();
+ },
+ toggleFixedTermToOff: function() {
+ this.verifyFixedTermToggleSetToOn();
+ $(".mat-slide-toggle-content").click();
+ this.verifyFixedTermToggleSetToOff();
},
verifyTermPeriodInputFieldIsDisabled: function(){
- //
+ expect(termPeriodInput.isEnabled()).toBe(false);
},
- verifyRadioButtonsMonthAndYearDisabled: function(){
- //
+ verifyTermPeriodInputFieldIsEnabled: function(){
+ expect(termPeriodInput.isEnabled()).toBe(true);
+ },
+ verifyRadioButtonsMonthAndYearDisabled: function() {
+ expect(radioMonth.isEnabled()).toBe(false);
+ expect(radioYear.isEnabled()).toBe(false);
+ },
+ verifyRadioButtonsMonthAndYearEnabled: function() {
+ expect(radioMonth.isEnabled()).toBe(true);
+ expect(radioYear.isEnabled()).toBe(true);
},
enterTextIntoCashAccountInputField: function(text) {
cashAccountInput.click().sendKeys(text);
diff --git a/Pages/Teller.js b/Pages/Teller.js
index e14c9c4..a8b6646 100644
--- a/Pages/Teller.js
+++ b/Pages/Teller.js
@@ -30,10 +30,10 @@
clickButtonShowAtIndex: function(i){
$$("button[title='SHOW']").get(i).click();
},
- verifyCardHasTitleHasNameOfCustomer: function (text) {
+ verifyCardTitleHasNameOfCustomer: function (text) {
browser.wait(EC.presenceOf($('fims-portrait')), 10000);
form_title = $("fims-layout-card-over .mat-toolbar-row div").getText();
- expect(form_title).toEqual(text);
+ expect(form_title).toMatch(text);
},
pauseTeller: function(){
$("a[title='Pause']").click();
diff --git a/Specs/gate1.js b/Specs/gate1.js
index 1d3fc59..0b246d1 100644
--- a/Specs/gate1.js
+++ b/Specs/gate1.js
@@ -6,7 +6,8 @@
//5) New employee creates a teller for the branch office
//6) New employee opens the teller and assigns it to himself
//7) New employee creates a customer
-//8) New employee unlocks the teller
+//8) New employee unlocks the teller, views customer and pauses teller again
+//9) New employee creates a deposit product
//test 1 and 3 fail if role and headquarter already exist, but other tests should be able to continue
var helper = require('../helper.js');
@@ -25,6 +26,7 @@
officeIdentifier = helper.getRandomString(6);
tellerIdentifier = helper.getRandomString(4);
customerAccount = helper.getRandomString(5);
+ depositIdentifier = helper.getRandomString(4);
it('should create a new administrator role', function () {
Common.waitForThePageToFinishLoading();
@@ -119,14 +121,14 @@
Common.verifyFirstRowOfSearchResultHasTextAsId(customerAccount);
});
- it('assigned employee should be able to unlock teller', function () {
+ it('assigned employee should be able to unlock teller and view customer', function () {
Teller.goToTellerManagementViaSidePanel();
Teller.enterTextIntoTellerNumberInputField(tellerIdentifier);
Teller.enterTextIntoPasswordInputField("qazwsx123!!");
Teller.clickEnabledUnlockTellerButton();
- Teller.enterTextIntoSearchInputField("Pynchon");
+ Teller.enterTextIntoSearchInputField(customerAccount);
Teller.clickButtonShowAtIndex(0);
- Teller.verifyCardHasTitleHasNameOfCustomer("Thomas Pynchon");
+ Teller.verifyCardTitleHasNameOfCustomer("Thomas Pynchon");
//verify only appropriate actions are displayed for pending customer without any accounts (work in progress)
Common.clickBackButtonInTitleBar();
Teller.pauseTeller();
@@ -138,7 +140,18 @@
Deposits.verifyCardHasTitle("Create new deposit product");
Deposits.enterTextIntoShortNameInputField(depositIdentifier);
Deposits.verifyRadioCheckingIsSelected();
- Deposits.enterTextIntoNameInputField();
- Deposits.enterTextInto
+ Deposits.enterTextIntoNameInputField("My first deposit product");
+ Deposits.enterTextIntoMinimumBalanceInputField("100");
+ Deposits.verifyRadioAnnuallyIsSelected();
+ Deposits.verifyCheckboxFlexibleInterestNotChecked();
+ Deposits.enterTextIntoInterestInputField('0.05');
+ Deposits.verifyFixedTermToggleSetToOff();
+ Deposits.verifyTermPeriodInputFieldIsDisabled();
+ Deposits.verifyRadioButtonsMonthAndYearDisabled();
+ Deposits.toggleFixedTermToOn();
+ Deposits.verifyTermPeriodInputFieldIsEnabled();
+ Deposits.verifyRadioButtonsMonthAndYearEnabled();
+ Deposits.toggleFixedTermToOff();
+
});
});
\ No newline at end of file