Advertisement
Guest User

Untitled

a guest
Jul 18th, 2019
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.43 KB | None | 0 0
  1. def test_region_filter_country_and_town(self, driver):
  2. CatalogShopPage(driver).open_shop_page()
  3. CatalogShopPage(driver).open_filter_by_region_button()
  4. CatalogShopPage(driver).click_filter_all_country()
  5. CatalogShopPage(driver).select_country_in_all_country_filter()
  6. CatalogShopPage(driver).click_filter_shops_all_town()
  7. CatalogShopPage(driver).select_town_in_all_town_filter()
  8. CatalogShopPage(driver).click_show_button()
  9.  
  10. def open_shop_page(self):
  11. self.navigate_to("shops/" + "all?sort=rating")
  12. return self
  13. def open_filter_by_region_button(self):
  14. self.find_element((By.CSS_SELECTOR, catalog_consts.OPEN_FILTER_BY_REGION)).click()
  15.  
  16. def click_filter_all_country(self):
  17. self.find_element((By.XPATH, catalog_consts.COUNTRY_FILTER)).click()
  18.  
  19. def select_country_in_all_country_filter(self):
  20. self.find_element((By.XPATH, catalog_consts.SELECT_COUNTRY)).click()
  21.  
  22. def click_filter_shops_all_town(self):
  23. self.find_element((By.XPATH, catalog_consts.TOWN_FILTER)).click()
  24.  
  25. def select_town_in_all_town_filter(self):
  26. self.find_element((By.XPATH, catalog_consts.SELECT_TOWN)).click()
  27.  
  28. def click_show_button(self):
  29. self.find_element((By.XPATH, catalog_consts.SHOW_BUTTON)).click()
  30.  
  31. OPEN_FILTER_BY_REGION = "button.no-button.expansion-panel__button > app-icon[name='control--arrow'] > svg-icon.ng-star-inserted > svg.icon"
  32. SHOPS_IN_MY_TOWN_BUTTON = "button.button.white.medium.normal.button-upload.ng-star-inserted"
  33. COUNTRY_FILTER = "//*[@id='wrapper-content']/app-shops/div/app-catalog/div/div[1]/aside/div/app-country-query-filter/app-expansion-panel/div/div[2]/main/div[1]/app-select/div/div/input[2]"
  34. SELECT_COUNTRY = "//*[@id='wrapper-content']/app-shops/div/app-catalog/div/div[1]/aside/div/app-country-query-filter/app-expansion-panel/div/div[2]/main/div[1]/app-select/div/app-popup-menu/div/div/div/app-option[2]/button"
  35.  
  36. TOWN_FILTER = "//*[@id='wrapper-content']/app-shops/div/app-catalog/div/div[1]/aside/div/app-country-query-filter/app-expansion-panel/div/div[2]/main/div[2]/app-select/div/div/input[1]"
  37. SELECT_TOWN = "//*[@id='wrapper-content']/app-shops/div/app-catalog/div/div[1]/aside/div/app-country-query-filter/app-expansion-panel/div/div[2]/main/div[2]/app-select/div/app-popup-menu/div/div/div/app-option[2]/button"
  38. SHOW_BUTTON = "//button[@class='button pink medium normal ng-star-inserted']"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement