def test_that_questions_problem_count_increments(self, mozwebqa): """Checks if the 'I have this problem too' counter increments""" questions_pg = QuestionsPage(mozwebqa) view_question_pg = ViewQuestionPage(mozwebqa) # Can't +1 your own question so will do it logged out questions_pg.go_to_forum_questions_page() questions_pg.click_any_question(1) initial_count = view_question_pg.problem_count view_question_pg.click_problem_too_button() view_question_pg.refresh() post_click_count = view_question_pg.problem_count Assert.equal(initial_count + 1, post_click_count)
def test_that_questions_sorts_correctly_by_filter_equal_to_solved(self, mozwebqa): """ Goes to the /questions page, Verifies the sort filter=solved works """ questions_pg = QuestionsPage(mozwebqa) expected_sorted_text = "Solved" questions_pg.go_to_forum_questions_page() questions_pg.click_sort_by_solved_questions() # if there are no questions in the list then skip the test if not questions_pg.are_questions_present(): pytest.skip("No questions present for filter=%s" % expected_sorted_text) num_of_questions = questions_pg.get_questions_count for counter in range(num_of_questions): actual_sorted_text = questions_pg.get_sorted_list_filter_text(counter + 1) Assert.equal(actual_sorted_text, expected_sorted_text)