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 amount_of_statuses_after_delete(driver, initial_statuses): dashboard = DashboardPage(driver) dashboard.delete_status() all_statuses_after_delete = dashboard.wait_until_status_deletes(initial_statuses) assert len(all_statuses_after_delete) == len(initial_statuses)