'Scenario: Selecting course from Pre-Requisite course drop down save the selected course as pre-requisite
course.
Given that I am on the Schedule & Details page on studio
When I select an item in pre-requisite course drop down and click Save Changes button
Then My selected item should be saved as pre-requisite course
And My selected item should be selected after refreshing the page.\''

@skip('Too    flaky    for    the    flaky    decorator        SOL-1811')
def test_prerequisite_course_save_successfully(self):

    course_number = self.unique_id
    CourseFixture(org='test_org', number=course_number, run='test_run', display_name=('Test    Course' + course_number)).install()
    pre_requisite_course_key = generate_course_key(org='test_org', number=course_number, run='test_run')
    pre_requisite_course_id = unicode(pre_requisite_course_key)
    self.settings_detail.refresh_page()
    self.settings_detail.wait_for_prerequisite_course_options()
    select_option_by_value(browser_query=self.settings_detail.pre_requisite_course_options, value=pre_requisite_course_id)
    self.settings_detail.save_changes()
    self.assertEqual('Your    changes    have    been    saved.', self.settings_detail.alert_confirmation_title.text)
    self.settings_detail.refresh_page()
    self.settings_detail.wait_for_prerequisite_course_options()
    self.assertTrue(is_option_value_selected(browser_query=self.settings_detail.pre_requisite_course_options, value=pre_requisite_course_id))
    select_option_by_value(browser_query=self.settings_detail.pre_requisite_course_options, value='')
    self.settings_detail.save_changes()
    self.assertEqual('Your    changes    have    been    saved.', self.settings_detail.alert_confirmation_title.text)
    self.settings_detail.refresh_page()
    self.settings_detail.wait_for_prerequisite_course_options()
    self.assertTrue(is_option_value_selected(browser_query=self.settings_detail.pre_requisite_course_options, value=''))
    select_option_by_value(browser_query=self.settings_detail.pre_requisite_course_options, value=pre_requisite_course_id)
    self.settings_detail.save_changes()
    self.assertEqual('Your    changes    have    been    saved.', self.settings_detail.alert_confirmation_title.text)
    self.settings_detail.refresh_page()
    self.settings_detail.wait_for_prerequisite_course_options()
    dropdown_status = is_option_value_selected(browser_query=self.settings_detail.pre_requisite_course_options, value=pre_requisite_course_id)
    self.assertTrue(dropdown_status)
