Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix quadrant:q3 robot tests. Mostly locator changes #7170

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions robot/Cumulus/resources/CustomizableRollupsPageObject.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,27 @@
class CustomRollupSettingsPage(BaseNPSPPage, BasePage):

def navigate_to_crlpsettings(self, filter_name=None):
""" Click on the Navigate CRLP Button and wait for the page to load
"""
""" Click on the Navigate CRLP Button and wait for the page to load """
locator = npsp_lex_locators["id"].format("navigateCRLPs")
self.selenium.click_element(locator)
self.selenium.wait_until_location_contains(
"/one/one.app",
timeout=60,
message="custom rollup settings page did not load in 1 min",
)
self.npsp.wait_for_locator("frame_new", "vfFrameId", "vfFrameId")
self.npsp.choose_frame("vfFrameId")
self.selenium.reload_page()
self.salesforce.wait_until_loading_is_complete()
self.builtin.sleep(60)
self.builtin.log(self.selenium.get_source())
self.selenium.wait_until_page_contains("Account: Average Gift", timeout=60)
# self.selenium.wait_until_page_contains_element("//div[@class='oneAlohaPage']", timeout=120)
self.builtin.log(self.selenium.get_source())
self.selenium.wait_until_page_contains_element("//iframe", timeout=120)
self.selenium.select_frame("//iframe")

# self.npsp.wait_for_locator("frame_new", "vfFrameId", "vfFrameId")
# self.npsp.choose_frame("vfFrameId")

link = npsp_lex_locators["link-text"].format("Back to NPSP Settings")
self.selenium.wait_until_page_contains_element(
link, error="Current page is not a customizable rollups setting view"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ def click_and_wait_for_task(self, taskname):

def enter_task_id_and_subject(self, id, value):
"""Enter values into corresponding task subject fields based on last 2 digits of id"""
locator = npsp_lex_locators['engagement_plan']['input_box'].format(id)
self.selenium.wait_until_element_is_visible(locator,60)
locator = npsp_lex_locators['engagement_plan']['input_box'].format(id, "Subject")
self.selenium.wait_until_element_is_visible(locator, 60)
self.salesforce.scroll_element_into_view(locator)
self.selenium.get_webelement(locator).send_keys(value)

Expand Down
13 changes: 5 additions & 8 deletions robot/Cumulus/resources/NPSP.py
Original file line number Diff line number Diff line change
Expand Up @@ -499,12 +499,10 @@ def verify_occurence(self,title,value):
def check_record_related_item(self,title,value):
"""Verifies that the given value is displayed under the related list identified by title on a record view page"""
self.salesforce.load_related_list(title)
locator=npsp_lex_locators['record']['related']['item'].format(title,value)
locator = npsp_lex_locators['record']['related']['item'].format(title)
self.selenium.wait_until_page_contains_element(locator)
actual_value=self.selenium.get_webelement(locator).text
assert value == actual_value, "Expected value to be {} but found {}".format(
value, actual_value
)
actual_value = self.selenium.get_webelement(locator).text
assert value == actual_value, "Expected value to be {} but found {}".format(value, actual_value)


def select_related_dropdown(self,title):
Expand Down Expand Up @@ -571,7 +569,6 @@ def click_special_object_button(self, title):
self.selenium.wait_until_element_is_visible(locator,error="Button "+ title +" not found on the page")
self.selenium.get_webelement(locator).click()


def check_related_list_values(self,list_name,*args):
"""Verifies the value of custom related list"""
self.salesforce.load_related_list(list_name)
Expand Down Expand Up @@ -803,9 +800,9 @@ def get_npsp_locator(self, path, *args, **kwargs):
return main_loc

def wait_for_locator(self, path, *args, **kwargs):
"""Waits for 60 sec for the specified locator"""
"""Waits for 180 sec for the specified locator"""
main_loc = self.get_npsp_locator(path,*args, **kwargs)
self.selenium.wait_until_element_is_visible(main_loc, timeout=60)
self.selenium.wait_until_element_is_visible(main_loc, timeout=180)

def wait_for_locator_is_not_visible(self, path, *args, **kwargs):
"""Waits for 60 sec for the specified locator"""
Expand Down
9 changes: 5 additions & 4 deletions robot/Cumulus/resources/locators_55.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
'drop-down':'//div[contains(@class, "slds-card")]/header[.//span[@title="{}"]]/parent::*/div/div/div/a[contains(@class, "slds-button")]',
'title':'//div/h2//a[./span[text()="{}"]]',
'viewall':'//article[contains(@class, "slds-card slds-card_boundary")][.//span[@title="{}"]]//a[.//span[@class="view-all-label"]]',
'item':"//article[contains(@class, 'slds-card_boundary')][.//img][.//span[@title='{}']]//h3//a",
'item':"//article[contains(@class, 'slds-card_boundary')][.//img][.//span[@title='{}']]//h3//a//span",
'field_value': '//a[text()="{}"]/ancestor::li//div[contains(@class, "slds-item--detail")]//*[text()="{}"]',
'link':"//article[contains(@class, 'slds-card slds-card_boundary')][.//span[@title='{}']]//table/tbody/tr[.//td//*[text()='{}']]/th//a",
'dd-link':'//a[@name="{}"]',
Expand Down Expand Up @@ -116,7 +116,7 @@
'related_list_items':'//article[contains(@class,"slds-card_boundary")][.//a[contains(@class, "slds-card")]/span[text() = "{}"]]//div[contains(@class, "listDisplays")]//*[text()="{}"]',
'span_button':'//span[text()="{}"]',
'modalspan_button':'//div[contains(@class,"modal-body")]//span[text()="{}"]',
'related_drop_down':'//div/a[contains(@class,"slds-button")]/ancestor::li/div/a',
'related_drop_down':"//li[contains(@class, 'forceRecordLayout')]//a[contains(text(), '{}')]/ancestor::h3[contains(@class, 'primaryField')]/following-sibling::div//a[@role='button']",
'span':"//span[@title='{}']",
'header_field_value':'//*[contains(@class, "slds-page-header__detail")][.//*[@title="{}"]]//*[text()="{}"]',
'header_datepicker':'//li[contains(@class, "slds-page-header__detail")][.//p[contains(@class, "slds-text-heading--label")][@title="{}"]]//*[@class="uiOutputDate"]',
Expand All @@ -126,14 +126,15 @@
'field_lookup_value': "//a[@role='option'][.//div[@title='{}']]",
'field-value':"//div[contains(@class,'slds-form-element')][./label[text()='{}']]/div/span",
'header':'//h1//child::div/span[text()="{}"]',
'check_related_list_item':'//article[.//span[text() = "{}"]]/descendant::tbody//th/*/*/*/*/*/*/*/*/a/span[text()="{}"]',
'check_related_list_item': '//article[.//span[text() = "{}"]]/descendant::tbody//th//a//span[text()="{}"]',
'detail_page': {
'section_header':'//h3//span[text()="{}"]',
'address':'//h3[contains(@class, "slds-section__title")][.//span[contains(text(),"Address")]]/../..//div[contains(@class, "test-id")]/span[text()= "{}"]/../following-sibling::div//a//div[contains(@class, "slds")]',
'field':'//h3[contains(@class, "slds-section__title")][.//span[text()="{}"]]/../..//div[contains(@class, "test-id")]/span[text()= "{}"]/../following-sibling::div//span[text()="{}"]',
'field-value':{
'verify_field_value1':'//div[contains(@class, "forcePageBlockItem")]/div/div//span[text()="{}"]/../../div[2]/span/span[text() = "{}"]',
'verify_field_value2':'//force-record-layout-item//div[./span[text()="{}"]]/following-sibling::div//lightning-formatted-text[text() = "{}"]',
'verify_field_value3':'//records-record-layout-item//div[./span[text()="{}"]]/following-sibling::div//lightning-formatted-text[text() = "{}"]'
},
'edit_mode':{
'section_header':'//div[contains(@class,"forcePageBlockSectionEdit")]/h3//span[text()="{}"]',
Expand All @@ -160,7 +161,7 @@
'field-value':'//tbody/tr[./th//a[text()="{}"]]/td[.//span[text()="{}"]]',
},
'engagement_plan':{
'input_box':'//fieldset[./legend[text()="{}"]]//div[@class="requiredInput"]/input',
'input_box':'//fieldset[./legend[text()="{}"]]//input[@aria-label="{}"]',
'dropdown':'//div[contains(@class,"slds-p-top_small")]/label[text()="{}"]/following-sibling::div/select',
'checkbox':'//div[contains(@class,"slds-p-top_small")]/label[@class="slds-checkbox"][./span/following-sibling::{}[text()="{}"]/]',
'button':'//div[contains(@class,"slds-button-group")][.//span[text()="toTask {}"]]/button[contains(text(),"{}")]',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ Setup Test Data
... Name=${data}[account][Name] $50 donation Amount=50 ${ns}Primary_Contact__c=${data}[contact][Id]
Set suite variable &{opportunity}


*** Variables ***

&{contact_fields} [email protected]
&{account_fields} Type=Organization

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Library cumulusci.robotframework.PageObjects
Suite Setup Run keywords
... Open Test Browser
... Setup Test Data
Suite Teardown Delete Records and Close Browser
Suite Teardown Capture Screenshot and Delete Records and Close Browser

***Keywords***
Setup Test Data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Library cumulusci.robotframework.PageObjects
Suite Setup Run keywords
... Open Test Browser
... Setup Test Data
Suite Teardown Delete Records and Close Browser
Suite Teardown Capture Screenshot and Delete Records and Close Browser

***Keywords***
Setup Test Data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Create Crlp For Automated Soft Credit
... Enable CRLP from settings, create a setting record. Create an opportunity associated with a contact that is not primary
... Run the relevant rollup batch job and ensure that rollups are happening and displayed on the opportunity page

[tags] feature:CRLP unstable api quadrant:q3
[tags] feature:CRLP unstable api quadrant:q3 jenkins_debug

# Create a custom lookup field requried for this particular testcase
Create Customfield In Object Manager
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ Total Current Year Payments on Prior Year Pledges
[Documentation] Calculates Total Current Year Payments on Prior Year opportunity Pledges
... Enables CRLP settings, creates the custom fields on account and payment objects required for rollup
... Creates a filter and crlp setting to rollup the amount of current year payments on a previous year opportunity

[Tags] feature:CRLP unstable api quadrant:q3
[Tags] feature:CRLP unstable api quadrant:q3 jenkins_debug

# Create a Filter group and CRLP setting after checking prior records do not check if element exists
Load Page Object Custom CustomRollupSettings
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Setup Test Data
Calculate CRLPs for Total Gifts 3 Years Ago
[Documentation] Create a New rollup for Total Gifts 3 years ago by cloning an existing rollup called Total Gifts Two Years Ago
... and create an opportunity for 3 ago from current date and verify the rollup value on newly created Total Gifts Three Years Ago field
[tags] feature:CRLP unstable api quadrant:q3
[tags] feature:CRLP unstable api quadrant:q3 jenkins_debug

# clone an existing rollup and create a new one and verify that its created
Load Page Object Custom CustomRollupSettings
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Setup Test Data
Calculate CRLPs for Total Gifts On Multiple Opportunities
[Documentation] This test case is aimed at validating that the customizable rollup "Total Gifts" is active by default when the CRLP setting is turned
... And verifies that the rollup is actually happening
[tags] feature:CRLP unstable api quadrant:q3
[tags] feature:CRLP unstable api quadrant:q3 jenkins_debug


Load Page Object Custom CustomRollupSettings
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Library cumulusci.robotframework.PageObjects
Suite Setup Run keywords
... Open Test Browser
... Setup Test Data
Suite Teardown Delete Records and Close Browser
Suite Teardown Capture Screenshot and Delete Records and Close Browser

***Keywords***
# Sets test data contact and an opportunity for the contact
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Library cumulusci.robotframework.PageObjects
Suite Setup Run keywords
... Open Test Browser
... Setup Test Data
Suite Teardown Delete Records and Close Browser
Suite Teardown Capture Screenshot and Delete Records and Close Browser

***Keywords***
# Sets test data contact and an opportunity for the contact
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Library cumulusci.robotframework.PageObjects
Suite Setup Run keywords
... Open Test Browser
... Setup Test Data
Suite Teardown Delete Records and Close Browser
Suite Teardown Capture Screenshot and Delete Records and Close Browser

***Keywords***
# Sets test data contact and an opportunity for the contact
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Resource robot/Cumulus/resources/NPSP.robot
Library cumulusci.robotframework.PageObjects
... robot/Cumulus/resources/DataImportPageObject.py
Suite Setup Open Test Browser
#Suite Teardown Delete Records and Close Browser
#Suite Teardown Capture Screenshot and Delete Records and Close Browser

*** Test Cases ***

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Library cumulusci.robotframework.PageObjects
... robot/Cumulus/resources/LeadsPageObject.py

Suite Setup Open Test Browser
Suite Teardown Delete Records and Close Browser
Suite Teardown Capture Screenshot and Delete Records and Close Browser

*** Test Cases ***

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Library cumulusci.robotframework.PageObjects
... robot/Cumulus/resources/NPSP.py
Suite Setup Run keywords
... Open Test Browser
Suite Teardown Delete Records and Close Browser
Suite Teardown Capture Screenshot and Delete Records and Close Browser


*** Variables ***
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Library cumulusci.robotframework.PageObjects
Suite Setup Run keywords
... Open Test Browser
... Setup Test Data
Suite Teardown Delete Records and Close Browser
Suite Teardown Capture Screenshot and Delete Records and Close Browser

***Keywords***
# Setup a contact with parameters specified
Expand Down
2 changes: 1 addition & 1 deletion robot/Cumulus/tests/browser/gaus/create_gau.robot
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Resource robot/Cumulus/resources/NPSP.robot
Library cumulusci.robotframework.PageObjects
... robot/Cumulus/resources/GAUPageObject.py
Suite Setup Open Test Browser
Suite Teardown Delete Records and Close Browser
Suite Teardown Capture Screenshot and Delete Records and Close Browser

*** Test Cases ***

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Library cumulusci.robotframework.PageObjects
... robot/Cumulus/resources/LevelsPageObject.py
... robot/Cumulus/resources/NPSPSettingsPageObject.py
Suite Setup Open Test Browser
Suite Teardown Delete Records and Close Browser
Suite Teardown Capture Screenshot and Delete Records and Close Browser


*** Variables ***
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Library cumulusci.robotframework.PageObjects
Suite Setup Run keywords
... Open Test Browser
... Setup Test Data
Suite Teardown Delete Records and Close Browser
Suite Teardown Capture Screenshot and Delete Records and Close Browser

*** Keywords ***
Setup Test Data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Library cumulusci.robotframework.PageObjects
Suite Setup Run keywords
... Open Test Browser
... Setup Test Data
Suite Teardown Delete Records and Close Browser
Suite Teardown Capture Screenshot and Delete Records and Close Browser

*** Keywords ***

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Library cumulusci.robotframework.PageObjects
Suite Setup Run keywords
... Open Test Browser
... Setup Test Data
Suite Teardown Delete Records and Close Browser
Suite Teardown Capture Screenshot and Delete Records and Close Browser

*** Keywords ***

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Library cumulusci.robotframework.PageObjects
Suite Setup Run keywords
... Open Test Browser
... Setup Test Data
Suite Teardown Delete Records and Close Browser
Suite Teardown Capture Screenshot and Delete Records and Close Browser


*** Keywords ***
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Resource robot/Cumulus/resources/NPSP.robot
Library cumulusci.robotframework.PageObjects
... robot/Cumulus/resources/NPSPSettingsPageObject.py
Suite Setup Open Test Browser
Suite Teardown Delete Records and Close Browser
Suite Teardown Capture Screenshot and Delete Records and Close Browser

*** Test Cases ***

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Resource robot/Cumulus/resources/NPSP.robot
Library cumulusci.robotframework.PageObjects
... robot/Cumulus/resources/CustomSettingsPageObject.py
Suite Setup Open Test Browser
Suite Teardown Delete Records and Close Browser
Suite Teardown Capture Screenshot and Delete Records and Close Browser

*** Test Cases ***

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Library cumulusci.robotframework.PageObjects
Suite Setup Run keywords
... Open Test Browser
... Setup Test Data
Suite Teardown Delete Records and Close Browser
Suite Teardown Capture Screenshot and Delete Records and Close Browser

***Keywords***

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Library cumulusci.robotframework.PageObjects
... robot/Cumulus/resources/ContactPageObject.py
... robot/Cumulus/resources/RecurringDonationsPageObject.py
Suite Setup Open Test Browser
Suite Teardown Delete Records and Close Browser
Suite Teardown Capture Screenshot and Delete Records and Close Browser

*** Keywords ***
API Modify Trigger Handler
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Library cumulusci.robotframework.PageObjects
Suite Setup Run Keywords
... Open Test Browser
... Setup Variables
Suite Teardown Delete Records and Close Browser
Suite Teardown Capture Screenshot and Delete Records and Close Browser

*** Keywords ***
Setup Variables
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Suite Setup Run Keywords
... Open Test Browser
... Setup Variables
... Setup Test Data
Suite Teardown Delete Records and Close Browser
Suite Teardown Capture Screenshot and Delete Records and Close Browser

*** Keywords ***
Setup Variables
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Suite Setup Run Keywords
... Open Test Browser
... Setup Variables
... Setup Test Data
Suite Teardown Delete Records and Close Browser
Suite Teardown Capture Screenshot and Delete Records and Close Browser

*** Keywords ***
Setup Variables
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Suite Setup Run Keywords
... Open Test Browser
... Setup Variables
... Setup Test Data
Suite Teardown Delete Records and Close Browser
Suite Teardown Capture Screenshot and Delete Records and Close Browser

*** Keywords ***
Setup Variables
Expand Down
Loading