spec: reruns with ruby sel driver
Change-Id: I22d984a03b48f0bec21fb1d182c3c8877f2d6be1 Reviewed-on: https://gerrit.instructure.com/26438 Tested-by: Jenkins <jenkins@instructure.com> Reviewed-by: Bryan Madsen <bryan@instructure.com> Product-Review: Bryan Madsen <bryan@instructure.com> QA-Review: Bryan Madsen <bryan@instructure.com>
This commit is contained in:
parent
a1151b2ef2
commit
b0face8c19
2
Gemfile
2
Gemfile
|
@ -131,7 +131,7 @@ group :test do
|
|||
gem 'simplecov', '0.7.1' if ENV['COVERAGE'] != nil && ENV['COVERAGE'] == "1" # for coverage reporting
|
||||
gem 'bluecloth', '2.0.10' # for generating api docs
|
||||
gem 'mocha', :git => 'git://github.com/ccutrer/mocha.git', :require => false
|
||||
gem 'parallelized_specs', '0.4.64'
|
||||
gem 'parallelized_specs', '0.4.75'
|
||||
gem 'thin', '1.5.1'
|
||||
if CANVAS_RAILS2
|
||||
gem 'rspec', '1.3.2'
|
||||
|
|
|
@ -68,9 +68,9 @@ def test_selective_content(source_course=nil)
|
|||
|
||||
if source_course
|
||||
topic_id = CC::CCHelper.create_key(source_course.discussion_topics.find_by_migration_id(topic_id))
|
||||
att_ids = att_ids.map{|id| CC::CCHelper.create_key(source_course.attachments.find_by_migration_id(id))}
|
||||
selected_att_ids = selected_att_ids.map{|id| CC::CCHelper.create_key(source_course.attachments.find_by_migration_id(id))}
|
||||
tool_ids = tool_ids.map{|id| CC::CCHelper.create_key(source_course.context_external_tools.find_by_migration_id(id))}
|
||||
att_ids = att_ids.map { |id| CC::CCHelper.create_key(source_course.attachments.find_by_migration_id(id)) }
|
||||
selected_att_ids = selected_att_ids.map { |id| CC::CCHelper.create_key(source_course.attachments.find_by_migration_id(id)) }
|
||||
tool_ids = tool_ids.map { |id| CC::CCHelper.create_key(source_course.context_external_tools.find_by_migration_id(id)) }
|
||||
folder_name = source_course.folders.find_by_name(folder_name).full_name
|
||||
end
|
||||
|
||||
|
@ -83,7 +83,7 @@ def test_selective_content(source_course=nil)
|
|||
["copy[discussion_topics][id_#{topic_id}]", false], # deselect
|
||||
["copy[all_attachments]", false]
|
||||
]
|
||||
boxes_to_click += att_ids.map{|id| ["copy[attachments][id_#{id}]", true]}
|
||||
boxes_to_click += att_ids.map { |id| ["copy[attachments][id_#{id}]", true] }
|
||||
|
||||
# directly click checkboxes
|
||||
boxes_to_click.each do |name, value|
|
||||
|
@ -115,7 +115,7 @@ def test_selective_content(source_course=nil)
|
|||
"context_external_tools" => {tool_ids[0] => "1", tool_ids[1] => "1"},
|
||||
"attachments" => {}
|
||||
}
|
||||
selected_att_ids.each{|id| expected_params["attachments"][id] = "1"}
|
||||
selected_att_ids.each { |id| expected_params["attachments"][id] = "1" }
|
||||
if source_course
|
||||
expected_params.merge!({"all_course_settings" => "1", "all_syllabus_body" => "1", "all_assessment_question_banks" => "1"})
|
||||
end
|
||||
|
@ -158,14 +158,14 @@ describe "content migrations" do
|
|||
it "should show each form" do
|
||||
visit_page
|
||||
|
||||
migration_types = ff('#chooseMigrationConverter option').map{|op| op['value']} - ['none']
|
||||
migration_types = ff('#chooseMigrationConverter option').map { |op| op['value'] } - ['none']
|
||||
migration_types.each do |type|
|
||||
select_migration_type(type)
|
||||
wait_for_ajaximations
|
||||
ff("input[type=\"submit\"]").any?{|el| el.displayed?}.should == true
|
||||
ff("input[type=\"submit\"]").any? { |el| el.displayed? }.should == true
|
||||
|
||||
select_migration_type('none')
|
||||
ff("input[type=\"submit\"]").any?{|el| el.displayed?}.should == false
|
||||
ff("input[type=\"submit\"]").any? { |el| el.displayed? }.should == false
|
||||
end
|
||||
|
||||
select_migration_type
|
||||
|
@ -200,10 +200,10 @@ describe "content migrations" do
|
|||
source_links << item.find_element(:css, '.sourceLink a')
|
||||
end
|
||||
|
||||
hrefs = source_links.map{|a| a.attribute(:href)}
|
||||
hrefs = source_links.map { |a| a.attribute(:href) }
|
||||
|
||||
@course.content_migrations.each do |cm|
|
||||
hrefs.find{|href| href.include?("/files/#{cm.attachment.id}/download")}.should_not be_nil
|
||||
hrefs.find { |href| href.include?("/files/#{cm.attachment.id}/download") }.should_not be_nil
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -214,8 +214,10 @@ describe "content migrations" do
|
|||
submit
|
||||
run_migration
|
||||
|
||||
visit_page
|
||||
f('.migrationProgressItem .progressStatus').should include_text("Completed")
|
||||
keep_trying_until do
|
||||
visit_page
|
||||
f('.migrationProgressItem .progressStatus').should include_text("Completed")
|
||||
end
|
||||
|
||||
# From spec/lib/cc/importer/common_cartridge_converter_spec.rb
|
||||
@course.attachments.count.should == 10
|
||||
|
@ -334,7 +336,7 @@ describe "content migrations" do
|
|||
|
||||
cm = ContentMigration.new(:context => @copy_from, :migration_type => "common_cartridge_importer")
|
||||
cm.migration_settings = {:import_immediately => true,
|
||||
:migration_ids_to_import => {:copy => {:everything => true}}}
|
||||
:migration_ids_to_import => {:copy => {:everything => true}}}
|
||||
cm.skip_job_progress = true
|
||||
cm.save!
|
||||
|
||||
|
@ -503,8 +505,8 @@ describe "content migrations" do
|
|||
opts = @course.content_migrations.last.migration_settings["date_shift_options"]
|
||||
opts["day_substitutions"].should == {"1" => "2", "2" => "3"}
|
||||
expected = {
|
||||
"old_start_date" => "Jul 1, 2012", "old_end_date" => "Jul 11, 2012",
|
||||
"new_start_date" => "Aug 5, 2012", "new_end_date" => "Aug 15, 2012"
|
||||
"old_start_date" => "Jul 1, 2012", "old_end_date" => "Jul 11, 2012",
|
||||
"new_start_date" => "Aug 5, 2012", "new_end_date" => "Aug 15, 2012"
|
||||
}
|
||||
expected.each do |k, v|
|
||||
Date.parse(opts[k].to_s).should == Date.parse(v)
|
||||
|
|
|
@ -34,11 +34,11 @@ describe "course people" do
|
|||
wait_for_ajaximations
|
||||
|
||||
keep_trying_until { driver.execute_script("return $('##{input_id}').data('token_input').selector.list.query.search") == text }
|
||||
wait_for_js
|
||||
wait_for_ajaximations
|
||||
elements = ffj(".autocomplete_menu:visible .list:last ul:last li").map { |e|
|
||||
[e, (e.find_element(:tag_name, :b).text rescue e.text)]
|
||||
}
|
||||
wait_for_js
|
||||
wait_for_ajaximations
|
||||
element = elements.detect { |e| e.last == text }
|
||||
element.should_not be_nil
|
||||
element.first.click
|
||||
|
|
Loading…
Reference in New Issue