TT#70901 selenium: reqire a customer when creating a subscriber

- previously it was possible to create a subscriber without creating a
customer. it would just grab the first customer in the customer list and
create a subscriber there. however, since we delete the entire customer now
instead of just the created subscriber and some customers dont allow to create
a subscriber, this feature will be removed.

Change-Id: Ibc8872ebd6073f8ec531a1e9493f036392df0e56
changes/54/36854/1
Nico Schedel 5 years ago
parent 714f69e7ae
commit 0ce12427da

@ -95,11 +95,10 @@ def delete_customer(driver, name):
driver.find_element_by_xpath('//*[@id="dataConfirmOK"]').click() driver.find_element_by_xpath('//*[@id="dataConfirmOK"]').click()
def create_subscriber(driver, customername=None): def create_subscriber(driver, customername):
driver.find_element_by_xpath( driver.find_element_by_xpath(
'//*[@id="main-nav"]//*[contains(text(),"Settings")]').click() '//*[@id="main-nav"]//*[contains(text(),"Settings")]').click()
driver.find_element_by_link_text('Customers').click() driver.find_element_by_link_text('Customers').click()
if customername:
Functions.fill_element( Functions.fill_element(
driver, '//*[@id="Customer_table_filter"]//input', driver, '//*[@id="Customer_table_filter"]//input',
'thisshouldnotexist') 'thisshouldnotexist')
@ -118,15 +117,6 @@ def create_subscriber(driver, customername=None):
'"Details")]') '"Details")]')
) )
hoverclick.perform() hoverclick.perform()
else:
hoverclick = ActionChains(driver)
hoverclick.move_to_element(driver.find_element_by_xpath(
'//*[@id="Customer_table"]//tr[1]'))
hoverclick.click(driver.find_element_by_xpath(
'//*[@id="Customer_table"]//tr[1]//td//a[contains(text(), '
'"Details")]')
)
hoverclick.perform()
driver.find_element_by_link_text('Expand Groups').click() driver.find_element_by_link_text('Expand Groups').click()
driver.execute_script( driver.execute_script(
'arguments[0].scrollIntoView();', 'arguments[0].scrollIntoView();',
@ -151,11 +141,10 @@ def create_subscriber(driver, customername=None):
driver.find_element_by_xpath('//*[@id="save"]').click() driver.find_element_by_xpath('//*[@id="save"]').click()
def delete_subscriber(driver, customername=None): def delete_subscriber(driver, customername):
driver.find_element_by_xpath( driver.find_element_by_xpath(
'//*[@id="main-nav"]//*[contains(text(),"Settings")]').click() '//*[@id="main-nav"]//*[contains(text(),"Settings")]').click()
driver.find_element_by_link_text('Customers').click() driver.find_element_by_link_text('Customers').click()
if customername:
Functions.fill_element( Functions.fill_element(
driver, '//*[@id="Customer_table_filter"]//input', driver, '//*[@id="Customer_table_filter"]//input',
'thisshouldnotexist') 'thisshouldnotexist')
@ -174,15 +163,6 @@ def delete_subscriber(driver, customername=None):
'"Details")]') '"Details")]')
) )
hoverclick.perform() hoverclick.perform()
else:
hoverclick = ActionChains(driver)
hoverclick.move_to_element(driver.find_element_by_xpath(
'//*[@id="Customer_table"]//tr[1]'))
hoverclick.click(driver.find_element_by_xpath(
'//*[@id="Customer_table"]//tr[1]//td//a[contains(text(), '
'"Details")]')
)
hoverclick.perform()
driver.find_element_by_link_text('Expand Groups').click() driver.find_element_by_link_text('Expand Groups').click()
driver.execute_script( driver.execute_script(
'arguments[0].scrollIntoView();', 'arguments[0].scrollIntoView();',

Loading…
Cancel
Save