Skip to content

Commit

Permalink
Merge pull request #75 from SalesforceFoundation/feature/240
Browse files Browse the repository at this point in the history
240 / Winter '23 major release
  • Loading branch information
davidmreed authored Jul 22, 2022
2 parents 1099316 + 5fa0aaa commit d3f0183
Show file tree
Hide file tree
Showing 9 changed files with 62 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

## Latest Release

Summer '21 🌞 ⛵ 🌊
Winter '23 🌞 ⛵ 🌊
9 changes: 9 additions & 0 deletions cumulusci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,15 @@ tasks:
options:
update_future_releases: True

# Require Apex Code Coverage
run_tests:
options:
retry_failures:
- "unable to obtain exclusive access to this record"
- "UNABLE_TO_LOCK_ROW"
retry_always: True
required_per_class_code_coverage_percent: "95"

robot:
options:
suites: robot/OutboundFundsNPSP/tests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const REFRESH_LABEL = "Refresh List";
const SAVE_UPDATES_LABEL = "Save Updates";
const LOADING_ALTERNATIVE_TEXT = "Loading";

export default class ManageExpenditures extends LightningElement(LightningElement) {
export default class ManageExpenditures extends LightningElement {
labels = {
isNotDisbursement: {
warningBanner: {
Expand Down
14 changes: 14 additions & 0 deletions robot/OutboundFundsNPSP/doc/Keywords.html
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,20 @@ <h2 title="robot/OutboundFundsNPSP/resources/OutboundFundsNPSP.py">
</td>
</tr>

<tr class="kwrow" id="OutboundFundsNPSP.py.Select Tab">
<td class="kwname">Select Tab</td>
<td class="kwargs">
<i>title</i>
</td>
<td class="kwdoc">
<p>
Switch between different tabs on a record page
like Related, Details, News, Activity and Chatter
Pass title of the tab
</p>
</td>
</tr>

<tr
class="kwrow"
id="OutboundFundsNPSP.py.Generate New String"
Expand Down
29 changes: 27 additions & 2 deletions robot/OutboundFundsNPSP/resources/OutboundFundsNPSP.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@
import random
import string
import warnings
import time

from BaseObjects import BaseOutboundFundsNPSPPage
from robot.libraries.BuiltIn import RobotNotRunningError
from locators_52 import outboundfundsnpsp_lex_locators as locators_52
from locators_54 import outboundfundsnpsp_lex_locators as locators_54
from locators_51 import outboundfundsnpsp_lex_locators as locators_51
from cumulusci.robotframework.utils import selenium_retry, capture_screenshot_on_error

locators_by_api_version = {
51.0: locators_51, # Spring '21
52.0: locators_52, # Summer '21
54.0: locators_54,
}
# will get populated in _init_locators
outboundfundsnpsp_lex_locators = {}
Expand Down Expand Up @@ -240,6 +241,30 @@ def verify_row_count(self, value):
value, count
)

@capture_screenshot_on_error
def select_tab(self, title):
""" Switch between different tabs on a record page like Related, Details, News, Activity and Chatter
Pass title of the tab
"""
tab_found = False
locators = outboundfundsnpsp_lex_locators["tabs"].values()
for i in locators:
locator = i.format(title)
if self.check_if_element_exists(locator):
print(locator)
buttons = self.selenium.get_webelements(locator)
for button in buttons:
print(button)
if button.is_displayed():
print("button displayed is {}".format(button))
self.salesforce._focus(button)
button.click()
time.sleep(5)
tab_found = True
break

assert tab_found, "tab not found"

@capture_screenshot_on_error
def select_value_from_picklist(self, dropdown, value):
"""Select given value in the dropdown field"""
Expand Down
2 changes: 1 addition & 1 deletion robot/OutboundFundsNPSP/resources/locators_51.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
""" Locators for Spring '21 """

from locators_52 import outboundfundsnpsp_lex_locators
from locators_54 import outboundfundsnpsp_lex_locators
import copy

outboundfundsnpsp_lex_locators = copy.deepcopy(outboundfundsnpsp_lex_locators)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Summer '21 locators
# Spring '22 locators
outboundfundsnpsp_lex_locators = {
"app_launcher": {
"view_all_button": "//button[text()='View All']",
Expand All @@ -13,7 +13,7 @@
"edit_title": "//h2[contains(@class, 'title') and text()='{}']",
"list": "//div[contains(@class,'forcePageBlockSectionRow')]/div[contains(@class,'forcePageBlockItem')]/div[contains(@class,'slds-hint-parent')]/div[@class='slds-form-element__control']/div[.//span[text()='{}']][//div[contains(@class,'uiMenu')]//a[@class='select']]",
"text_field": "//div[contains(@class, 'uiInput')][.//label[contains(@class, 'uiLabel')][.//span[text()='{}']]]//*[self::input or self::textarea]",
"dropdown_field": "//lightning-combobox[./label[text()='{}']]/div//input[contains(@class,'combobox__input')]",
"dropdown_field": "//lightning-combobox[./label[text()='{}']]/div//button[contains(@class,'slds-combobox__input')]",
"dropdown_popup": "//div[contains(@class, 'slds-dropdown-trigger')]/div[contains(@class, 'slds-listbox')]",
"dropdown_value": "//div[contains(@class,'slds-listbox')]//lightning-base-combobox-item//span[text()='{}']",
"dd_selection": "//lightning-base-combobox-item[@data-value='{}']",
Expand All @@ -39,6 +39,10 @@
"verify_header": "//div[contains(@class, 'entityNameTitle')]",
"verify_details": "//div[contains(@class, 'slds-form-element')][.//span[text()='{}']]//following-sibling::div[.//span[contains(@class, 'test-id__field-value')]]/span",
},
"tabs": {
"tab": "//div[@class='uiTabBar']/ul[@class='tabs__nav']/li[contains(@class,'uiTabItem')]/a[@class='tabHeader']/span[contains(text(), '{}')]",
"spl-tab": "//div[@class='slds-tabs_default']//ul[@class='slds-tabs_default__nav']/li[contains(@class,'slds-tabs_default__item')]/a[text()= '{}']",
},
"related": {
"title": '//div[contains(@class, "slds-card")]/header[.//span[@title="{}"]]',
"button": "//div[contains(@class, 'forceRelatedListSingleContainer')][.//img][.//span[@title='{}']]//a[@title='{}']",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,6 @@ Add a Requirement on a Funding Request
Click Save
wait until modal is closed
Click Related List Link With Text ${req_name}
Select Tab Details
Validate Field Value Requirement Name contains ${req_name}
Validate Field Value Primary Contact contains ${contact}[Name]
4 changes: 2 additions & 2 deletions robot/OutboundFundsNPSP/tests/create_contact.robot
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,5 @@ Validate Contact
Page Should Contain ${first_name} ${last_name}
# Validate via API
&{contact} = Salesforce Get Contact ${contact_id}
Should Be Equal ${first_name} &{contact}[FirstName]
Should Be Equal ${last_name} &{contact}[LastName]
Should Be Equal ${first_name} ${contact['FirstName']}
Should Be Equal ${last_name} ${contact['LastName']}

0 comments on commit d3f0183

Please sign in to comment.