예제 #1
0
 def test_form_submission(self, get_data):
     log = self.getLogger()
     homepage = HomePage(self.driver)
     homepage.get_passowrd().send_keys(get_data['password'])
     log.info("Password entered ")
     homepage.get_name().send_keys(get_data['name'])
     homepage.get_checkbox().click()
     homepage.get_email().send_keys(get_data['email'])
     log.info("Email entered")
     homepage.get_button().click()
     log.info("Final button clicked")
     message = homepage.get_success().text
     assert "Succ" in message
     self.driver.refresh()
예제 #2
0
    def test_form_submission(
        self, get_test_data
    ):  # get test data si takto v podobě parametru funkce zavoláme z fixtury

        log = self.get_logger()
        home_page = HomePage(self.driver)
        self.driver.maximize_window()
        log.info(f"first name: {get_test_data['firstname']}")
        home_page.get_name().send_keys(get_test_data['firstname'])
        log.info(f"first name: {get_test_data['email']}")
        home_page.get_email().send_keys(get_test_data['email'])
        home_page.get_ice_cream_check().click()
        self.select_combobox_value(home_page.get_gender_select(),
                                   get_test_data['gender'])
        home_page.get_submit_button().click()
        # self.verify_link_presence(By.CSS_SELECTOR, "[class*='alert-success']")
        alert_text = home_page.get_alert_success_paragraph().text

        assert ("Success" in alert_text)

        self.driver.refresh()