-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Selenium: Payment Verification - happy path (#4008)
* Init * Test * Added test_smoke_payment_verification_details * Black * Black * Black * Init * Added to tests payment record part * In progress test_happy_path_payment_verification * add data-cy for breadcrumbs * In progress test_happy_path_payment_verification * Added test_happy_path_payment_verification * update snaphots * Fix test_happy_path_payment_verification * Fix test_smoke_payment_verification_details * Black * Isort --------- Co-authored-by: Maciej Szewczyk <[email protected]>
- Loading branch information
1 parent
eadd15f
commit b878822
Showing
17 changed files
with
298 additions
and
25 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
112 changes: 112 additions & 0 deletions
112
backend/selenium_tests/page_object/payment_verification/payment_record.py
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,112 @@ | ||
from page_object.base_components import BaseComponents | ||
from selenium.webdriver.remote.webelement import WebElement | ||
|
||
|
||
class PaymentRecord(BaseComponents): | ||
pageHeaderContainer = 'div[data-cy="page-header-container"]' | ||
pageHeaderTitle = 'h5[data-cy="page-header-title"]' | ||
buttonEdPlan = 'button[data-cy="button-ed-plan"]' | ||
labelStatus = 'div[data-cy="label-STATUS"]' | ||
statusContainer = 'div[data-cy="status-container"]' | ||
labelHousehold = 'div[data-cy="label-Household"]' | ||
labelTargetPopulation = 'div[data-cy="label-TARGET POPULATION"]' | ||
labelDistributionModality = 'div[data-cy="label-DISTRIBUTION MODALITY"]' | ||
labelAmountReceived = 'div[data-cy="label-AMOUNT RECEIVED"]' | ||
labelHouseholdId = 'div[data-cy="label-HOUSEHOLD ID"]' | ||
labelHeadOfHousehold = 'div[data-cy="label-HEAD OF HOUSEHOLD"]' | ||
labelTotalPersonCovered = 'div[data-cy="label-TOTAL PERSON COVERED"]' | ||
labelPhoneNumber = 'div[data-cy="label-PHONE NUMBER"]' | ||
labelAltPhoneNumber = 'div[data-cy="label-ALT. PHONE NUMBER"]' | ||
labelEntitlementQuantity = 'div[data-cy="label-ENTITLEMENT QUANTITY"]' | ||
labelDeliveredQuantity = 'div[data-cy="label-DELIVERED QUANTITY"]' | ||
labelCurrency = 'div[data-cy="label-CURRENCY"]' | ||
labelDeliveryType = 'div[data-cy="label-DELIVERY TYPE"]' | ||
labelDeliveryDate = 'div[data-cy="label-DELIVERY DATE"]' | ||
labelEntitlementCardId = 'div[data-cy="label-ENTITLEMENT CARD ID"]' | ||
labelTransactionReferenceId = 'div[data-cy="label-TRANSACTION REFERENCE ID"]' | ||
labelEntitlementCardIssueDate = 'div[data-cy="label-ENTITLEMENT CARD ISSUE DATE"]' | ||
labelFsp = 'div[data-cy="label-FSP"]' | ||
buttonSubmit = 'button[data-cy="button-submit"]' | ||
inputReceivedamount = 'input[data-cy="input-receivedAmount"]' | ||
|
||
def getInputReceivedamount(self) -> WebElement: | ||
return self.wait_for(self.inputReceivedamount) | ||
|
||
def getPageHeaderContainer(self) -> WebElement: | ||
return self.wait_for(self.pageHeaderContainer) | ||
|
||
def getPageHeaderTitle(self) -> WebElement: | ||
return self.wait_for(self.pageHeaderTitle) | ||
|
||
def getButtonEdPlan(self) -> WebElement: | ||
# Workaround because elements overlapped even though Selenium saw that they were available: | ||
self.driver.execute_script( | ||
""" | ||
container = document.querySelector("div[data-cy='main-content']") | ||
container.scrollBy(0,-200) | ||
""" | ||
) | ||
return self.wait_for(self.buttonEdPlan) | ||
|
||
def getLabelStatus(self) -> [WebElement]: | ||
return self.get_elements(self.labelStatus) | ||
|
||
def getStatusContainer(self) -> WebElement: | ||
return self.wait_for(self.statusContainer) | ||
|
||
def getLabelHousehold(self) -> WebElement: | ||
return self.wait_for(self.labelHousehold) | ||
|
||
def getLabelTargetPopulation(self) -> WebElement: | ||
return self.wait_for(self.labelTargetPopulation) | ||
|
||
def getLabelDistributionModality(self) -> WebElement: | ||
return self.wait_for(self.labelDistributionModality) | ||
|
||
def getLabelAmountReceived(self) -> WebElement: | ||
return self.wait_for(self.labelAmountReceived) | ||
|
||
def getLabelHouseholdId(self) -> WebElement: | ||
return self.wait_for(self.labelHouseholdId) | ||
|
||
def getLabelHeadOfHousehold(self) -> WebElement: | ||
return self.wait_for(self.labelHeadOfHousehold) | ||
|
||
def getLabelTotalPersonCovered(self) -> WebElement: | ||
return self.wait_for(self.labelTotalPersonCovered) | ||
|
||
def getLabelPhoneNumber(self) -> WebElement: | ||
return self.wait_for(self.labelPhoneNumber) | ||
|
||
def getLabelAltPhoneNumber(self) -> WebElement: | ||
return self.wait_for(self.labelAltPhoneNumber) | ||
|
||
def getLabelEntitlementQuantity(self) -> WebElement: | ||
return self.wait_for(self.labelEntitlementQuantity) | ||
|
||
def getLabelDeliveredQuantity(self) -> WebElement: | ||
return self.wait_for(self.labelDeliveredQuantity) | ||
|
||
def getLabelCurrency(self) -> WebElement: | ||
return self.wait_for(self.labelCurrency) | ||
|
||
def getLabelDeliveryType(self) -> WebElement: | ||
return self.wait_for(self.labelDeliveryType) | ||
|
||
def getLabelDeliveryDate(self) -> WebElement: | ||
return self.wait_for(self.labelDeliveryDate) | ||
|
||
def getLabelEntitlementCardId(self) -> WebElement: | ||
return self.wait_for(self.labelEntitlementCardId) | ||
|
||
def getLabelTransactionReferenceId(self) -> WebElement: | ||
return self.wait_for(self.labelTransactionReferenceId) | ||
|
||
def getLabelEntitlementCardIssueDate(self) -> WebElement: | ||
return self.wait_for(self.labelEntitlementCardIssueDate) | ||
|
||
def getLabelFsp(self) -> WebElement: | ||
return self.wait_for(self.labelFsp) | ||
|
||
def getButtonSubmit(self) -> WebElement: | ||
return self.wait_for(self.buttonSubmit) |
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
Oops, something went wrong.