Skip to content

Commit

Permalink
Merge pull request #1642 from SalesforceFoundation/feature/robot_veri…
Browse files Browse the repository at this point in the history
…fy_account_model_heal_check_fail

[Robot] Verify Account Model health check failure status
  • Loading branch information
Sarah Pinkelman authored Mar 31, 2021
2 parents cb6c558 + 5a4bbeb commit d2943cc
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 3 deletions.
6 changes: 6 additions & 0 deletions robot/EDA/doc/Keywords.html
Original file line number Diff line number Diff line change
Expand Up @@ -2430,6 +2430,12 @@ <h2 title='robot/EDA/resources/SystemSettingsPageObject.py'>SystemSettingsPageOb
Update System Dropdown Value
</td>
<td class="kwargs">

<tr class="kwrow" id="AccountsAndContactsSettingsPageObject.py.Update Accountcontact Dropdown Value">
<td class="kwname">
Update Accountcontact Dropdown Value
</td>
<td class="kwargs">

<i>**kwargs</i>

Expand Down
13 changes: 12 additions & 1 deletion robot/EDA/resources/AccountsAndContactsSettingsPageObject.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def clear_the_disable_preferred_phone_enforcement(self):
"Saving changes.\n" +
"Proper configuration is in place for testing 'Disable Preferred Phone enforcement'."
)

def disable_enhanced_checkbox(self):
""" Verify that Enable Enhanced Preferred Phone Functionality checkbox is not checked
Clear the checkbox if it is set
Expand Down Expand Up @@ -264,6 +264,16 @@ def set_multi_account_contact_checkbox(self,**kwargs):
else:
continue

def update_account_contact_record_type(self,**kwargs):
""" This method will update the drop down field present under 'Accounts and Contacts' with a value passed in keyword arguments
Pass the expected value to be set in the drop down field from the tests
"""
for field,value in kwargs.items():
locator = eda_lex_locators["eda_settings_accounts_contacts"]["dropdown_acc"].format(field,value)
self.selenium.wait_until_page_contains_element(locator,
error=f"'{value}' as dropdown value in '{field}' field is not available ")
self.selenium.click_element(locator)

def verify_multi_account_contact_checkbox(self,**kwargs):
""" This method will verify the value of checkboxes present under 'Account Types with Multi
Addresses Enabled' and 'Account Types without Contacts to Delete' based on the key
Expand All @@ -280,3 +290,4 @@ def verify_multi_account_contact_checkbox(self,**kwargs):
if not str(value).lower() == str(actual_value).lower() :
raise Exception (f"Checkbox value in {field} is {actual_value} but it should be {value}")


15 changes: 15 additions & 0 deletions robot/EDA/resources/SettingsHealthCheckPageObject.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,20 @@ def return_all_checks_status(self,healthCheckCard,expected_value):
actual_value = self.selenium.get_webelement(locator).text
return True if str(actual_value).lower() == str(expected_value).lower() else False

def verify_recommended_fix(self,healthCheckCard,**kwargs):
""" This method validates the status of a setting for the setting passed in kwargs
Pass the health check card, setting name and the expected status to be verified from the
tests using keyword arguments
"""
for field,expected_value in kwargs.items():
locator = eda_lex_locators["settings_health_check"]["recommended_fix_value"].format(healthCheckCard,field,expected_value)
self.selenium.wait_until_page_contains_element(locator, timeout=60, error=f'{locator} is not available')
self.selenium.wait_until_element_is_visible(locator,
error= "Element is not displayed for the user")
actual_value = self.selenium.get_webelement(locator).text
self.builtin.log(f"Actual value of {field} is {actual_value}")
if not str(expected_value).lower() in str(actual_value).lower() :
raise Exception (f"Status of {field} is {actual_value} but it should be {expected_value}")



2 changes: 2 additions & 0 deletions robot/EDA/resources/locators_51.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@
"checkbox_value": "//span[text()='{}']/following::label[1][contains(@class, 'checkbox')]/span[contains(@class, 'checkbox')]",
"checkbox_list": "//span[text()='{}']/../../following-sibling::div[1]/descendant::span[contains(@class, 'checkbox')]",
"checkbox_list_read": "//span[text()='{}']/../../following-sibling::div[1]/descendant::img",
"dropdown_acc": "//span[text()='{}']/../following-sibling::div[1]/select/option[text()='{}']",
},
"eda_settings_relationships": {
"dropdown_read": "//span[text()='{}']/../following-sibling::div[1]/descendant::span",
Expand Down Expand Up @@ -223,6 +224,7 @@
"expand_button": "//button[@title='Expand these results' and contains(@aria-controls, '{}')]",
"all_checks_status": "//div[text()='{}']/following-sibling::div/div[contains(@class, 'text')]",
"status_value": "//div[contains(@id, '{}')]/descendant::td/descendant::lightning-base-formatted-text[text()='{}']/ancestor::td/preceding-sibling::th[@data-label='Status']/descendant::lightning-base-formatted-text",
"recommended_fix_value": "//div[contains(@id, '{}')]/descendant::td/descendant::lightning-base-formatted-text[text()='{}']/ancestor::tr/descendant::td[@data-label='Recommended Fix']/descendant::lightning-base-formatted-text[contains(text(), '{}')]",
},
"term": {
"new_term_button": "//span[@class='itemLabel slds-truncate slds-show--inline-block slds-m-left--xx-small' and contains(text(), 'New Term')]//..",
Expand Down
25 changes: 23 additions & 2 deletions robot/EDA/tests/browser/health_check/account_model_check.robot
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ Documentation Validates account model health check card
Resource robot/EDA/resources/EDA.robot
Library cumulusci.robotframework.PageObjects
... robot/EDA/resources/SettingsHealthCheckPageObject.py
... robot/EDA/resources/AccountsAndContactsSettingsPageObject.py
... robot/EDA/resources/SystemSettingsPageObject.py

Suite Setup Open Test Browser
Suite Teardown Capture screenshot and delete records and close browser
Expand All @@ -11,12 +13,31 @@ Suite Teardown Capture screenshot and delete records and close browser
Verify account model health check settings checks pass
[Documentation] Validates the account model health card is displayed with settings for
... Administrative, Household, Default Account Model and Unique account
... record type checks.Also verifies the status of each setting.
... record type checks. Also verifies the status of each setting.
[tags] unstable rbt:high W-8880346
Go to settings health check
Current page should be Home Settings Health Check
Run health check settings Account Model AccountModel AccountModelResults
... Administrative Account Record Type=Passed
... Default Account Model=Passed
... Household Account Record Type=Passed
... Unique Administrative and Household Account Record Type Settings.=Passed
... Unique Administrative and Household Account Record Type Settings.=Passed

Verify account model health check settings checks fail and display correct Recommended Fix text
[Documentation] Verifies the failure status of the Account Model test
[tags] unstable rbt:high W-8977007
Go to EDA settings tab Accounts and Contacts
Click action button on EDA settings page Edit
Update account contact record type
... Administrative Account Record Type=Household Account
Click action button on EDA settings page Save
Reload Page
Go to settings health check
Current page should be Home Settings Health Check
Run health check settings Account Model AccountModel AccountModelResults
... Administrative Account Record Type=Passed
... Default Account Model=Passed
... Household Account Record Type=Passed
... Unique Administrative and Household Account Record Type Settings.=Failed
Verify recommended fix AccountModelResults
... Unique Administrative and Household Account Record Type Settings.=unique

0 comments on commit d2943cc

Please sign in to comment.