def test_status_removed_after_save_before_submit(self): """ Scenario: User should see the status removed when saving after submitting an answer and reloading the page. Given that I have loaded the problem page And a choice has been selected and submitted When I change the choice And Save the problem And reload the problem page Then I should see the save notification and I should not see any indication of problem status """ self.courseware_page.visit() problem_page = ProblemPage(self.browser) problem_page.click_choice("choice_1") problem_page.click_submit() problem_page.wait_incorrect_notification() problem_page.wait_for_expected_status('label.choicegroup_incorrect', 'incorrect') problem_page.click_choice("choice_2") self.assertFalse( problem_page.is_expected_status_visible( 'label.choicegroup_incorrect')) problem_page.click_save() problem_page.wait_for_save_notification() # Refresh the page and the status should not be added self.courseware_page.visit() self.assertFalse( problem_page.is_expected_status_visible( 'label.choicegroup_incorrect')) self.assertTrue(problem_page.is_save_notification_visible())
def test_status_removed_after_save_before_submit(self): """ Scenario: User should see the status removed when saving after submitting an answer and reloading the page. Given that I have loaded the problem page And a choice has been selected and submitted When I change the choice And Save the problem And reload the problem page Then I should see the save notification and I should not see any indication of problem status """ self.courseware_page.visit() problem_page = ProblemPage(self.browser) problem_page.click_choice("choice_1") problem_page.click_submit() problem_page.wait_incorrect_notification() problem_page.wait_for_expected_status('label.choicegroup_incorrect', 'incorrect') problem_page.click_choice("choice_2") self.assertFalse(problem_page.is_expected_status_visible('label.choicegroup_incorrect')) problem_page.click_save() problem_page.wait_for_save_notification() # Refresh the page and the status should not be added self.courseware_page.visit() self.assertFalse(problem_page.is_expected_status_visible('label.choicegroup_incorrect')) self.assertTrue(problem_page.is_save_notification_visible())