Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class TestCreateOrder(BaseTest):
- facility_type = Facility.New
- @classmethod
- def setup_class(self):
- super(self, self).setup_class()
- self.bls = [BL(login=self.user, facility=self.facility_id) for x in range(3)]
- prepare_test_products(self.bls, self.location_id)
- @reporter.feature('Selenium tests')
- @reporter.story('Create Order')
- @reporter.parametrize('bl_index, product_indexes, add_product_indexes', [
- (2, [0, ], [1, ]),
- ])
- def test_add_product(self, bl_index, product_indexes, add_product_indexes):
- with order_customer_setup():
- product_bl = self.bls[bl_index]
- products = [product_bl.products[index] for index in product_indexes]
- add_products = [product_bl.products[index] for index in add_product_indexes]
- MainPage.login_to_recon(login_name=self.user, user_cookies=self.user_cookie)
- MainPage.open_facility_search()
- FacilitySearch.enter_bl_click_search(product_bl.bl, len(product_bl.get_products()), choose_all_option=True)
- FacilitySearch.select_products(products)
- FacilitySearch.create_order(500)
- created_order_id = B2BOrderSearch.check_popup()
- FacilitySearch.enter_bl_click_search(product_bl.bl, len(product_bl.products))
- FacilitySearch.select_products(add_products)
- FacilitySearch.add_products_to_order(created_order_id, 200)
- updated_order_id = B2BOrderSearch.check_popup()
- assert created_order_id == updated_order_id, 'Expected same order id'
- MainPage.open_manage_b2b()
- B2BOrderSearch.search_b2b_order(order_id=created_order_id)
- B2BOrderSearch.open_order_details(created_order_id)
- B2BOrderDetails.check_opened_order_details(products, [500, 200])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement