Exemple #1
0
def test_site_loads():
    with allure.step("Launch site"):
        driver.get("http://google.com/")
        front_end_func.take_screen_shot(driver, "title")
        allure.step("check google title and take screenshots")

        assert ("Google" == driver.title)
Exemple #2
0
def test_login_to_site_fail_username():
    with allure.step("open the website"):
        front_end_func.open_site(website_url, driver)
        front_end_func.send_keys_by_xpath(
            driver, y_parser.yaml_data_parser(login_repo, "username"),
            y_parser.yaml_data_parser(login_repo_data, "username_fails"))

        front_end_func.send_keys_by_xpath(
            driver, y_parser.yaml_data_parser(login_repo, "password"),
            y_parser.yaml_data_parser(login_repo_data, "password_fails"))

        front_end_func.take_screen_shot(driver, "Login")

        front_end_func.click_element_by_xpath(
            driver, y_parser.yaml_data_parser(login_repo, "submit_button"))

        allure.attach('here you`ll see the actual title :' + driver.title,
                      'title assert', allure.attachment_type.TEXT)
        front_end_func.check_site_title(
            driver, y_parser.yaml_data_parser(login_repo_data, "title"))

        front_end_func.wait_for_element_by_xpath(
            driver,
            y_parser.yaml_data_parser(dashboard_repo_data,
                                      "add_entities_button"))
Exemple #3
0
def test_search_in_python_org():
    with allure.step("open the website"):
        front_end_func.open_site(website_url, driver)
        front_end_func.send_keys_by_xpath(
            driver, y_parser.yaml_data_parser(login_repo, "username"),
            y_parser.yaml_data_parser(login_repo_data, "username"))

        elem = driver.find_element_by_name("q")
        elem.send_keys("Elad Or")
        elem.send_keys(Keys.RETURN)
        front_end_func.take_screen_shot(driver, "Elad Or")
        assert "No results found." not in driver.page_source