2013-01-23 00:46:56 +08:00
|
|
|
require File.expand_path(File.dirname(__FILE__) + '/helpers/quizzes_common')
|
2011-05-21 06:09:24 +08:00
|
|
|
|
2012-01-20 04:07:53 +08:00
|
|
|
describe "equation editor" do
|
2013-04-09 04:49:29 +08:00
|
|
|
it_should_behave_like "quizzes selenium tests"
|
2011-12-09 00:13:15 +08:00
|
|
|
|
2011-05-21 06:09:24 +08:00
|
|
|
it "should support multiple equation editors on the same page" do
|
2013-05-01 15:40:13 +08:00
|
|
|
pending("193")
|
2011-06-07 00:44:27 +08:00
|
|
|
course_with_teacher_logged_in
|
2011-12-09 00:13:15 +08:00
|
|
|
|
2011-06-07 00:44:27 +08:00
|
|
|
get "/courses/#{@course.id}/quizzes"
|
2012-08-30 01:44:23 +08:00
|
|
|
f('.new-quiz-link').click
|
2011-05-21 06:09:24 +08:00
|
|
|
|
2012-06-05 05:36:42 +08:00
|
|
|
def save_question_and_wait
|
|
|
|
submit_form('.question_form')
|
2011-08-11 23:13:00 +08:00
|
|
|
wait_for_ajaximations
|
2011-05-21 06:09:24 +08:00
|
|
|
end
|
2012-08-30 01:44:23 +08:00
|
|
|
wait_for_tiny(f("#quiz_description"))
|
2011-11-11 00:31:45 +08:00
|
|
|
|
2011-05-21 06:09:24 +08:00
|
|
|
2.times do |time|
|
2013-01-23 00:46:56 +08:00
|
|
|
click_questions_tab
|
|
|
|
click_new_question_button
|
2011-12-09 00:13:15 +08:00
|
|
|
|
2012-08-30 01:44:23 +08:00
|
|
|
questions = ffj(".question_holder:visible")
|
2012-09-22 02:08:01 +08:00
|
|
|
questions.length.should == time + 1
|
2011-05-21 06:09:24 +08:00
|
|
|
question = questions[time]
|
2011-12-09 00:13:15 +08:00
|
|
|
|
2011-05-21 06:09:24 +08:00
|
|
|
wait_for_tiny(question.find_element(:css, 'textarea.question_content'))
|
2011-12-09 00:13:15 +08:00
|
|
|
|
2011-12-13 02:59:41 +08:00
|
|
|
equation_editor = keep_trying_until do
|
|
|
|
question.find_element(:css, '.mce_instructure_equation').click
|
|
|
|
sleep 1
|
2012-10-19 07:31:12 +08:00
|
|
|
equation_editor = fj(".mathquill-editor:visible")
|
2011-12-13 02:59:41 +08:00
|
|
|
equation_editor.should_not be_nil
|
|
|
|
equation_editor
|
|
|
|
end
|
2012-10-19 07:31:12 +08:00
|
|
|
f('.ui-dialog-buttonset .btn-primary').click
|
2011-08-11 23:13:00 +08:00
|
|
|
question.find_element(:css, '.toggle_question_content_views_link').click
|
2012-08-16 22:47:53 +08:00
|
|
|
question.find_element(:css, 'textarea.question_content').attribute(:value).should include('<img class="equation_image" title="" src="/equation_images/" alt="" />')
|
2012-06-05 05:36:42 +08:00
|
|
|
save_question_and_wait
|
2011-05-21 06:09:24 +08:00
|
|
|
|
|
|
|
question.find_elements(:css, 'img.equation_image').size.should == 1
|
2013-01-23 00:46:56 +08:00
|
|
|
|
|
|
|
click_settings_tab
|
|
|
|
f(".points_possible").text.should == (time + 1).to_s
|
2011-05-21 06:09:24 +08:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|