Exemple #1
0
def create_new_comment(driver):
    dashboard = DashboardPage(driver)
    input_text = dashboard.random_string_gen(1, 300)
    all_existing_statuses = dashboard.all_statuses_elements
    dashboard.create_new_status(input_text)
    dashboard.wait_until_new_status_appears(all_existing_statuses)
    yield
    dashboard.delete_status()
    sleep(1)
def test_delete_status(driver, user_log_in_log_out):
    # Create status, instantly delete it
    dashboard = DashboardPage(driver)
    input_text = dashboard.random_string_gen(1, 300)
    all_existing_statuses = dashboard.all_statuses_elements
    dashboard.create_new_status(input_text)
    dashboard.wait_until_new_status_appears(all_existing_statuses)
    dashboard.delete_status()
    all_statuses_after_delete = dashboard.wait_until_status_deletes(all_existing_statuses)
    assert len(all_statuses_after_delete) == len(all_existing_statuses)
def test_create_short_status(driver, user_log_in_log_out, status_text_parametrize):
    # Create short status, verify it presence
    dashboard = DashboardPage(driver)
    input_text = status_text_parametrize
    all_existing_statuses = dashboard.all_statuses_elements
    dashboard.create_new_status(input_text)
    dashboard.wait_until_new_status_appears(all_existing_statuses)
    new_status_in_newsfeed = dashboard.all_statuses_elements[0]
    assert new_status_in_newsfeed.text == input_text
    assert new_status_in_newsfeed.user.username == user_log_in_log_out.username
def test_create_long_status(driver, user_log_in_log_out):
    # Create long status, verify it presence
    dashboard = DashboardPage(driver)
    input_text = dashboard.random_string_gen(500, 800)
    all_existing_statuses = dashboard.all_statuses_elements
    dashboard.create_new_status(input_text)
    dashboard.wait_until_new_status_appears(all_existing_statuses)
    dashboard.see_more_button_click()
    new_status_in_newsfeed = dashboard.all_statuses_elements[0]
    assert new_status_in_newsfeed.text == input_text
    assert new_status_in_newsfeed.user.username == user_log_in_log_out.username
Exemple #5
0
def create_status(text, driver):
    dashboard = DashboardPage(driver)
    dashboard.create_new_status(text)
Exemple #6
0
def status_create(driver):
    dashboard = DashboardPage(driver)
    input_text = dashboard.random_string_gen(1, 300)
    all_existing_statuses = dashboard.all_statuses_elements
    dashboard.create_new_status(input_text)
    dashboard.wait_until_new_status_appears(all_existing_statuses)