Skip to content

Commit

Permalink
Merge pull request #37 from SalesforceFoundation/feature/robot_disbur…
Browse files Browse the repository at this point in the history
…sements

[Robot] Add Disbursement on an awarded Funding Request
  • Loading branch information
gaganpsandhu authored Mar 12, 2021
2 parents 8c2bc0f + b80153f commit 43ee97f
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 8 deletions.
12 changes: 9 additions & 3 deletions robot/OutboundFundsNPSP/doc/Keywords.html
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,8 @@
<!-- this is the header for the documentation as a whole -->
<div class="header">
<h1 class="title">Outbound Funds (npsp)</h1>
<div class="filter" right>
filter: <input id="filter" type="filter" />
<div class="filter right">
filter: <input id="filter" type="filter" />
</div>
</div>

Expand Down Expand Up @@ -345,6 +345,12 @@ <h2 title="robot/OutboundFundsNPSP/resources/OutboundFundsNPSP.py">
</td>
</tr>

<tr class="kwrow" id="OutboundFundsNPSP.py.Save Disbursement">
<td class="kwname">Save Disbursement</td>
<td class="kwargs"></td>
<td class="kwdoc"><p>Click Save Disbursement</p></td>
</tr>

<tr
class="kwrow"
id="OutboundFundsNPSP.py.Selenium Execute With Retry"
Expand Down Expand Up @@ -904,7 +910,7 @@ <h2 title="robot/OutboundFundsNPSP/resources/OutboundFundsNPSP.robot">
</div>
</div>
<div class="footer">
Generated on Wednesday March 10, 03:47 PM - cumulusci v3.28.0
Generated on Thursday March 11, 03:15 PM - cumulusci v3.28.0
</div>
</body>
</html>
7 changes: 7 additions & 0 deletions robot/OutboundFundsNPSP/resources/OutboundFundsNPSP.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,3 +193,10 @@ def click_related_list_wrapper_button(self, heading, button_title):
)
self.salesforce._jsclick(locator)
self.salesforce.wait_until_loading_is_complete()

@capture_screenshot_on_error
def save_disbursement(self):
"""Click Save Disbursement"""
locator = outboundfundsnpsp_lex_locators["details"]["button"].format("Save")
self.selenium.set_focus_to_element(locator)
self.selenium.get_webelement(locator).click()
4 changes: 4 additions & 0 deletions robot/OutboundFundsNPSP/resources/locators_51.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,9 @@
"flexi_button": "//div[@lst-listviewmanagerheader_listviewmanagerheader][.//span[@title='{}']]//lightning-button//button[text()='{}']",
"flexi_link": "//a//span[contains(text(),'{}')]",
},
"details": {
"button": "//button[contains(@class, 'slds-button') and text() = '{}']",
"header": "//h1//div[contains(@class, 'entityNameTitle') and contains(text(),'{}')]",
},
"link": "//a[contains(text(),'{}')]",
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,20 @@ Suite Teardown Capture Screenshot And Delete Records And Close Browser

*** Keywords ***
Setup Test Data
${ns} = Get Outfundsnpsp Namespace Prefix
${ns} = Get Outfundsnpsp Namespace Prefix
Set suite variable ${ns}
${fundingprogram} = API Create Funding Program
Store Session Record outfunds__Funding_Program__c ${fundingprogram}[Id]
Store Session Record ${ns}Funding_Program__c ${fundingprogram}[Id]
Set suite variable ${fundingprogram}
${contact} = API Create Contact
Store Session Record Contact ${contact}[Id]
Set suite variable ${contact}
${funding_request} = API Create Funding Request ${fundingprogram}[Id] ${contact}[Id]
Store Session Record outfunds__Funding_Request__c ${funding_request}[Id]
Store Session Record ${ns}Funding_Request__c ${funding_request}[Id]
Set suite variable ${funding_request}
${awardedfunding_request} = API Create Funding Request ${fundingprogram}[Id] ${contact}[Id]
... outfunds__Status__c=Awarded outfunds__Awarded_Amount__c=100000
Store Session Record outfunds__Funding_Request__c ${awardedfunding_request}[Id]
... ${ns}Status__c=Awarded ${ns}Awarded_Amount__c=100000
Store Session Record ${ns}Funding_Request__c ${awardedfunding_request}[Id]
Set suite variable ${awardedfunding_request}
${fr_name} = Generate New String
Set suite variable ${fr_name}
Expand Down Expand Up @@ -59,3 +59,23 @@ Create Funding Request via UI
wait until modal is closed
Current Page Should Be Details Funding_Request__c
Validate Field Value Funding Request Name contains ${fr_name}

Add a Disbursement on an awarded Funding Request
[Documentation] Creates a Funding Request via API.
... Go to Disbursements and add a new Disbursement
[tags] feature:Funding Request Disbursements
Go To Page Listing ${ns}Funding_Request__c
Click Link With Text ${awardedfunding_request}[Name]
Wait Until Loading Is Complete
Current Page Should Be Details Funding_Request__c
Click button Create Disbursements
wait until modal is open
Populate Field Number of Disbursements 4
Populate Field Interval 4
Populate Field Amount 80000
click button Calculate
Wait Until Element Is Visible text:Scheduled Date
Save Disbursement
Current Page Should Be Details Funding_Request__c
Validate Field Value Unpaid Disbursements contains $80,000.00
Validate Field Value Available for Disbursement contains $20,000.00

0 comments on commit 43ee97f

Please sign in to comment.