'Test "Run Code" button functionality.'

@flaky
def test_run_code(self):

    self.submission = ('a=1' + self.unique_id[0:5])
    self.xqueue_grade_response = {'msg': self.submission}
    matlab_problem_page = self._goto_matlab_problem_page()
    if (self.xqueue_grade_response is not None):
        XQueueResponseFixture(self.submission, self.xqueue_grade_response).install()
    matlab_problem_page.set_response(self.submission)
    matlab_problem_page.click_run_code()
    self.assertEqual(u'Submitted.    As    soon    as    a    response    is    returned,    this    message    will    be    replaced    by    that    feedback.', matlab_problem_page.get_grader_msg('.external-grader-message')[0])
    time.sleep(5)
    self.assertEqual(u'', matlab_problem_page.get_grader_msg('.external-grader-message')[0])
    self.assertEqual(self.xqueue_grade_response.get('msg'), matlab_problem_page.get_grader_msg('.ungraded-matlab-result')[0])
