-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31 from najeeb1023/billPay_feature
Bill pay feature
- Loading branch information
Showing
11 changed files
with
815 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
@Regression @PayBill | ||
Feature: User is able to transfer funds to an account. | ||
|
||
User is logged in their account and is able to transfer some amount | ||
to another account. | ||
|
||
Background: User is logged in. | ||
Given The user lands at the webpage. | ||
When User registers new user account. | ||
Then The user is logged in successfully. | ||
|
||
Scenario: User is able to pay bill. | ||
When The user navigates to bill pay tab. | ||
And Enters "<Payee Name>", "<Address>", "<City>", "<State>", "<Zip Code>", "<Phone Number>", "<Account Number>", "<Verify Account>", "<Amount>" | ||
And Selects account number, pressing the send payment. | ||
|
||
Examples: | ||
| Payee Name | Address | City | State | Zip Code | Phone Number | Account Number | Verify Account | Amount | | ||
| John Shilok | Jackman Street 11 | New York | New York | 798623 | 87234876 | 9827346987234 | 9827346987234 | 4750 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import { Page, expect } from "@playwright/test"; | ||
import { pageFixture } from "../hooks/pageFixture"; | ||
import { PageElement } from "../resources/interfaces/iPageElement"; | ||
import * as billPayLocators from "../resources/billPayLocators.json"; | ||
|
||
function getResource(resourceName: string){ | ||
return billPayLocators.webElements.find((element: PageElement) => element.elementName == resourceName) as PageElement | ||
}; | ||
|
||
export class BillPay { | ||
|
||
constructor(public page: Page){ | ||
pageFixture.page = page; | ||
}; | ||
|
||
billPaylocators = { | ||
billPayTab:() => pageFixture.page.locator(getResource('billPayTab').selectorValue), | ||
payeeName:() => pageFixture.page.locator(getResource('payeeName').selectorValue), | ||
payeeAddress:() => pageFixture.page.locator(getResource('payeeAddress').selectorValue), | ||
payeeCity:() => pageFixture.page.locator(getResource('payeeCity').selectorValue), | ||
payeeState:() => pageFixture.page.locator(getResource('payeeState').selectorValue), | ||
payeeZip:() => pageFixture.page.locator(getResource('payeeZip').selectorValue), | ||
payeeNum:() => pageFixture.page.locator(getResource('payeeNum').selectorValue), | ||
payeeAcc:() => pageFixture.page.locator(getResource('payeeAcc').selectorValue), | ||
payeeConfirmAcc:() => pageFixture.page.locator(getResource('payeeConfirmAcc').selectorValue), | ||
amountToPay:() => pageFixture.page.locator(getResource('amountToPay').selectorValue), | ||
fromAccountDropDown:() => pageFixture.page.locator(getResource('fromAccountDropDown').selectorValue), | ||
sendPaymentBtn:() => pageFixture.page.locator(getResource('sendPaymentBtn').selectorValue), | ||
billPaymentConfirmation:() => pageFixture.page.locator(getResource('billPaymentConfirmation').selectorValue) | ||
} | ||
|
||
public async navigateToBillPay ():Promise<void> { | ||
await this.billPaylocators.billPayTab().click(); | ||
}; | ||
|
||
public async enterPayeeDetails (payeeName, payeeAddress, payeeCity, payeeState, payeeZip, payeeNum, payeAcc, payeeConfirmAcc, amountToPay):Promise<void> { | ||
await this.billPaylocators.payeeName().fill(payeeName); | ||
await this.billPaylocators.payeeAddress().fill(payeeAddress); | ||
await this.billPaylocators.payeeCity().fill(payeeCity); | ||
await this.billPaylocators.payeeState().fill(payeeState); | ||
await this.billPaylocators.payeeZip().fill(payeeZip); | ||
await this.billPaylocators.payeeNum().fill(payeeNum); | ||
await this.billPaylocators.payeeAcc().fill(payeAcc); | ||
await this.billPaylocators.payeeConfirmAcc().fill(payeeConfirmAcc); | ||
await this.billPaylocators.amountToPay().fill(amountToPay); | ||
let accountNum = [(await this.billPaylocators.fromAccountDropDown().textContent()).trim()]; | ||
await this.billPaylocators.fromAccountDropDown().selectOption(accountNum); | ||
await this.billPaylocators.sendPaymentBtn().click(); | ||
}; | ||
|
||
public async assertSentPayment ():Promise<void> { | ||
let confirmPayment = await this.billPaylocators.billPaymentConfirmation().textContent(); | ||
expect(confirmPayment).toContain('was successful'); | ||
process.stdout.write("\n" + (" ") +confirmPayment.trim() + "\n" + "\n"); | ||
} | ||
|
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
{ | ||
"name": "Bill Pay Locators", | ||
"webElements": [ | ||
{ | ||
"elementName": "billPayTab", | ||
"selectorValue": "//div[contains(@id,'leftPanel')]//li[4]" | ||
}, | ||
{ | ||
"elementName": "payeeName", | ||
"selectorValue": "//table[contains(@class, 'form2')]//input[contains(@name, 'payee.name')]" | ||
}, | ||
{ | ||
"elementName": "payeeAddress", | ||
"selectorValue": "//table[contains(@class, 'form2')]//input[contains(@name, 'payee.address.street')]" | ||
}, | ||
{ | ||
"elementName": "payeeCity", | ||
"selectorValue": "//table[contains(@class, 'form2')]//input[contains(@name, 'payee.address.city')]" | ||
}, | ||
{ | ||
"elementName": "payeeState", | ||
"selectorValue": "//table[contains(@class, 'form2')]//input[contains(@name, 'payee.address.state')]" | ||
}, | ||
{ | ||
"elementName": "payeeZip", | ||
"selectorValue": "//table[contains(@class, 'form2')]//input[contains(@name, 'payee.address.zip')]" | ||
}, | ||
{ | ||
"elementName": "payeeNum", | ||
"selectorValue": "//table[contains(@class, 'form2')]//input[contains(@name, 'payee.phoneNumber')]" | ||
}, | ||
{ | ||
"elementName": "payeeAcc", | ||
"selectorValue": "//table[contains(@class, 'form2')]//input[contains(@name, 'payee.accountNumber')]" | ||
}, | ||
{ | ||
"elementName": "payeeConfirmAcc", | ||
"selectorValue": "//table[contains(@class, 'form2')]//input[contains(@name, 'verifyAccount')]" | ||
}, | ||
{ | ||
"elementName": "amountToPay", | ||
"selectorValue": "//table[contains(@class, 'form2')]//input[contains(@name, 'amount')]" | ||
}, | ||
{ | ||
"elementName": "fromAccountDropDown", | ||
"selectorValue": "//table[contains(@class, 'form2')]//select[contains(@name, 'fromAccountId')]" | ||
}, | ||
{ | ||
"elementName": "sendPaymentBtn", | ||
"selectorValue": "//table[contains(@class, 'form2')]//input[contains(@type,'submit')]" | ||
}, | ||
{ | ||
"elementName": "billPaymentConfirmation", | ||
"selectorValue": "//div[contains(@id, 'rightPanel')]//div[contains(@ng-show, 'showResult')]//p[1]" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { When } from "@cucumber/cucumber"; | ||
import { BillPay } from "../pages/BillPay"; | ||
import { pageFixture } from "../hooks/pageFixture"; | ||
|
||
let billPay = new BillPay(pageFixture.page); | ||
|
||
When("The user navigates to bill pay tab.", async function () { | ||
await billPay.navigateToBillPay(); | ||
}); | ||
|
||
When("Enters {string}, {string}, {string}, {string}, {string}, {string}, {string}, {string}, {string}", async function (payeeName, payeeAddress, payeeCity, payeeState,payeeZip, payeeNum, payeAcc, payeeConfirmAcc, amountToPay) { | ||
await billPay.enterPayeeDetails(payeeName, payeeAddress, payeeCity, payeeState, payeeZip, payeeNum, payeAcc, payeeConfirmAcc, amountToPay); | ||
}); | ||
|
||
When("Selects account number, pressing the send payment.", async function () { | ||
await billPay.assertSentPayment(); | ||
}); |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file modified
BIN
+43 Bytes
(100%)
test-result/screenshots/User is able to create a new checking account..png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-302 Bytes
(100%)
test-result/screenshots/User is able to see their account details..png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+537 Bytes
(100%)
test-result/screenshots/User is registered and logged in..png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.