canvas-lms/spec/selenium/equation_spec.rb

48 lines
1.5 KiB
Ruby
Raw Normal View History

require File.expand_path(File.dirname(__FILE__) + '/helpers/quizzes_common')
describe "equation editor" do
it_should_behave_like "quizzes selenium tests"
it "should support multiple equation editors on the same page" do
pending("193")
course_with_teacher_logged_in
get "/courses/#{@course.id}/quizzes"
f('.new-quiz-link').click
def save_question_and_wait
submit_form('.question_form')
wait_for_ajaximations
end
wait_for_tiny(f("#quiz_description"))
AMD Conversion "Trivial" JavaScript / CoffeeScript changes -------------------------------------------------- For the most part, all javascript was simply wrapped in `require` or `define`. The dependencies were found with a script that matched regexes in the files, it errs on the side of listing too many dependencies, so its worth double checking each file's dependencies (over time, anyway). i18n API changes -------------------------------------------------- No longer have to do I18n.scoped calls, just list i18n as a dependency with the scope and it's imported already scoped require ['i18n!some_scope'], (I18n) -> I18n.t 'im_scoped', 'I'm scoped!' JS bundling now done with r.js, not Jammit -------------------------------------------------- We don't use jammit to bundle JS anymore. Simply list dependencies for your JS modules in the file and RequireJS handles the rest. To optimize the JavaScript, first make sure you have node.js 0.4.12+ installed and then run: $ rake js:build The app defaults to the optimized build in production. You can use non-optimized in production by putting ?debug_assets=true in the url just like before. You can also test the optimized JavaScript in development with ?optimized_js=true. Significant changes -------------------------------------------------- These files have "real" changes to them (unlike the JavaScript that is simply wrapped in require and define). Worth taking a really close look at: - app/helpers/application_helper.rb - app/views/layouts/application.html.erb - config/assets.yml - config/build.js - lib/handlebars/handlebars.rb - lib/i18n_extraction/js_extractor.rb - lib/tasks/canvas.rake - lib/tasks/i18n.rake - lib/tasks/js.rake Change-Id: I4bc5ecb1231f331aaded0fef2bcc1f3a9fe482a7 Reviewed-on: https://gerrit.instructure.com/6986 Tested-by: Hudson <hudson@instructure.com> Reviewed-by: Ryan Florence <ryanf@instructure.com>
2011-11-11 00:31:45 +08:00
2.times do |time|
click_questions_tab
click_new_question_button
questions = ffj(".question_holder:visible")
questions.length.should == time + 1
question = questions[time]
wait_for_tiny(question.find_element(:css, 'textarea.question_content'))
equation_editor = keep_trying_until do
question.find_element(:css, '.mce_instructure_equation').click
sleep 1
equation_editor = fj(".mathquill-editor:visible")
equation_editor.should_not be_nil
equation_editor
end
f('.ui-dialog-buttonset .btn-primary').click
question.find_element(:css, '.toggle_question_content_views_link').click
question.find_element(:css, 'textarea.question_content').attribute(:value).should include('<img class="equation_image" title="" src="/equation_images/" alt="" />')
save_question_and_wait
question.find_elements(:css, 'img.equation_image').size.should == 1
click_settings_tab
f(".points_possible").text.should == (time + 1).to_s
end
end
end