From a7e4bc9a6ce0d2c3239875cd30c42d8f1a566bdd Mon Sep 17 00:00:00 2001 From: gaganpsandhu Date: Wed, 10 Mar 2021 15:33:09 -0800 Subject: [PATCH 1/6] Ribir=t - Add Requirement Test and add namespace --- .../resources/FundingProgramPageObject.py | 8 +- .../resources/FundingRequestPageObject.py | 8 +- .../resources/OutboundFundsNPSP.py | 39 +++- .../resources/OutboundfundsNPSP.robot | 181 ++++++++++++++---- .../resources/locators_51.py | 2 +- .../FundingProgram/FundingProgram.robot | 10 +- .../FundingRequest/FundingRequest.robot | 12 +- .../GAUExpenditure/GAUExpenditure.robot | 10 +- .../browser/Requirements/Requirements.robot | 46 +++++ 9 files changed, 252 insertions(+), 64 deletions(-) create mode 100644 robot/OutboundFundsNPSP/tests/browser/Requirements/Requirements.robot diff --git a/robot/OutboundFundsNPSP/resources/FundingProgramPageObject.py b/robot/OutboundFundsNPSP/resources/FundingProgramPageObject.py index d4f8d7f..a9601de 100644 --- a/robot/OutboundFundsNPSP/resources/FundingProgramPageObject.py +++ b/robot/OutboundFundsNPSP/resources/FundingProgramPageObject.py @@ -5,9 +5,8 @@ from cumulusci.robotframework.utils import capture_screenshot_on_error -@pageobject("Listing", "outfunds__Funding_Program__c") +@pageobject("Listing", "Funding_Program__c") class FundingProgramListingPage(BaseOutboundFundsNPSPPage, ListingPage): - object_name = "outfunds__Funding_Program__c" @capture_screenshot_on_error def _is_current_page(self): @@ -15,14 +14,13 @@ def _is_current_page(self): by verifying that the url contains '/view' """ self.selenium.location_should_contain( - "/lightning/o/outfunds__Funding_Program__c/list?", + "/list?", message="Current page is not a Funding Program List view", ) -@pageobject("Details", "outfunds__Funding_Program__c") +@pageobject("Details", "Funding_Program__c") class FundingProgramDetailPage(BaseOutboundFundsNPSPPage, DetailPage): - object_name = "outfunds__Funding_Program__c" @capture_screenshot_on_error def _is_current_page(self): diff --git a/robot/OutboundFundsNPSP/resources/FundingRequestPageObject.py b/robot/OutboundFundsNPSP/resources/FundingRequestPageObject.py index 3909a0d..f8a2178 100644 --- a/robot/OutboundFundsNPSP/resources/FundingRequestPageObject.py +++ b/robot/OutboundFundsNPSP/resources/FundingRequestPageObject.py @@ -5,9 +5,8 @@ from cumulusci.robotframework.utils import capture_screenshot_on_error -@pageobject("Listing", "outfunds__Funding_Request__c") +@pageobject("Listing", "Funding_Request__c") class FundingRequestListingPage(BaseOutboundFundsNPSPPage, ListingPage): - object_name = "outfunds__Funding_Request__c" @capture_screenshot_on_error def _is_current_page(self): @@ -15,14 +14,13 @@ def _is_current_page(self): by verifying that the url contains '/view' """ self.selenium.location_should_contain( - "/lightning/o/outfunds__Funding_Request__c/list?", + "/list?", message="Current page is not a Funding Request List view", ) -@pageobject("Details", "outfunds__Funding_Request__c") +@pageobject("Details", "Funding_Request__c") class FundingRequestDetailPage(BaseOutboundFundsNPSPPage, DetailPage): - object_name = "outfunds__Funding_Request__c" @capture_screenshot_on_error def _is_current_page(self): diff --git a/robot/OutboundFundsNPSP/resources/OutboundFundsNPSP.py b/robot/OutboundFundsNPSP/resources/OutboundFundsNPSP.py index fbdd380..c52167c 100644 --- a/robot/OutboundFundsNPSP/resources/OutboundFundsNPSP.py +++ b/robot/OutboundFundsNPSP/resources/OutboundFundsNPSP.py @@ -53,6 +53,33 @@ def _init_locators(self): locators = locators_by_api_version[self.latest_api_version] outboundfundsnpsp_lex_locators.update(locators) + def get_namespace_prefix(self, name): + parts = name.split("__") + if parts[-1] == "c": + parts = parts[:-1] + if len(parts) > 1: + return parts[0] + "__" + else: + return "" + + def get_outfundsnpsp_namespace_prefix(self): + if not hasattr(self.cumulusci, "_describe_result"): + self.cumulusci._describe_result = self.cumulusci.sf.describe() + objects = self.cumulusci._describe_result["sobjects"] + fundingprogram_object = [o for o in objects if o["label"] == "Funding Program"][ + 0 + ] + return self.get_namespace_prefix(fundingprogram_object["name"]) + + def get_npsp_namespace_prefix(self): + if not hasattr(self.cumulusci, "_describe_result"): + self.cumulusci._describe_result = self.cumulusci.sf.describe() + objects = self.cumulusci._describe_result["sobjects"] + gau_object = [o for o in objects if o["label"] == "General Accounting Unit"][ + 0 + ] + return self.get_namespace_prefix(gau_object["name"]) + def _check_if_element_exists(self, xpath): """Checks if the given xpath exists this is only a helper function being called from other keywords @@ -156,7 +183,17 @@ def click_tab(self, label): def click_related_list_link_with_text(self, text): """Click on link with passed text in a related list table""" - locator = outboundfundsnpsp_lex_locators["related"]["related_link"].format(text) + locator = outboundfundsnpsp_lex_locators["related"]["flexi_link"].format(text) self.selenium.wait_until_page_contains_element(locator) element = self.selenium.driver.find_element_by_xpath(locator) self.selenium.driver.execute_script("arguments[0].click()", element) + + def click_related_list_wrapper_button(self, heading, button_title): + """ loads the related list and clicks on the button on the list """ + locator = outboundfundsnpsp_lex_locators["related"]["flexi_button"].format( + heading, button_title + ) + self.salesforce._jsclick(locator) + self.salesforce.wait_until_loading_is_complete() + + diff --git a/robot/OutboundFundsNPSP/resources/OutboundfundsNPSP.robot b/robot/OutboundFundsNPSP/resources/OutboundfundsNPSP.robot index 0c5e4f9..df55efa 100644 --- a/robot/OutboundFundsNPSP/resources/OutboundfundsNPSP.robot +++ b/robot/OutboundFundsNPSP/resources/OutboundfundsNPSP.robot @@ -49,93 +49,194 @@ API Create Contact for User API Create Funding Program [Documentation] Create a Funding Program via API [Arguments] &{fields} + ${ns} = Get Outfundsnpsp Namespace Prefix ${funding_program_name} = Generate New String ${start_date} = Get Current Date result_format=%Y-%m-%d ${end_date} = Get Current Date result_format=%Y-%m-%d increment=90 days - ${funding_program_id} = Salesforce Insert outfunds__Funding_Program__c + ${funding_program_id} = Salesforce Insert ${ns}Funding_Program__c ... Name=${funding_program_name} - ... outfunds__Start_Date__c=${start_date} - ... outfunds__End_Date__c=${end_date} - ... outfunds__Status__c=In Progress - ... outfunds__Total_Program_Amount__c=100000 - ... outfunds__Description__c=Robot API Program + ... ${ns}Start_Date__c=${start_date} + ... ${ns}End_Date__c=${end_date} + ... ${ns}Status__c=In Progress + ... ${ns}Total_Program_Amount__c=100000 + ... ${ns}Description__c=Robot API Program ... &{fields} - &{fundingprogram} = Salesforce Get outfunds__Funding_Program__c ${funding_program_id} + &{fundingprogram} = Salesforce Get ${ns}Funding_Program__c ${funding_program_id} [Return] &{fundingprogram} API Create Funding Request [Documentation] Create a Funding Request via API [Arguments] ${funding_program_id} ${contact_id} &{fields} + ${ns} = Get Outfundsnpsp Namespace Prefix ${funding_request_name} = Generate New String ${application_date} = Get Current Date result_format=%Y-%m-%d - ${funding_request_id} = Salesforce Insert outfunds__Funding_Request__c + ${funding_request_id} = Salesforce Insert ${ns}Funding_Request__c ... Name=${funding_request_name} - ... outfunds__Applying_Contact__c=${contact_id} - ... outfunds__Status__c=In Progress - ... outfunds__Requested_Amount__c=100000 - ... outfunds__FundingProgram__c=${funding_program_id} - ... outfunds__Requested_For__c=Education + ... ${ns}Applying_Contact__c=${contact_id} + ... ${ns}Status__c=In Progress + ... ${ns}Requested_Amount__c=100000 + ... ${ns}FundingProgram__c=${funding_program_id} + ... ${ns}Requested_For__c=Education ... &{fields} - &{funding_request} = Salesforce Get outfunds__Funding_Request__c ${funding_request_id} - Store Session Record outfunds__Funding_Request__c ${funding_request_id} + &{funding_request} = Salesforce Get ${ns}Funding_Request__c ${funding_request_id} + Store Session Record ${ns}Funding_Request__c ${funding_request_id} [Return] &{funding_request} API Create Requirement on a Funding Request [Documentation] Create a Requirement on a Funding Request via API [Arguments] ${funding_request_id} ${contact_id} ${user_id} &{fields} + ${ns} = Get Outfundsnpsp Namespace Prefix ${requirement_name} = Generate New String ${due_date} = Get Current Date result_format=%Y-%m-%d increment=30 days ${requirement_id} = Salesforce Insert outfunds__Requirement__c ... Name=${requirement_name} - ... outfunds__Primary_Contact__c=${contact_id} - ... outfunds__Due_Date__c=${due_date} - ... outfunds__Assigned__c=${user_id} - ... outfunds__Status__c=Open - ... outfunds__Funding_Request__c=${funding_request_id} - ... outfunds__Type__c=Review + ... ${ns}Primary_Contact__c=${contact_id} + ... ${ns}Due_Date__c=${due_date} + ... ${ns}Assigned__c=${user_id} + ... ${ns}Status__c=Open + ... ${ns}Funding_Request__c=${funding_request_id} + ... ${ns}Type__c=Review ... &{fields} - &{requirement} = Salesforce Get outfunds__Requirement__c ${requirement_id} - Store Session Record outfunds__Requirement__c ${requirement_id} + &{requirement} = Salesforce Get ${ns}Requirement__c ${requirement_id} + Store Session Record ${ns}Requirement__c ${requirement_id} [Return] &{requirement} API Create Disbursement on a Funding Request [Documentation] Create a Disbursement on a Funding Request via API [Arguments] ${funding_request_id} &{fields} + ${ns} = Get Outfundsnpsp Namespace Prefix ${scheduled_date} = Get Current Date result_format=%Y-%m-%d increment=5 days ${disbursement_date} = Get Current Date result_format=%Y-%m-%d increment=10 days - ${disbursement_id} = Salesforce Insert outfunds__Disbursement__c - ... outfunds__Funding_Request__c=${funding_request_id} - ... outfunds__Amount__c=5000 - ... outfunds__Status__c=Scheduled - ... outfunds__Scheduled_Date__c=${scheduled_date} - ... outfunds__Type__c=Initial - ... outfunds__Disbursement_Date__c=${disbursement_date} - ... outfunds__Disbursement_Method__c=Check + ${disbursement_id} = Salesforce Insert ${ns}Disbursement__c + ... ${ns}Funding_Request__c=${funding_request_id} + ... ${ns}Amount__c=5000 + ... ${ns}Status__c=Scheduled + ... ${ns}Scheduled_Date__c=${scheduled_date} + ... ${ns}Type__c=Initial + ... ${ns}Disbursement_Date__c=${disbursement_date} + ... ${ns}Disbursement_Method__c=Check ... &{fields} - &{disbursement} = Salesforce Get outfunds__Disbursement__c ${disbursement_id} - Store Session Record outfunds__disbursement__c ${disbursement_id} + &{disbursement} = Salesforce Get ${ns}Disbursement__c ${disbursement_id} + Store Session Record ${ns}disbursement__c ${disbursement_id} [Return] &{disbursement} API Create GAU [Documentation] Create a GAU [Arguments] &{fields} + ${ns_npsp} = Get NPSP Namespace Prefix ${name} = Generate New String - ${gau_id} = Salesforce Insert npsp__General_Accounting_Unit__c - ... npsp__Active__c=true - ... npsp__Total_Allocations__c=50000 - ... npsp__Description__c=Robot Test + ${gau_id} = Salesforce Insert ${ns_npsp}General_Accounting_Unit__c + ... ${ns_npsp}Active__c=true + ... ${ns_npsp}Total_Allocations__c=50000 + ... ${ns_npsp}Description__c=Robot Test ... Name=${name} - &{gau} = Salesforce Get npsp__General_Accounting_Unit__c ${gau_id} - Store Session Record npsp__General_Accounting_Unit__c ${gau_id} + &{gau} = Salesforce Get ${ns_npsp}General_Accounting_Unit__c ${gau_id} + Store Session Record ${ns_npsp}General_Accounting_Unit__c ${gau_id} [Return] &{gau} API Create GAU Expenditure [Documentation] Create a GAU Expenditure on Disbursement [Arguments] ${gau_id} ${disbursement_id} &{fields} - ${gauexpenditure_id} = Salesforce Insert GAU_Expenditure__c + ${ns} = Get Outfundsnpsp Namespace Prefix + ${ns_npsp} = Get NPSP Namespace Prefix + ${gauexpenditure_id} = Salesforce Insert GAU_Expenditure__c ... Amount__c=10000 ... General_Accounting_Unit__c=${gau_id} ... Disbursement__c=${disbursement_id} &{gauexp} = Salesforce Get GAU_Expenditure__c ${gauexpenditure_id} Store Session Record GAU_Expenditure__c ${gauexpenditure_id} [Return] &{gauexp} + +Change Object Permissions + [Documentation] Adds or removes the Create, Read, Edit and Delete permissions for the specified object on the specified permission set.. + [Arguments] ${action} ${objectapiname} ${permset} + + + ${removeobjperms} = Catenate SEPARATOR=\n + ... ObjectPermissions objperm; + ... objperm = [SELECT Id, PermissionsRead, PermissionsEdit, PermissionsCreate, PermissionsDelete FROM ObjectPermissions + ... WHERE parentId IN ( SELECT id FROM permissionset WHERE PermissionSet.Name = '${permset}') + ... AND SobjectType='${objectapiname}']; + ... objperm.PermissionsRead = false; + ... objperm.PermissionsEdit = false; + ... objperm.PermissionsCreate = false; + ... objperm.PermissionsDelete = false; + ... update objperm; + + ${addobjperms} = Catenate SEPARATOR=\n + ... String permid = [SELECT id FROM permissionset WHERE PermissionSet.Name = '${permset}'].id; + ... ObjectPermissions objperm = New ObjectPermissions(PermissionsRead = true, PermissionsEdit = true, PermissionsCreate = true, + ... PermissionsDelete = true, ParentId = permid, SobjectType='${objectapiname}'); + ... insert objperm; + + Run Keyword if "${action}" == "remove" + ... Run Task execute_anon + ... apex= ${removeobjperms} + + Run Keyword if "${action}" == "add" + ... Run Task execute_anon + ... apex= ${addobjperms} + +Change Field Permissions + [Documentation] Adds or removes the Create, Read, Edit and Delete permissions for the specified object field on the specified permission set. + [Arguments] ${action} ${objectapiname} ${fieldapiname} ${permset} + + ${removefieldperms} = Catenate SEPARATOR=\n + ... FieldPermissions fldperm; + ... fldperm = [SELECT Id, Field, PermissionsRead, PermissionsEdit FROM FieldPermissions + ... WHERE parentId IN ( SELECT id FROM permissionset WHERE PermissionSet.Name = '${permset}') + ... AND SobjectType='${objectapiname}' + ... AND Field='${objectapiname}.${fieldapiname}']; + ... fldperm.PermissionsRead = false; + ... fldperm.PermissionsEdit = false; + ... update fldperm; + + ${addfieldperms} = Catenate SEPARATOR=\n + ... String permid = [SELECT id FROM permissionset WHERE PermissionSet.Name = '${permset}'].id; + ... FieldPermissions fldperm = New FieldPermissions(PermissionsRead = true, PermissionsEdit = true, + ... ParentId = permid, Field = '${objectapiname}.${fieldapiname}', SobjectType='${objectapiname}'); + ... insert fldperm; + + Run Keyword if "${action}" == "remove" + ... Run Task execute_anon + ... apex= ${removefieldperms} + + Run Keyword if "${action}" == "add" + ... Run Task execute_anon + ... apex= ${addfieldperms} + +Object Permissions Cleanup + [Documentation] Resets all object permissions in case a test fails before they are restored. Skips the reset if the permissions have already been added back. + [Arguments] ${objectapiname} ${permset} + + ${addobjback} = Catenate SEPARATOR=\n + ... List checkperms = [SELECT PermissionsRead FROM ObjectPermissions + ... WHERE parentId IN ( SELECT id FROM permissionset WHERE PermissionSet.Name = '${permset}') AND + ... SobjectType = '${objectapiname}']; + ... if (checkperms.isEmpty()) { + ... String permid = [SELECT id FROM permissionset WHERE PermissionSet.Name = '${permset}'].id; + ... ObjectPermissions objperm = New ObjectPermissions(PermissionsRead = true, PermissionsEdit = true, PermissionsCreate = true, + ... PermissionsDelete = true, ParentId = permid, SobjectType = '${objectapiname}'); + ... insert objperm; } + ... else { System.debug('Permissions Exist, skipping.'); } + + Run Task execute_anon apex=${addobjback} + +Field Permissions Cleanup + [Documentation] Resets all field permissions in case a test fails before they are restored. Skips the reset if the permissions have already been added back. + [Arguments] ${objectapiname} ${fieldapiname} ${permset} + + ${ns} = Get NPSP Namespace Prefix + + ${addfieldback} = Catenate SEPARATOR=\n + ... List checkperms = [SELECT PermissionsRead FROM FieldPermissions + ... WHERE parentId IN ( SELECT id FROM permissionset WHERE PermissionSet.Name = '${permset}') AND + ... SobjectType = '${objectapiname}' AND Field = '${objectapiname}.${fieldapiname}']; + ... if (checkperms.isEmpty()) { + ... String permid = [SELECT id FROM permissionset WHERE PermissionSet.Name = '${permset}'].id; + ... FieldPermissions fldperm = New FieldPermissions(PermissionsRead = true, PermissionsEdit = true, + ... ParentId = permid, Field = '${objectapiname}.${fieldapiname}', SobjectType = '${objectapiname}'); + ... insert fldperm; } + ... else { System.debug('Permissions Exist, skipping.'); } + + Run Task execute_anon apex=${addfieldback} \ No newline at end of file diff --git a/robot/OutboundFundsNPSP/resources/locators_51.py b/robot/OutboundFundsNPSP/resources/locators_51.py index 4665d37..72bd03b 100644 --- a/robot/OutboundFundsNPSP/resources/locators_51.py +++ b/robot/OutboundFundsNPSP/resources/locators_51.py @@ -44,7 +44,7 @@ "button": "//div[contains(@class, 'forceRelatedListSingleContainer')][.//img][.//span[@title='{}']]//a[@title='{}']", "count": "//tbody/tr/td[1]", "flexi_button": "//div[@lst-listviewmanagerheader_listviewmanagerheader][.//span[@title='{}']]//lightning-button//button[text()='{}']", - "related_link": "//a//span[contains(text(),'{}')]", + "flexi_link": "//a//span[contains(text(),'{}')]", }, "link": "//a[contains(text(),'{}')]", } diff --git a/robot/OutboundFundsNPSP/tests/browser/FundingProgram/FundingProgram.robot b/robot/OutboundFundsNPSP/tests/browser/FundingProgram/FundingProgram.robot index e05c02d..aa72383 100644 --- a/robot/OutboundFundsNPSP/tests/browser/FundingProgram/FundingProgram.robot +++ b/robot/OutboundFundsNPSP/tests/browser/FundingProgram/FundingProgram.robot @@ -12,6 +12,8 @@ Suite Teardown Capture Screenshot And Delete Records And Close Browser *** Keywords *** Setup Test Data + ${ns} = Get Outfundsnpsp Namespace Prefix + Set suite variable ${ns} &{fundingprogram} = API Create Funding Program ${fp_name} = Generate New String Set suite variable &{fundingprogram} @@ -22,20 +24,20 @@ Create Funding Program Via API ... Verifies that Funding Program is created and ... displays under recently viewed Funding Program [tags] W-8865873 feature:FundingProgram - Go To Page Listing outfunds__Funding_Program__c + Go To Page Listing ${ns}Funding_Program__c Click Link With Text ${fundingprogram}[Name] Wait Until Loading Is Complete - Current Page Should Be Details outfunds__Funding_Program__c + Current Page Should Be Details Funding_Program__c Create Funding Program via UI [Documentation] Creates a Funding Program via UI. ... Verifies that Funding Program is created. [tags] W-8865863 feature:FundingProgram - Go To Page Listing outfunds__Funding_Program__c + Go To Page Listing ${ns}Funding_Program__c Click Object Button New Wait Until Modal Is Open Populate Field Funding Program Name ${fp_name} Populate Field Description Automated Robot Funding Program Click Save Wait Until Modal Is Closed - Current Page Should Be Details outfunds__Funding_Program__c \ No newline at end of file + Current Page Should Be Details Funding_Program__c \ No newline at end of file diff --git a/robot/OutboundFundsNPSP/tests/browser/FundingRequest/FundingRequest.robot b/robot/OutboundFundsNPSP/tests/browser/FundingRequest/FundingRequest.robot index e904007..b7217b7 100644 --- a/robot/OutboundFundsNPSP/tests/browser/FundingRequest/FundingRequest.robot +++ b/robot/OutboundFundsNPSP/tests/browser/FundingRequest/FundingRequest.robot @@ -12,6 +12,8 @@ Suite Teardown Capture Screenshot And Delete Records And Close Browser *** Keywords *** Setup Test Data + ${ns} = Get Outfundsnpsp Namespace Prefix + Set suite variable ${ns} ${fundingprogram} = API Create Funding Program Store Session Record outfunds__Funding_Program__c ${fundingprogram}[Id] Set suite variable ${fundingprogram} @@ -36,18 +38,18 @@ Create Funding Request Via API ... Verifies that Funding Request is created and ... displays under recently viewed Funding Request [tags] W-8865884 feature:FundingRequest - Go To Page Listing outfunds__Funding_Request__c + Go To Page Listing ${ns}Funding_Request__c Click Link With Text ${funding_request}[Name] Wait Until Loading Is Complete - Current Page Should Be Details outfunds__Funding_Request__c + Current Page Should Be Details Funding_Request__c Validate Field Value Status contains In progress Validate Field Value Funding Request Name contains ${funding_request}[Name] -Create Funding Request via UI in Grants Management +Create Funding Request via UI [Documentation] Creates a Funding Request via UI. ... Verifies that Funding Request is created. [tags] W-8865897 feature:FundingRequest - Go To Page Listing outfunds__Funding_Request__c + Go To Page Listing ${ns}Funding_Request__c Click Object Button New wait until modal is open Populate Field Funding Request Name ${fr_name} @@ -55,5 +57,5 @@ Create Funding Request via UI in Grants Management Populate Lookup Field Applying Contact ${contact}[Name] Click Save wait until modal is closed - Current Page Should Be Details outfunds__Funding_Request__c + Current Page Should Be Details Funding_Request__c Validate Field Value Funding Request Name contains ${fr_name} diff --git a/robot/OutboundFundsNPSP/tests/browser/GAUExpenditure/GAUExpenditure.robot b/robot/OutboundFundsNPSP/tests/browser/GAUExpenditure/GAUExpenditure.robot index f75eb7b..647d196 100644 --- a/robot/OutboundFundsNPSP/tests/browser/GAUExpenditure/GAUExpenditure.robot +++ b/robot/OutboundFundsNPSP/tests/browser/GAUExpenditure/GAUExpenditure.robot @@ -10,14 +10,18 @@ Suite Teardown Capture Screenshot And Delete Records And Close Browser *** Keywords *** Setup Test Data + ${ns} = Get Outfundsnpsp Namespace Prefix + Set suite variable ${ns} + ${ns_npsp} = Get NPSP Namespace Prefix + Set suite variable ${ns_npsp} ${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} ${disbursement} API Create Disbursement on a Funding Request ${funding_request}[Id] Set Suite Variable ${disbursement} @@ -29,7 +33,7 @@ Setup Test Data *** Test Case *** Verify GAU Expenditure created is added on Disbursement - Go To Page Listing outfunds__Funding_Request__c + Go To Page Listing ${ns}Funding_Request__c Click Link With Text ${funding_request}[Name] Click Tab Disbursements Click Related List Link with Text ${disbursement}[Name] diff --git a/robot/OutboundFundsNPSP/tests/browser/Requirements/Requirements.robot b/robot/OutboundFundsNPSP/tests/browser/Requirements/Requirements.robot new file mode 100644 index 0000000..2de736a --- /dev/null +++ b/robot/OutboundFundsNPSP/tests/browser/Requirements/Requirements.robot @@ -0,0 +1,46 @@ +*** Settings *** + +Resource robot/OutboundFundsNPSP/resources/OutboundFundsNPSP.robot +Library cumulusci.robotframework.PageObjects +... robot/OutboundFundsNPSP/resources/FundingRequestPageObject.py + +Suite Setup Run keywords +... Open Test Browser +... Setup Test Data +Suite Teardown Capture Screenshot And Delete Records And Close Browser + +*** Keywords *** +Setup Test Data + ${ns} = Get Outfundsnpsp Namespace Prefix + Set Suite Variable ${ns} + ${fundingprogram} = API Create Funding Program + 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] + ... ${ns}Status__c=In Progress ${ns}Awarded_Amount__c=100000 + Store Session Record ${ns}Funding_Request__c ${funding_request}[Id] + Set suite variable ${funding_request} + ${req_name} = Generate New String + Set suite variable ${req_name} + +*** Test Case *** +Add a Requirement on a Funding Request + [Documentation] Creates a Funding Request via API. + ... Go to Requirements and add a new Requirement + [tags] feature:Requirements + Go To Page Listing ${ns}Funding_Request__c + Click Link With Text ${funding_request}[Name] + Wait Until Loading Is Complete + Current Page Should Be Details Funding_Request__c + Click Tab Requirements + click related list wrapper button Requirements New + Wait For Modal New Requirement + Populate Field Requirement Name ${req_name} + Populate Lookup Field Primary Contact ${contact}[Name] + Click Save + wait until modal is closed + Click Related List Link With Text ${req_name} + Validate Field Value Requirement Name contains ${req_name} + Validate Field Value Primary Contact contains ${contact}[Name] From 17fffbc5b43f0ddb379fd8ae5f4774ced82e7998 Mon Sep 17 00:00:00 2001 From: gaganpsandhu Date: Wed, 10 Mar 2021 15:38:39 -0800 Subject: [PATCH 2/6] fixing modal message --- .../tests/browser/Requirements/Requirements.robot | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/robot/OutboundFundsNPSP/tests/browser/Requirements/Requirements.robot b/robot/OutboundFundsNPSP/tests/browser/Requirements/Requirements.robot index 2de736a..5522709 100644 --- a/robot/OutboundFundsNPSP/tests/browser/Requirements/Requirements.robot +++ b/robot/OutboundFundsNPSP/tests/browser/Requirements/Requirements.robot @@ -35,8 +35,8 @@ Add a Requirement on a Funding Request Wait Until Loading Is Complete Current Page Should Be Details Funding_Request__c Click Tab Requirements - click related list wrapper button Requirements New - Wait For Modal New Requirement + click related list wrapper button Requirements New + Wait For Modal New Requirement Populate Field Requirement Name ${req_name} Populate Lookup Field Primary Contact ${contact}[Name] Click Save From a81e81a9def5a227c4a93378caaf89869f69de2d Mon Sep 17 00:00:00 2001 From: gaganpsandhu Date: Wed, 10 Mar 2021 15:48:27 -0800 Subject: [PATCH 3/6] fixing build errors --- .cspell.json | 1 + robot/OutboundFundsNPSP/doc/Keywords.html | 1533 +++++++++-------- .../resources/FundingProgramPageObject.py | 5 +- .../resources/FundingRequestPageObject.py | 5 +- .../resources/OutboundFundsNPSP.py | 6 +- 5 files changed, 794 insertions(+), 756 deletions(-) diff --git a/.cspell.json b/.cspell.json index f2b901c..7797e36 100644 --- a/.cspell.json +++ b/.cspell.json @@ -73,6 +73,7 @@ "outboundfundsnpsp", "jsclick", "rtype", + "outfundsnpsp", // Storytelling data "Englewood", "Takagawa", diff --git a/robot/OutboundFundsNPSP/doc/Keywords.html b/robot/OutboundFundsNPSP/doc/Keywords.html index ebe10c8..351173f 100644 --- a/robot/OutboundFundsNPSP/doc/Keywords.html +++ b/robot/OutboundFundsNPSP/doc/Keywords.html @@ -1,746 +1,793 @@ - - - - - - -
- -
-

Outbound Funds (npsp)

-
- filter: -
-
- -
-
-

- OutboundFundsNPSP.py -

-
- robot/OutboundFundsNPSP/resources/OutboundFundsNPSP.py -
-
- -
-
-

Documentation for library OutboundFundsNPSP.

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
KeywordArgumentsDocumentation
Check If Element Exists - xpath - -

Checks if an element with given xpath exists

-
Click Save -

Click Save button in modal's footer

-
Click Tab - label - -

Click on a tab on a record page

-
Generate New String - prefix=Robot Test - -

- Generates a random string with Robot Test added as - prefix -

-
New Random String - len=5 - -

Generate a random string of fixed length

-
Random Email - prefix=robot_, - - suffix=example.com - -

- Return a random fake email address. :param prefix: - Some text to put in front of the randomized part - of the username. Defaults to "robot_" :type - prefix: str :param suffix: The domain part of the - email address. Defaults to "example.com" :type - suffix: str :returns: The fake email address. - :rtype: str -

-
Selenium Execute With Retry - execute, - - command, - - params - -

Run a single selenium command and retry once.

-

- The retry happens for certain errors that are - likely to be resolved by retrying. -

-
Validate Field Value - field, - - status, - - value, - - section=None - -

- If status is 'contains' then the specified value - should be present in the field 'does not contain' - then the specified value should not be present in - the field -

-
Wait For Aura -

Run the WAIT_FOR_AURA_SCRIPT.

-

- This script polls Aura via $A in Javascript to - determine when all in-flight XHTTP requests have - completed before continuing. -

-
-
-
- -
-
-

- OutboundFundsNPSP.robot -

-
- robot/OutboundFundsNPSP/resources/OutboundFundsNPSP.robot -
-
- -
-
-

- Documentation for resource file - OutboundFundsNPSP. -

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
KeywordArgumentsDocumentation
API Create Account - **fields -

Create an Account for user

API Create Contact - **fields -

Create a contact via API

API Create Contact for User - account_id, - - **fields - -

Create a contact via API for user creation

-
- API Create Disbursement on a Funding Request - - funding_request_id, - - **fields - -

- Create a Disbursement on a Funding Request via API -

-
API Create Funding Program - **fields - -

Create a Funding Program via API

-
API Create Funding Request - funding_program_id, - - contact_id, - - **fields - -

Create a Funding Request via API

-
- API Create Requirement on a Funding Request - - funding_request_id, - - contact_id, - - user_id, - - **fields - -

- Create a Requirement on a Funding Request via API -

-
- Capture Screenshot and Delete Records and Close - Browser - -

- This keyword will capture a screenshot before - closing the browser and deleting records when test - fails -

-
-
-
- -
-
-

- FundingProgramPageObject.py -

-
- robot/OutboundFundsNPSP/resources/FundingProgramPageObject.py -
-
- -
-
- - - - - - - - - - - -
Details - outfunds__Funding_Program__c -
Page TypeObject Name
-
- -
-

- Documentation for library - FundingProgramPageObject.FundingProgramDetailPage. -

-
- - - - - - - - - - - - - - -
KeywordArgumentsDocumentation
Log Current Page Object -

Logs the name of the current page object

-

- The current page object is also returned as an - object -

-
-
- -
-
- - - - - - - - - - - -
Listing - outfunds__Funding_Program__c -
Page TypeObject Name
-
- -
-

- Documentation for library - FundingProgramPageObject.FundingProgramListingPage. -

-
- - - - - - - - - - - - - - -
KeywordArgumentsDocumentation
Log Current Page Object -

Logs the name of the current page object

-

- The current page object is also returned as an - object -

-
-
-
- -
-
-

- FundingRequestPageObject.py -

-
- robot/OutboundFundsNPSP/resources/FundingRequestPageObject.py -
-
- -
-
- - - - - - - - - - - -
Details - outfunds__Funding_Request__c -
Page TypeObject Name
-
- -
-

- Documentation for library - FundingRequestPageObject.FundingRequestDetailPage. -

-
- - - - - - - - - - - - - - -
KeywordArgumentsDocumentation
Log Current Page Object -

Logs the name of the current page object

-

- The current page object is also returned as an - object -

-
-
- -
-
- - - - - - - - - - - -
Listing - outfunds__Funding_Request__c -
Page TypeObject Name
-
- -
-

- Documentation for library - FundingRequestPageObject.FundingRequestListingPage. -

-
- - - - - - - - - - - - - - -
KeywordArgumentsDocumentation
Log Current Page Object -

Logs the name of the current page object

-

- The current page object is also returned as an - object -

-
-
-
+ + + + + + +
+ +
+

Outbound Funds (npsp)

+
filter:
+
+ + +
+
+

OutboundFundsNPSP.py

+
robot/OutboundFundsNPSP/resources/OutboundFundsNPSP.py
- + +
+
+

OutboundFundsNPSP.robot

+
robot/OutboundFundsNPSP/resources/OutboundFundsNPSP.robot
+
+ + + + +
+ + + +

Documentation for resource file OutboundFundsNPSP.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
KeywordArgumentsDocumentation
+ API Create Account + + + **fields + +

Create an Account for user

+ API Create Contact + + + **fields + +

Create a contact via API

+ API Create Contact for User + + + account_id, + + **fields + +

Create a contact via API for user creation

+ API Create Disbursement on a Funding Request + + + funding_request_id, + + **fields + +

Create a Disbursement on a Funding Request via API

+ API Create Funding Program + + + **fields + +

Create a Funding Program via API

+ API Create Funding Request + + + funding_program_id, + + contact_id, + + **fields + +

Create a Funding Request via API

+ API Create GAU + + + **fields + +

Create a GAU

+ API Create GAU Expenditure + + + gau_id, + + disbursement_id, + + **fields + +

Create a GAU Expenditure on Disbursement

+ API Create Requirement on a Funding Request + + + funding_request_id, + + contact_id, + + user_id, + + **fields + +

Create a Requirement on a Funding Request via API

+ Capture Screenshot and Delete Records and Close Browser + + +

This keyword will capture a screenshot before closing the browser and deleting records when test fails

+ Change Field Permissions + + + action, + + objectapiname, + + fieldapiname, + + permset + +

Adds or removes the Create, Read, Edit and Delete permissions for the specified object field on the specified permission set.

+ Change Object Permissions + + + action, + + objectapiname, + + permset + +

Adds or removes the Create, Read, Edit and Delete permissions for the specified object on the specified permission set..

+ Field Permissions Cleanup + + + objectapiname, + + fieldapiname, + + permset + +

Resets all field permissions in case a test fails before they are restored. Skips the reset if the permissions have already been added back.

+ Object Permissions Cleanup + + + objectapiname, + + permset + +

Resets all object permissions in case a test fails before they are restored. Skips the reset if the permissions have already been added back.

+
+ +
+ +
+
+

FundingProgramPageObject.py

+
robot/OutboundFundsNPSP/resources/FundingProgramPageObject.py
- - + + + + +
+ + +
+ + + + + + + + + + + + +
DetailsFunding_Program__c
Page TypeObject Name
+
+ + +

Documentation for library FundingProgramPageObject.FundingProgramDetailPage.

+ + + + + + + + + + + +
KeywordArgumentsDocumentation
+ Log Current Page Object + + +

Logs the name of the current page object

+

The current page object is also returned as an object

+
+ +
+ + +
+ + + + + + + + + + + + +
ListingFunding_Program__c
Page TypeObject Name
+
+ + +

Documentation for library FundingProgramPageObject.FundingProgramListingPage.

+ + + + + + + + + + + +
KeywordArgumentsDocumentation
+ Log Current Page Object + + +

Logs the name of the current page object

+

The current page object is also returned as an object

+
+ +
+ +
+
+

FundingRequestPageObject.py

+
robot/OutboundFundsNPSP/resources/FundingRequestPageObject.py
+
+ + + + +
+ + +
+ + + + + + + + + + + + +
DetailsFunding_Request__c
Page TypeObject Name
+
+ + +

Documentation for library FundingRequestPageObject.FundingRequestDetailPage.

+ + + + + + + + + + + +
KeywordArgumentsDocumentation
+ Log Current Page Object + + +

Logs the name of the current page object

+

The current page object is also returned as an object

+
+ +
+ + +
+ + + + + + + + + + + + +
ListingFunding_Request__c
Page TypeObject Name
+
+ + +

Documentation for library FundingRequestPageObject.FundingRequestListingPage.

+ + + + + + + + + + + +
KeywordArgumentsDocumentation
+ Log Current Page Object + + +

Logs the name of the current page object

+

The current page object is also returned as an object

+
+ +
+ +
+ + + \ No newline at end of file diff --git a/robot/OutboundFundsNPSP/resources/FundingProgramPageObject.py b/robot/OutboundFundsNPSP/resources/FundingProgramPageObject.py index a9601de..7269c9e 100644 --- a/robot/OutboundFundsNPSP/resources/FundingProgramPageObject.py +++ b/robot/OutboundFundsNPSP/resources/FundingProgramPageObject.py @@ -7,21 +7,18 @@ @pageobject("Listing", "Funding_Program__c") class FundingProgramListingPage(BaseOutboundFundsNPSPPage, ListingPage): - @capture_screenshot_on_error def _is_current_page(self): """Verify we are on the Funding Program Listing page by verifying that the url contains '/view' """ self.selenium.location_should_contain( - "/list?", - message="Current page is not a Funding Program List view", + "/list?", message="Current page is not a Funding Program List view", ) @pageobject("Details", "Funding_Program__c") class FundingProgramDetailPage(BaseOutboundFundsNPSPPage, DetailPage): - @capture_screenshot_on_error def _is_current_page(self): """Verify we are on the Funding Program detail page diff --git a/robot/OutboundFundsNPSP/resources/FundingRequestPageObject.py b/robot/OutboundFundsNPSP/resources/FundingRequestPageObject.py index f8a2178..c70dc2d 100644 --- a/robot/OutboundFundsNPSP/resources/FundingRequestPageObject.py +++ b/robot/OutboundFundsNPSP/resources/FundingRequestPageObject.py @@ -7,21 +7,18 @@ @pageobject("Listing", "Funding_Request__c") class FundingRequestListingPage(BaseOutboundFundsNPSPPage, ListingPage): - @capture_screenshot_on_error def _is_current_page(self): """Verify we are on the Funding Request Listing page by verifying that the url contains '/view' """ self.selenium.location_should_contain( - "/list?", - message="Current page is not a Funding Request List view", + "/list?", message="Current page is not a Funding Request List view", ) @pageobject("Details", "Funding_Request__c") class FundingRequestDetailPage(BaseOutboundFundsNPSPPage, DetailPage): - @capture_screenshot_on_error def _is_current_page(self): """Verify we are on the Funding Request detail page diff --git a/robot/OutboundFundsNPSP/resources/OutboundFundsNPSP.py b/robot/OutboundFundsNPSP/resources/OutboundFundsNPSP.py index c52167c..3be9181 100644 --- a/robot/OutboundFundsNPSP/resources/OutboundFundsNPSP.py +++ b/robot/OutboundFundsNPSP/resources/OutboundFundsNPSP.py @@ -75,9 +75,7 @@ def get_npsp_namespace_prefix(self): if not hasattr(self.cumulusci, "_describe_result"): self.cumulusci._describe_result = self.cumulusci.sf.describe() objects = self.cumulusci._describe_result["sobjects"] - gau_object = [o for o in objects if o["label"] == "General Accounting Unit"][ - 0 - ] + gau_object = [o for o in objects if o["label"] == "General Accounting Unit"][0] return self.get_namespace_prefix(gau_object["name"]) def _check_if_element_exists(self, xpath): @@ -195,5 +193,3 @@ def click_related_list_wrapper_button(self, heading, button_title): ) self.salesforce._jsclick(locator) self.salesforce.wait_until_loading_is_complete() - - From 798d8ed4f46b744e441bd5a1b03962900d671a6b Mon Sep 17 00:00:00 2001 From: gaganpsandhu Date: Wed, 10 Mar 2021 16:08:15 -0800 Subject: [PATCH 4/6] fixning prettier errors --- robot/OutboundFundsNPSP/doc/Keywords.html | 1697 +++++++++++---------- 1 file changed, 907 insertions(+), 790 deletions(-) diff --git a/robot/OutboundFundsNPSP/doc/Keywords.html b/robot/OutboundFundsNPSP/doc/Keywords.html index 351173f..3b42c6f 100644 --- a/robot/OutboundFundsNPSP/doc/Keywords.html +++ b/robot/OutboundFundsNPSP/doc/Keywords.html @@ -1,793 +1,910 @@ - - - - - - -
- -
-

Outbound Funds (npsp)

-
filter:
-
- - -
-
-

OutboundFundsNPSP.py

-
robot/OutboundFundsNPSP/resources/OutboundFundsNPSP.py
+ + + + + + +
+ +
+

Outbound Funds (npsp)

+
+ filter: +
+
+ +
+
+

+ OutboundFundsNPSP.py +

+
+ robot/OutboundFundsNPSP/resources/OutboundFundsNPSP.py +
+
+ +
+
+

Documentation for library OutboundFundsNPSP.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
KeywordArgumentsDocumentation
Check If Element Exists + xpath + +

Checks if an element with given xpath exists

+
Click Save +

Click Save button in modal's footer

+
Click Tab + label + +

Click on a tab on a record page

+
Generate New String + prefix=Robot Test + +

+ Generates a random string with Robot Test added as + prefix +

+
Get Namespace Prefix + name +
Get Npsp Namespace Prefix
Get Outfundsnpsp Namespace Prefix
New Random String + len=5 + +

Generate a random string of fixed length

+
Random Email + prefix=robot_, + + suffix=example.com + +

+ Return a random fake email address. :param prefix: + Some text to put in front of the randomized part + of the username. Defaults to "robot_" :type + prefix: str :param suffix: The domain part of the + email address. Defaults to "example.com" :type + suffix: str :returns: The fake email address. + :rtype: str +

+
Selenium Execute With Retry + execute, + + command, + + params + +

Run a single selenium command and retry once.

+

+ The retry happens for certain errors that are + likely to be resolved by retrying. +

+
Validate Field Value + field, + + status, + + value, + + section=None + +

+ If status is 'contains' then the specified value + should be present in the field 'does not contain' + then the specified value should not be present in + the field +

+
Wait For Aura +

Run the WAIT_FOR_AURA_SCRIPT.

+

+ This script polls Aura via $A in Javascript to + determine when all in-flight XHTTP requests have + completed before continuing. +

+
+
+
+ +
+
+

+ OutboundFundsNPSP.robot +

+
+ robot/OutboundFundsNPSP/resources/OutboundFundsNPSP.robot +
+
+ +
+
+

+ Documentation for resource file + OutboundFundsNPSP. +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
KeywordArgumentsDocumentation
API Create Account + **fields +

Create an Account for user

API Create Contact + **fields +

Create a contact via API

API Create Contact for User + account_id, + + **fields + +

Create a contact via API for user creation

+
+ API Create Disbursement on a Funding Request + + funding_request_id, + + **fields + +

+ Create a Disbursement on a Funding Request via API +

+
API Create Funding Program + **fields + +

Create a Funding Program via API

+
API Create Funding Request + funding_program_id, + + contact_id, + + **fields + +

Create a Funding Request via API

+
API Create GAU + **fields +

Create a GAU

API Create GAU Expenditure + gau_id, + + disbursement_id, + + **fields + +

Create a GAU Expenditure on Disbursement

+
+ API Create Requirement on a Funding Request + + funding_request_id, + + contact_id, + + user_id, + + **fields + +

+ Create a Requirement on a Funding Request via API +

+
+ Capture Screenshot and Delete Records and Close + Browser + +

+ This keyword will capture a screenshot before + closing the browser and deleting records when test + fails +

+
Change Field Permissions + action, + + objectapiname, + + fieldapiname, + + permset + +

+ Adds or removes the Create, Read, Edit and Delete + permissions for the specified object field on the + specified permission set. +

+
Change Object Permissions + action, + + objectapiname, + + permset + +

+ Adds or removes the Create, Read, Edit and Delete + permissions for the specified object on the + specified permission set.. +

+
Field Permissions Cleanup + objectapiname, + + fieldapiname, + + permset + +

+ Resets all field permissions in case a test fails + before they are restored. Skips the reset if the + permissions have already been added back. +

+
Object Permissions Cleanup + objectapiname, + + permset + +

+ Resets all object permissions in case a test fails + before they are restored. Skips the reset if the + permissions have already been added back. +

+
+
+
+ +
+
+

+ FundingProgramPageObject.py +

+
+ robot/OutboundFundsNPSP/resources/FundingProgramPageObject.py +
+
+ +
+
+ + + + + + + + + + + +
DetailsFunding_Program__c
Page TypeObject Name
+
+ +
+

+ Documentation for library + FundingProgramPageObject.FundingProgramDetailPage. +

+
+ + + + + + + + + + + + + + +
KeywordArgumentsDocumentation
Log Current Page Object +

Logs the name of the current page object

+

+ The current page object is also returned as an + object +

+
+
+ +
+
+ + + + + + + + + + + +
ListingFunding_Program__c
Page TypeObject Name
+
+ +
+

+ Documentation for library + FundingProgramPageObject.FundingProgramListingPage. +

+
+ + + + + + + + + + + + + + +
KeywordArgumentsDocumentation
Log Current Page Object +

Logs the name of the current page object

+

+ The current page object is also returned as an + object +

+
+
+
+ +
+
+

+ FundingRequestPageObject.py +

+
+ robot/OutboundFundsNPSP/resources/FundingRequestPageObject.py +
+
+ +
+
+ + + + + + + + + + + +
DetailsFunding_Request__c
Page TypeObject Name
+
+ +
+

+ Documentation for library + FundingRequestPageObject.FundingRequestDetailPage. +

+
+ + + + + + + + + + + + + + +
KeywordArgumentsDocumentation
Log Current Page Object +

Logs the name of the current page object

+

+ The current page object is also returned as an + object +

+
+
+ +
+
+ + + + + + + + + + + +
ListingFunding_Request__c
Page TypeObject Name
+
+ +
+

+ Documentation for library + FundingRequestPageObject.FundingRequestListingPage. +

+
+ + + + + + + + + + + + + + +
KeywordArgumentsDocumentation
Log Current Page Object +

Logs the name of the current page object

+

+ The current page object is also returned as an + object +

+
+
+
- - - - -
- - - -

Documentation for library OutboundFundsNPSP.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
KeywordArgumentsDocumentation
- Check If Element Exists - - - xpath - -

Checks if an element with given xpath exists

- Click Save - - -

Click Save button in modal's footer

- Click Tab - - - label - -

Click on a tab on a record page

- Generate New String - - - prefix=Robot Test - -

Generates a random string with Robot Test added as prefix

- Get Namespace Prefix - - - name - -
- Get Npsp Namespace Prefix - - -
- Get Outfundsnpsp Namespace Prefix - - -
- New Random String - - - len=5 - -

Generate a random string of fixed length

- Random Email - - - prefix=robot_, - - suffix=example.com - -

Return a random fake email address. :param prefix: Some text to put in front of the randomized part of the username. Defaults to "robot_" :type prefix: str :param suffix: The domain part of the email address. Defaults to "example.com" :type suffix: str :returns: The fake email address. :rtype: str

- Selenium Execute With Retry - - - execute, - - command, - - params - -

Run a single selenium command and retry once.

-

The retry happens for certain errors that are likely to be resolved by retrying.

- Validate Field Value - - - field, - - status, - - value, - - section=None - -

If status is 'contains' then the specified value should be present in the field 'does not contain' then the specified value should not be present in the field

- Wait For Aura - - -

Run the WAIT_FOR_AURA_SCRIPT.

-

This script polls Aura via $A in Javascript to determine when all in-flight XHTTP requests have completed before continuing.

-
- -
- -
-
-

OutboundFundsNPSP.robot

-
robot/OutboundFundsNPSP/resources/OutboundFundsNPSP.robot
-
- - - - -
- - - -

Documentation for resource file OutboundFundsNPSP.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
KeywordArgumentsDocumentation
- API Create Account - - - **fields - -

Create an Account for user

- API Create Contact - - - **fields - -

Create a contact via API

- API Create Contact for User - - - account_id, - - **fields - -

Create a contact via API for user creation

- API Create Disbursement on a Funding Request - - - funding_request_id, - - **fields - -

Create a Disbursement on a Funding Request via API

- API Create Funding Program - - - **fields - -

Create a Funding Program via API

- API Create Funding Request - - - funding_program_id, - - contact_id, - - **fields - -

Create a Funding Request via API

- API Create GAU - - - **fields - -

Create a GAU

- API Create GAU Expenditure - - - gau_id, - - disbursement_id, - - **fields - -

Create a GAU Expenditure on Disbursement

- API Create Requirement on a Funding Request - - - funding_request_id, - - contact_id, - - user_id, - - **fields - -

Create a Requirement on a Funding Request via API

- Capture Screenshot and Delete Records and Close Browser - - -

This keyword will capture a screenshot before closing the browser and deleting records when test fails

- Change Field Permissions - - - action, - - objectapiname, - - fieldapiname, - - permset - -

Adds or removes the Create, Read, Edit and Delete permissions for the specified object field on the specified permission set.

- Change Object Permissions - - - action, - - objectapiname, - - permset - -

Adds or removes the Create, Read, Edit and Delete permissions for the specified object on the specified permission set..

- Field Permissions Cleanup - - - objectapiname, - - fieldapiname, - - permset - -

Resets all field permissions in case a test fails before they are restored. Skips the reset if the permissions have already been added back.

- Object Permissions Cleanup - - - objectapiname, - - permset - -

Resets all object permissions in case a test fails before they are restored. Skips the reset if the permissions have already been added back.

-
- -
- -
-
-

FundingProgramPageObject.py

-
robot/OutboundFundsNPSP/resources/FundingProgramPageObject.py
+ - - - - -
- - -
- - - - - - - - - - - - -
DetailsFunding_Program__c
Page TypeObject Name
-
- - -

Documentation for library FundingProgramPageObject.FundingProgramDetailPage.

- - - - - - - - - - - -
KeywordArgumentsDocumentation
- Log Current Page Object - - -

Logs the name of the current page object

-

The current page object is also returned as an object

-
- -
- - -
- - - - - - - - - - - - -
ListingFunding_Program__c
Page TypeObject Name
-
- - -

Documentation for library FundingProgramPageObject.FundingProgramListingPage.

- - - - - - - - - - - -
KeywordArgumentsDocumentation
- Log Current Page Object - - -

Logs the name of the current page object

-

The current page object is also returned as an object

-
- -
- -
-
-

FundingRequestPageObject.py

-
robot/OutboundFundsNPSP/resources/FundingRequestPageObject.py
-
- - - - -
- - -
- - - - - - - - - - - - -
DetailsFunding_Request__c
Page TypeObject Name
-
- - -

Documentation for library FundingRequestPageObject.FundingRequestDetailPage.

- - - - - - - - - - - -
KeywordArgumentsDocumentation
- Log Current Page Object - - -

Logs the name of the current page object

-

The current page object is also returned as an object

-
- -
- - -
- - - - - - - - - - - - -
ListingFunding_Request__c
Page TypeObject Name
-
- - -

Documentation for library FundingRequestPageObject.FundingRequestListingPage.

- - - - - - - - - - - -
KeywordArgumentsDocumentation
- Log Current Page Object - - -

Logs the name of the current page object

-

The current page object is also returned as an object

-
- -
- -
- - - \ No newline at end of file + + From ae2695c3d0da5da449c9bb73b8b6c26ab4c0d6f0 Mon Sep 17 00:00:00 2001 From: gaganpsandhu Date: Wed, 10 Mar 2021 18:03:46 -0800 Subject: [PATCH 5/6] updating library --- .../tests/browser/Requirements/Requirements.robot | 1 + 1 file changed, 1 insertion(+) diff --git a/robot/OutboundFundsNPSP/tests/browser/Requirements/Requirements.robot b/robot/OutboundFundsNPSP/tests/browser/Requirements/Requirements.robot index 5522709..68124ca 100644 --- a/robot/OutboundFundsNPSP/tests/browser/Requirements/Requirements.robot +++ b/robot/OutboundFundsNPSP/tests/browser/Requirements/Requirements.robot @@ -3,6 +3,7 @@ Resource robot/OutboundFundsNPSP/resources/OutboundFundsNPSP.robot Library cumulusci.robotframework.PageObjects ... robot/OutboundFundsNPSP/resources/FundingRequestPageObject.py +... robot/OutboundFundsNPSP/resources/OutboundFundsNPSP.py Suite Setup Run keywords ... Open Test Browser From 6534a010629360a036ac135af48b51a5a6a56baf Mon Sep 17 00:00:00 2001 From: gaganpsandhu Date: Wed, 10 Mar 2021 18:13:06 -0800 Subject: [PATCH 6/6] updating library --- .../tests/browser/Requirements/Requirements.robot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/robot/OutboundFundsNPSP/tests/browser/Requirements/Requirements.robot b/robot/OutboundFundsNPSP/tests/browser/Requirements/Requirements.robot index 68124ca..7c5d29c 100644 --- a/robot/OutboundFundsNPSP/tests/browser/Requirements/Requirements.robot +++ b/robot/OutboundFundsNPSP/tests/browser/Requirements/Requirements.robot @@ -1,6 +1,6 @@ *** Settings *** -Resource robot/OutboundFundsNPSP/resources/OutboundFundsNPSP.robot +Resource robot/OutboundFundsNPSP/resources/OutboundfundsNPSP.robot Library cumulusci.robotframework.PageObjects ... robot/OutboundFundsNPSP/resources/FundingRequestPageObject.py ... robot/OutboundFundsNPSP/resources/OutboundFundsNPSP.py