Advertisement
Guest User

Untitled

a guest
Apr 7th, 2020
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.84 KB | None | 0 0
  1. class TestCreateOrder(BaseTest):
  2.     facility_type = Facility.New
  3.  
  4.     @classmethod
  5.     def setup_class(self):
  6.         super(self, self).setup_class()
  7.         self.bls = [BL(login=self.user, facility=self.facility_id) for x in range(3)]
  8.         prepare_test_products(self.bls, self.location_id)
  9.  
  10.     @reporter.feature('Selenium tests')
  11.     @reporter.story('Create Order')
  12.     @reporter.parametrize('bl_index, product_indexes, add_product_indexes', [
  13.         (2, [0, ], [1, ]),
  14.     ])
  15.     def test_add_product(self, bl_index, product_indexes, add_product_indexes):
  16.         with order_customer_setup():
  17.             product_bl = self.bls[bl_index]
  18.             products = [product_bl.products[index] for index in product_indexes]
  19.             add_products = [product_bl.products[index] for index in add_product_indexes]
  20.  
  21.             MainPage.login_to_recon(login_name=self.user, user_cookies=self.user_cookie)
  22.             MainPage.open_facility_search()
  23.             FacilitySearch.enter_bl_click_search(product_bl.bl, len(product_bl.get_products()), choose_all_option=True)
  24.             FacilitySearch.select_products(products)
  25.             FacilitySearch.create_order(500)
  26.             created_order_id = B2BOrderSearch.check_popup()
  27.  
  28.             FacilitySearch.enter_bl_click_search(product_bl.bl, len(product_bl.products))
  29.             FacilitySearch.select_products(add_products)
  30.             FacilitySearch.add_products_to_order(created_order_id, 200)
  31.  
  32.             updated_order_id = B2BOrderSearch.check_popup()
  33.  
  34.             assert created_order_id == updated_order_id, 'Expected same order id'
  35.  
  36.             MainPage.open_manage_b2b()
  37.             B2BOrderSearch.search_b2b_order(order_id=created_order_id)
  38.             B2BOrderSearch.open_order_details(created_order_id)
  39.  
  40.             B2BOrderDetails.check_opened_order_details(products, [500, 200])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement