def test_create_movie(app):
    app.go_to_home_page()
    app.login(User.Admin())
    app.create_movie(Movie.required_field('The Terminal', '2004'))
    expected_text = "The Terminal (2004)"
    assert app.is_movie_created() == expected_text, "Title is not equal"
    app.logout()
def test_movie_not_creatable_without_required_field(app):
    app.go_to_home_page()
    app.login(User.Admin())
    is_url_changed = app.create_movie_without_req_field(Movie('Terminator'))
    assert is_url_changed, 'URLs are not matched'
    assert app.is_not_movie_created(), 'Text is not equal'
    app.logout()
예제 #3
0
def test_search_mov(app):
    app.go_to_home_page()
    app.login(User.Admin())
    app.clear_search()
    text_to_search = 'mov'
    app.enter_text_to_search(text_to_search)
    number_of_movies_found = app.number_of_movies()
    print "Number of movies found: ", number_of_movies_found
    app.logout()
예제 #4
0
def test_add_mov_1(app):
    app.go_to_home_page()
    app.login(User.Admin())
    app.clear_search()
    number_of_movies_before = app.number_of_movies()
    """ This movie will be added with success """
    app.add_movie(Movie.Movie_first())
    app.go_to_home_page()
    number_of_movies_after = app.number_of_movies()
    app.print_result_of_adding(number_of_movies_before, number_of_movies_after)
    app.logout()
예제 #5
0
def test_add_mov_2(app):
    app.go_to_home_page()
    app.login(User.Admin())
    app.clear_search()
    number_of_movies_before = app.number_of_movies()
    """ This movie will fail to be added, as Year is blank """
    app.add_movie(Movie.Movie_second())
    app.go_to_home_page()
    number_of_movies_after = app.number_of_movies()
    app.print_result_of_adding(number_of_movies_before, number_of_movies_after)
    app.logout()
예제 #6
0
def test_remove_mov(app):
    app.go_to_home_page()
    app.login(User.Admin())
    app.clear_search()
    number_of_movies_before = app.number_of_movies()
    movie_to_remove = Movie.Movie_second()
    movie_name = app.get_movie_name(movie_to_remove)
    """ If found, then delete the first one """
    if app.number_of_movies_found(movie_to_remove) > 0:
        app.remove_first_by_name(movie_to_remove)
    else:
        print "\nThere is no movie with specified title: ", movie_name
    number_of_movies_after = app.number_of_movies()
    app.print_result_of_removing(number_of_movies_before, number_of_movies_after, movie_name)
    app.logout()
예제 #7
0
def test_search_bmw(app):
    app.go_to_home_page()
    search_options = {"price_from":"1000", "price_to":"100000", "mark": "BMW", "model":"525",
                      "region":"Киев", "year":"1990", "year_to":"2010"}
    search_options_list = []
    from_to_price = "от %s до %s $" % (search_options["price_from"], search_options["price_to"])
    search_options_list.append(from_to_price)
    mark = "%s" % search_options["mark"]
    search_options_list.append(mark)
    model = "%s" % search_options["model"]
    search_options_list.append(model)
    from_to_year = "Год от %s до %s" % (search_options["year"], search_options["year_to"])
    search_options_list.append(from_to_year)
    search_options_list.append("Киевская")
    search_options_list.append("Только с фото")
    app.fill_fields_to_search(search_options)
    app.click_search_button()
    assert app.check_text_on_search_form() == search_options_list
    assert app.count() == 10
    assert app.result_equals_search_options(mark, model)
    if app.count() == 10:
        print("Количество объявлений равно 10")
        app.go_to_home_page()
    else:
        print("Количество объявлений не равно 10")
        app.go_to_home_page()
예제 #8
0
def test_login_with_invalid_data(app):
    app.go_to_home_page()
    app.login(User.random_data())
    assert app.is_not_logged_in()
예제 #9
0
def test_auto(app):
    app.go_to_home_page()
    app.login(User.Admin())
    app.logout()
예제 #10
0
def test_login_with_invalid_credentials(app):
    app.go_to_home_page()
    app.login(User.random())
    assert app.is_not_logged_in()
예제 #11
0
def test_login_with_valid_credentials(app):
    app.go_to_home_page()
    app.login(User.Admin())
    assert app.is_logged_in()
    app.logout()
    assert app.is__not_logged_in()
def test_rozetka(app):
    app.go_to_home_page()
    app.search_product("Samsung Galaxy S6 SS 32GB G920 Black")
    app.driver.find_element_by_link_text("Samsung Galaxy S6 SS 32GB G920 Black").click()
예제 #13
0
def test_login_with_valid_data(app):
    app.go_to_home_page()
    app.login(User.admin())
    assert app.is_logged_in()
    app.logout()
    assert app.is_not_logged_in()
예제 #14
0
def test_search_film_negative(app):
    app.go_to_home_page()
    app.login(User.admin())
    app.search_film_negative(Film.value_search_negative())
    app.logout()
예제 #15
0
def test_delete_film(app):
    app.go_to_home_page()
    app.login(User.admin())
    app.delete_film()
    app.logout()
예제 #16
0
def test_creating_film_negative(app):
    app.go_to_home_page()
    app.login(User.admin())
    app.creating_film_negative(Film.value_negative())
    app.logout()
예제 #17
0
def test_login(app):
    app.go_to_home_page()
    app.login(User.Admin())
def test_login_with_invalid_credential(app):
    app.go_to_home_page()
    app.login(User.random())
    assert app.is_not_logged_in()
def test_login_with_valid_credentials(app):
    app.go_to_home_page()
    app.login(User.Admin())
    assert app.is_logged_in()
    app.logout()
    assert app.is_not_logged_in()