From 8e8002e1c7bdd051e1a7675355eea9e3e294e4f3 Mon Sep 17 00:00:00 2001 From: Rakesh Jeyaraman Date: Wed, 17 Mar 2021 12:24:27 -0400 Subject: [PATCH 1/2] verify course connections health check --- robot/EDA/resources/EDA.py | 7 +++ .../SettingsHealthCheckPageObject.py | 2 +- robot/EDA/resources/locators_51.py | 2 +- .../health_check/account_model_check.robot | 31 ++++++++++++ .../affiliation_mappings_check.robot | 33 +++++++++++++ .../course_connections_check.robot | 31 ++++++++++++ .../health_check/eda_health_check.robot | 47 +------------------ 7 files changed, 105 insertions(+), 48 deletions(-) create mode 100644 robot/EDA/tests/browser/health_check/account_model_check.robot create mode 100644 robot/EDA/tests/browser/health_check/affiliation_mappings_check.robot create mode 100644 robot/EDA/tests/browser/health_check/course_connections_check.robot diff --git a/robot/EDA/resources/EDA.py b/robot/EDA/resources/EDA.py index 4a06415bff..63a6199325 100644 --- a/robot/EDA/resources/EDA.py +++ b/robot/EDA/resources/EDA.py @@ -400,6 +400,13 @@ def go_to_custom_settings_setup(self): self.selenium.go_to(url) self.salesforce.wait_until_loading_is_complete() + def go_to_settings_health_check(self): + """ Navigates to the Home view of Settings Health Check app""" + url = self.cumulusci.org.lightning_base_url + url = "{}/lightning/n/Settings_Health_Check".format(url) + self.selenium.go_to(url) + self.salesforce.wait_until_loading_is_complete() + def click_edit_on_eda_settings_page(self): locator = eda_lex_locators["eda_settings"]["edit"] self.selenium.wait_until_page_contains_element(locator, error="Edit button is not available on the page") diff --git a/robot/EDA/resources/SettingsHealthCheckPageObject.py b/robot/EDA/resources/SettingsHealthCheckPageObject.py index 3f868e1c68..98caf585c9 100644 --- a/robot/EDA/resources/SettingsHealthCheckPageObject.py +++ b/robot/EDA/resources/SettingsHealthCheckPageObject.py @@ -74,7 +74,7 @@ def return_all_checks_status(self,healthCheckCard,expected_value): the expected text from robot. Returns true if all settings are passed and false if any one of the setting is failed """ - locator = eda_lex_locators["settings_health_check"]["all_checks_status"].format(healthCheckCard,expected_value) + locator = eda_lex_locators["settings_health_check"]["all_checks_status"].format(healthCheckCard) 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") diff --git a/robot/EDA/resources/locators_51.py b/robot/EDA/resources/locators_51.py index 811aa80f1f..513f09aea1 100644 --- a/robot/EDA/resources/locators_51.py +++ b/robot/EDA/resources/locators_51.py @@ -221,7 +221,7 @@ "health_check_header": "//h2[contains(@class, 'header')]/span[text()='{}']", "last_run_date": "//button[@title='Run Health Check']/preceding::div[1]", "expand_button": "//button[@title='Expand these results' and contains(@aria-controls, '{}')]", - "all_checks_status": "//div[text()='{}']/../descendant::div[text()='{}']", + "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", }, "term": { diff --git a/robot/EDA/tests/browser/health_check/account_model_check.robot b/robot/EDA/tests/browser/health_check/account_model_check.robot new file mode 100644 index 0000000000..b5db547165 --- /dev/null +++ b/robot/EDA/tests/browser/health_check/account_model_check.robot @@ -0,0 +1,31 @@ +*** Settings *** +Documentation Validates account model health check card +Resource robot/EDA/resources/EDA.robot +Library cumulusci.robotframework.PageObjects +... robot/EDA/resources/SettingsHealthCheckPageObject.py + +Suite Setup Open Test Browser +Suite Teardown Capture screenshot and delete records and close browser + +*** Test Cases *** +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. + [tags] unstable rbt:high W-8880346 + Go to settings health check + Current page should be Home Settings Health Check + Run account model health check settings + +*** Keywords *** +Run account model health check settings + [Documentation] Validates the account model health check settings row by row + Click health check button Run Health Check + ${all_checks_status} = Return all checks status Account Model All checks passed + Log To Console ${all_checks_status} + Run Keyword If '${all_checks_status}' == 'True' Click expand button AccountModel + Verify status of a setting AccountModelResults + ... Administrative Account Record Type=Passed + ... Default Account Model=Passed + ... Household Account Record Type=Passed + ... Unique Administrative and Household Account Record Type Settings.=Passed diff --git a/robot/EDA/tests/browser/health_check/affiliation_mappings_check.robot b/robot/EDA/tests/browser/health_check/affiliation_mappings_check.robot new file mode 100644 index 0000000000..dadc29a900 --- /dev/null +++ b/robot/EDA/tests/browser/health_check/affiliation_mappings_check.robot @@ -0,0 +1,33 @@ +*** Settings *** +Documentation Validates affiliation mappings health check card +Resource robot/EDA/resources/EDA.robot +Library cumulusci.robotframework.PageObjects +... robot/EDA/resources/SettingsHealthCheckPageObject.py + +Suite Setup Open Test Browser +Suite Teardown Capture screenshot and delete records and close browser + +*** Test Cases *** +Verify affiliation mappings health check settings checks pass + [Documentation] Validates the affiliation mappings health card is displayed with + ... settings for default account record types. Also verifies the status of + ... each setting. + [tags] unstable rbt:high W-8925750 + Go to settings health check + Current page should be Home Settings Health Check + Run affiliation mapping health check settings + +*** Keywords *** +Run affiliation mapping health check settings + [Documentation] Validates the affiliation mapping health check settings row by row + Click health check button Run Health Check + ${all_checks_status} = Return all checks status Affiliation Mappings All checks passed + Log To Console ${all_checks_status} + Run Keyword If '${all_checks_status}' == 'True' Click expand button AffiliationMappings + Verify status of a setting AffiliationMappingsResults + ... Academic_Program Affiliation Mapping=Passed + ... Business_Organization Affiliation Mapping=Passed + ... Educational_Institution Affiliation Mapping=Passed + ... HH_Account Affiliation Mapping=Passed + ... Sports_Organization Affiliation Mapping=Passed + ... University_Department Affiliation Mapping=Passed diff --git a/robot/EDA/tests/browser/health_check/course_connections_check.robot b/robot/EDA/tests/browser/health_check/course_connections_check.robot new file mode 100644 index 0000000000..b06bcfa3b2 --- /dev/null +++ b/robot/EDA/tests/browser/health_check/course_connections_check.robot @@ -0,0 +1,31 @@ +*** Settings *** +Documentation Validates course connections health check card +Resource robot/EDA/resources/EDA.robot +Library cumulusci.robotframework.PageObjects +... robot/EDA/resources/SettingsHealthCheckPageObject.py +... robot/EDA/resources/CourseConnectionsSettingsPageObject.py + +Suite Setup Open Test Browser +Suite Teardown Capture screenshot and delete records and close browser + +*** Test Cases *** +Verify course connections health check when course connections is disabled + [Documentation] Validates course connections health check card displays a warning + ... message with a single setting when course connections in EDA Settings + ... is disabled + [tags] unstable rbt:high W-8976999 + Go to EDA settings tab Course Connections + Update enable cc to default + Go to settings health check + Current page should be Home Settings Health Check + Run course connections health check settings to check warning message + +*** Keywords *** +Run course connections health check settings to check warning message + [Documentation] Validates the course connections health check settings row by row + Click health check button Run Health Check + ${all_checks_status} = Return all checks status Course Connections All checks passed + Log To Console ${all_checks_status} + Run Keyword If '${all_checks_status}' == 'True' Click expand button courseconnection + Verify status of a setting courseconnectionsettingsResults + ... Enable Course Connections=Warning diff --git a/robot/EDA/tests/browser/health_check/eda_health_check.robot b/robot/EDA/tests/browser/health_check/eda_health_check.robot index 2726437d71..0e5484d312 100644 --- a/robot/EDA/tests/browser/health_check/eda_health_check.robot +++ b/robot/EDA/tests/browser/health_check/eda_health_check.robot @@ -29,49 +29,4 @@ Verify last run date is updated upon clicking run health check Button ... Go to custom settings setup AND ... Select App Launcher Tab Settings Health Check AND ... Verify last run date - ... ELSE Fail - -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. - [tags] unstable rbt:high W-8880346 - Log To Console ${PREV TEST STATUS} - Run Keyword If '${PREV TEST STATUS}' == 'PASS' Run account model health check settings - ... ELSE Fail - -Verify affiliation mappings health check settings checks pass - [Documentation] Validates the affiliation mappings health card is displayed with - ... settings for default account record types. Also verifies the status of - ... each setting. - [tags] unstable rbt:high W-8925750 - Log To Console ${PREV TEST STATUS} - Run Keyword If '${PREV TEST STATUS}' == 'PASS' Run affiliation mapping health check settings - ... ELSE Fail - - -*** Keywords *** -Run account model health check settings - [Documentation] Validates the account model health check settings row by row - Click health check button Run Health Check - ${all_checks_status} = Return all checks status Account Model All checks passed - Log To Console ${all_checks_status} - Run Keyword If '${all_checks_status}' == 'True' Click expand button AccountModel - Verify status of a setting AccountModelResults - ... Administrative Account Record Type=Passed - ... Default Account Model=Passed - ... Household Account Record Type=Passed - ... Unique Administrative and Household Account Record Type Settings.=Passed - -Run affiliation mapping health check settings - [Documentation] Validates the affiliation mapping health check settings row by row - ${all_checks_status} = Return all checks status Affiliation Mappings All checks passed - Log To Console ${all_checks_status} - Run Keyword If '${all_checks_status}' == 'True' Click expand button AffiliationMappings - Verify status of a setting AffiliationMappingsResults - ... Academic_Program Affiliation Mapping=Passed - ... Business_Organization Affiliation Mapping=Passed - ... Educational_Institution Affiliation Mapping=Passed - ... HH_Account Affiliation Mapping=Passed - ... Sports_Organization Affiliation Mapping=Passed - ... University_Department Affiliation Mapping=Passed \ No newline at end of file + ... ELSE Fail \ No newline at end of file From dc1f8c4d28db4e7a47d4ed55234c39a8f6efd025 Mon Sep 17 00:00:00 2001 From: Rakesh Jeyaraman Date: Fri, 19 Mar 2021 13:28:41 -0400 Subject: [PATCH 2/2] parameterized run health check settings keyword --- robot/EDA/resources/EDA.robot | 10 +++++++++- .../health_check/account_model_check.robot | 15 +++------------ .../health_check/affiliation_mappings_check.robot | 11 +---------- .../health_check/course_connections_check.robot | 13 ++----------- 4 files changed, 15 insertions(+), 34 deletions(-) diff --git a/robot/EDA/resources/EDA.robot b/robot/EDA/resources/EDA.robot index a5b82986d0..e6e3be02d7 100644 --- a/robot/EDA/resources/EDA.robot +++ b/robot/EDA/resources/EDA.robot @@ -106,4 +106,12 @@ Get Records Count ${result} = SOQL Query ... SELECT COUNT(Name) FROM ${NS}${obj_name} where ${NS}${field_name}=${field_value} &{Id} = Get From List ${result['records']} 0 - [return] ${Id}[expr0] \ No newline at end of file + [return] ${Id}[expr0] + +Run health check settings + [Documentation] Validates the health check settings row by row + [Arguments] ${HealthCheckCard} ${Button} ${Results} &{fields} + Click health check button Run Health Check + ${all_checks_status} = Return all checks status ${HealthCheckCard} All checks passed + Run Keyword If '${all_checks_status}' == 'True' Click expand button ${Button} + Verify status of a setting ${Results} &{fields} \ No newline at end of file diff --git a/robot/EDA/tests/browser/health_check/account_model_check.robot b/robot/EDA/tests/browser/health_check/account_model_check.robot index b5db547165..3dc118994e 100644 --- a/robot/EDA/tests/browser/health_check/account_model_check.robot +++ b/robot/EDA/tests/browser/health_check/account_model_check.robot @@ -14,18 +14,9 @@ Verify account model health check settings checks pass ... 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 account model health check settings - -*** Keywords *** -Run account model health check settings - [Documentation] Validates the account model health check settings row by row - Click health check button Run Health Check - ${all_checks_status} = Return all checks status Account Model All checks passed - Log To Console ${all_checks_status} - Run Keyword If '${all_checks_status}' == 'True' Click expand button AccountModel - Verify status of a setting AccountModelResults + 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 \ No newline at end of file diff --git a/robot/EDA/tests/browser/health_check/affiliation_mappings_check.robot b/robot/EDA/tests/browser/health_check/affiliation_mappings_check.robot index dadc29a900..76de61fad3 100644 --- a/robot/EDA/tests/browser/health_check/affiliation_mappings_check.robot +++ b/robot/EDA/tests/browser/health_check/affiliation_mappings_check.robot @@ -15,16 +15,7 @@ Verify affiliation mappings health check settings checks pass [tags] unstable rbt:high W-8925750 Go to settings health check Current page should be Home Settings Health Check - Run affiliation mapping health check settings - -*** Keywords *** -Run affiliation mapping health check settings - [Documentation] Validates the affiliation mapping health check settings row by row - Click health check button Run Health Check - ${all_checks_status} = Return all checks status Affiliation Mappings All checks passed - Log To Console ${all_checks_status} - Run Keyword If '${all_checks_status}' == 'True' Click expand button AffiliationMappings - Verify status of a setting AffiliationMappingsResults + Run health check settings Affiliation Mappings AffiliationMappings AffiliationMappingsResults ... Academic_Program Affiliation Mapping=Passed ... Business_Organization Affiliation Mapping=Passed ... Educational_Institution Affiliation Mapping=Passed diff --git a/robot/EDA/tests/browser/health_check/course_connections_check.robot b/robot/EDA/tests/browser/health_check/course_connections_check.robot index b06bcfa3b2..f294dbe12b 100644 --- a/robot/EDA/tests/browser/health_check/course_connections_check.robot +++ b/robot/EDA/tests/browser/health_check/course_connections_check.robot @@ -18,14 +18,5 @@ Verify course connections health check when course connections is disabled Update enable cc to default Go to settings health check Current page should be Home Settings Health Check - Run course connections health check settings to check warning message - -*** Keywords *** -Run course connections health check settings to check warning message - [Documentation] Validates the course connections health check settings row by row - Click health check button Run Health Check - ${all_checks_status} = Return all checks status Course Connections All checks passed - Log To Console ${all_checks_status} - Run Keyword If '${all_checks_status}' == 'True' Click expand button courseconnection - Verify status of a setting courseconnectionsettingsResults - ... Enable Course Connections=Warning + Run health check settings Course Connections courseconnection courseconnectionsettingsResults + ... Enable Course Connections=Warning