예제 #1
0
 def test_second_shop_new_card(self):
     user = data.get_user("registered_user")
     car = data.get_vehicle("unregistered_vehicle_5")
     card = data.get_card("valid_card")
     homepage = HomePage(self.driver)
     homepage.navigate()
     homepage.wait_for_element("btn-close")
     homepage.click_element("btn-close")
     homepage.wait_for_element("urban-plan-button")
     homepage.click_element("urban-plan-button")
     cpf_page = Cpf(self.driver)
     cpf_page.wait_for_element("cpf")
     cpf_page.set_cpf(user["cpf"])
     password_page = Password(self.driver)
     password_page.wait_for_element("password")
     password_page.set_password(user["password"])
     password_page.click_element("next-button")
     self.address(user["address"])
     self.vehicle(car)
     summary_page = Summary(self.driver)
     summary_page.wait_for_element_by_class("meus_planos")
     sleep(3)
     summary_page.click_element("next-button")
     payment_page = Payment(self.driver)
     payment_page.wait_for_element("card-number")
     payment_page.click_element("change-card")
     payment_page.set_card(card)
     sleep(3)
     payment_page.click_element("adesao-click")
     payment_page.click_element("next-button")
     payment_page.wait_for_element_by_class("image-checked")
예제 #2
0
 def test_shop_registered_client_from_stop(self):
     user = data.get_user("registered_user")
     car = data.get_vehicle("unregistered_vehicle_3")
     card = data.get_card("valid_card")
     homepage = HomePage(self.driver)
     homepage.navigate()
     homepage.wait_for_element("btn-close")
     homepage.click_element("btn-close")
     homepage.wait_for_element("urban-plan-button")
     homepage.click_element("urban-plan-button")
     cpf_page = Cpf(self.driver)
     cpf_page.wait_for_element("cpf")
     cpf_page.set_cpf(user["cpf"])
     password_page = Password(self.driver)
     password_page.wait_for_element("password")
     password_page.set_password(user["password"])
     password_page.click_element("next-button")
     self.address(user["address"])
     self.vehicle(car)
     homepage = HomePage(self.driver)
     homepage.navigate()
     homepage.wait_for_element("urban-plan-button")
     homepage.click_element("urban-plan-button")
     cpf_page = Cpf(self.driver)
     cpf_page.wait_for_element("cpf")
     cpf_page.set_cpf(user["cpf"])
     password_page = Password(self.driver)
     password_page.wait_for_element("password")
     password_page.set_password(user["password"])
     password_page.click_element("next-button")
     self.payment(card)
예제 #3
0
 def test_list_orders(self):
     user = data.get_user("registered_user")
     homepage = HomePage(self.driver)
     homepage.navigate()
     sleep(3)
     homepage.navigate_to_login()
     login_page = LoginPage(self.driver)
     login_page.wait_to_load()
     login_page.logIn(user["cpf"], user["password"])
     orders_page = OrdersPage(self.driver)
     orders_page.wait_to_load()
예제 #4
0
 def test_login_registered_user(self):
     user = data.get_user("registered_user")
     homepage = HomePage(self.driver)
     homepage.navigate()
     homepage.wait_for_element("btn-close")
     homepage.click_element("btn-close")
     homepage.wait_for_element('urban-plan-button')
     login_page = LoginPage(self.driver)
     self.driver.get("http://localhost:4200/login")
     login_page.wait_to_load()
     login_page.logIn(user["cpf"], user["password"])
     statement_page = StatementPage(self.driver)
     statement_page.wait_to_load()
예제 #5
0
 def test_login_unregistered_cpf(self):
     user = data.get_user("new_unregistered_user")
     homepage = HomePage(self.driver)
     homepage.navigate()
     homepage.wait_for_element("btn-close")
     homepage.click_element("btn-close")
     homepage.wait_for_element('urban-plan-button')
     login_page = LoginPage(self.driver)
     self.driver.get("http://localhost:4200/login")
     login_page.wait_to_load()
     login_page.setCpf(user['cpf'])
     cpf_not_found_page = CpfNotFoundPage(self.driver)
     cpf_not_found_page.wait_to_load()
     sleep(10)
예제 #6
0
 def test_shop_new_client(self):
     car = data.get_vehicle("unregistered_vehicle_1")
     user = data.get_user("new_unregistered_user")
     card = data.get_card("valid_card")
     homepage = HomePage(self.driver)
     homepage.navigate()
     homepage.wait_for_element("btn-close")
     homepage.click_element("btn-close")
     homepage.wait_for_element("urban-plan-button")
     homepage.click_element("urban-plan-button")
     self.profile(user)
     self.address(user["address"])
     self.vehicle(car)
     self.payment(card)
예제 #7
0
 def test_status_delivered(self):
     user = data.get_user("registered_user")
     homepage = HomePage(self.driver)
     homepage.navigate()
     sleep(3)
     homepage.navigate_to_login()
     login_page = LoginPage(self.driver)
     login_page.wait_to_load()
     login_page.logIn(user["cpf"], user["password"])
     orders_page = OrdersPage(self.driver)
     orders_page.wait_to_load()
     orders_page.find_delivered()
     order_details_page = OrderDetailsPage(self.driver)
     order_details_page.check_delivered()
예제 #8
0
 def test_shop_client_no_user(self):
     car = data.get_vehicle("vehicle_legado")
     car2 = data.get_vehicle("unregistered_vehicle_2")
     user = data.get_user("client_with_no_user")
     card = data.get_card("valid_card")
     homepage = HomePage(self.driver)
     homepage.navigate()
     homepage.wait_for_element("btn-close")
     homepage.click_element("btn-close")
     homepage.wait_for_element("urban-plan-button")
     homepage.click_element("urban-plan-button")
     cpf_page = Cpf(self.driver)
     cpf_page.wait_for_element("cpf")
     cpf_page.set_cpf(user["cpf"])
     plaque_page = Plaque(self.driver)
     plaque_page.wait_for_element("plaque")
     plaque_page.set_plaque(car["plaque"])
     plaque_page.click_element("next-button")
     tag_page = TagPage(self.driver)
     tag_page.wait_for_element("adesivo")
     tag_page.set_tag(car["tag"])
     tag_page.click_element("next-button")
     name_page = Name(self.driver)
     name_page.wait_for_element("name")
     name_page.set_name(user["name"])
     name_page.click_element("next-button")
     email_page = Email(self.driver)
     email_page.wait_for_element("email")
     email_page.set_email(user["email"])
     email_page.click_element("next-button")
     phone_page = Phone(self.driver)
     phone_page.wait_for_element("phone")
     phone_page.set_phone(user["phone"])
     phone_page.click_element("next-button")
     birth_page = BirthDate(self.driver)
     birth_page.wait_for_element("date")
     birth_page.set_birthdate(user["birthdate"])
     birth_page.click_element("next-button")
     password_page = Password(self.driver)
     password_page.wait_for_element("password")
     password_page.set_password(user["password"])
     password_page.click_element("next-button")
     self.address(user["address"])
     self.vehicle(car2)
     self.payment(card)
예제 #9
0
 def test_ponto_a_ponto(self):
     user = data.get_user("registered_user")
     homepage = HomePage(self.driver)
     homepage.navigate()
     homepage.wait_for_element("btn-close")
     homepage.click_element("btn-close")
     homepage.wait_for_element('urban-plan-button')
     login_page = LoginPage(self.driver)
     self.driver.get("http://localhost:4200/login")
     login_page.wait_to_load()
     login_page.logIn(user["cpf"], user["password"])
     statement_page = StatementPage(self.driver)
     statement_page.wait_to_load()
     self.driver.get("http://localhost:4200/ponto-a-ponto")
     ponto_a_ponto = PontoAPontoPage(self.driver)
     ponto_a_ponto.wait_to_load()
     ponto_a_ponto.accept()
     ponto_a_ponto.check_acceptance()
예제 #10
0
 def test_login_client_no_user(self):
     car = data.get_vehicle("vehicle_legado")
     car2 = data.get_vehicle("unregistered_vehicle_2")
     user = data.get_user("client_with_no_user")
     card = data.get_card("valid_card")
     homepage = HomePage(self.driver)
     homepage.navigate()
     homepage.wait_for_element("btn-close")
     homepage.click_element("btn-close")
     homepage.wait_for_element('urban-plan-button')
     login_page = LoginPage(self.driver)
     self.driver.get("http://localhost:4200/login")
     login_page.wait_to_load()
     login_page.set_cpf(user["cpf"])
     plaque_page = Plaque(self.driver)
     plaque_page.wait_for_element("plaque")
     plaque_page.set_plaque(car["plaque"])
     plaque_page.click_element("next-button")
     tag_page = TagPage(self.driver)
     tag_page.wait_for_element("adesivo")
     tag_page.set_tag(car["tag"])
     tag_page.click_element("next-button")
     name_page = Name(self.driver)
     name_page.wait_for_element("name")
     name_page.set_name(user["name"])
     name_page.click_element("next-button")
     email_page = Email(self.driver)
     email_page.wait_for_element("email")
     email_page.set_email(user["email"])
     email_page.click_element("next-button")
     phone_page = Phone(self.driver)
     phone_page.wait_for_element("phone")
     phone_page.set_phone(user["phone"])
     phone_page.click_element("next-button")
     birth_page = BirthDate(self.driver)
     birth_page.wait_for_element("date")
     birth_page.set_birthdate(user["birthdate"])
     birth_page.click_element("next-button")
     password_page = Password(self.driver)
     password_page.wait_for_element("password")
     password_page.set_password(user["password"])
     password_page.click_element("next-button")
     statement_page = StatementPage(self.driver)
     statement_page.wait_to_load()
예제 #11
0
 def test_check_order_status(self):
     user = data.get_user("registered_user")
     homepage = HomePage(self.driver)
     homepage.navigate()
     homepage.wait_for_element("btn-close")
     homepage.click_element("btn-close")
     homepage.wait_for_element('urban-plan-button')
     login_page = LoginPage(self.driver)
     self.driver.get("http://localhost:4200/login")
     login_page.wait_to_load()
     login_page.logIn(user["cpf"], user["password"])
     statement_page = StatementPage(self.driver)
     statement_page.wait_to_load()
     self.driver.get("http://localhost:4200/pedidos")
     orders_page = OrdersPage(self.driver)
     orders_page.wait_to_load()
     orders_page.click_order()
     order_details_page = OrderDetailsPage(self.driver)
     order_details_page.wait_to_load()
     order_details_page.check_status()