Skip to content

Commit

Permalink
spec: organize selenium spec files better
Browse files Browse the repository at this point in the history
Change-Id: Id1825b4effdc4865963e8fbf3faaeca81553acd6
Reviewed-on: https://gerrit.instructure.com/11257
Reviewed-by: Bryan Madsen <[email protected]>
Tested-by: Jenkins <[email protected]>
  • Loading branch information
Jake Sorce committed Jun 5, 2012
1 parent 3d4db97 commit 31f3cc0
Show file tree
Hide file tree
Showing 49 changed files with 46 additions and 46 deletions.
2 changes: 1 addition & 1 deletion lib/tasks/parallelized.rake
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ unless ARGV.any? { |a| a =~ /\Agems/ }
task :selenium, :count do |t, args|
require "parallelized_specs"
count = args[:count]
test_files = FileList['spec/selenium/*_spec.rb'] + FileList['vendor/plugins/*/spec_canvas/selenium/*_spec.rb']
test_files = FileList['spec/selenium/**/*_spec.rb'] + FileList['vendor/plugins/*/spec_canvas/selenium/*_spec.rb']
test_files.map! { |f| "#{Rails.root}/#{f}" }
Rake::Task['parallel:spec'].invoke(count, '', '', test_files.join(' '))
end
Expand Down
2 changes: 1 addition & 1 deletion lib/tasks/rspec.rake
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ unless ARGV.any? { |a| a =~ /\Agems/ }
if ENV['SINGLE_TEST']
t.spec_opts += ['-e', %{"#{ENV['SINGLE_TEST']}"}]
end
spec_files = FileList['vendor/plugins/*/spec_canvas/**/*_spec.rb'].exclude('vendor/plugins/*/spec_canvas/selenium/*_spec.rb') + FileList['spec/**/*_spec.rb'].exclude('spec/selenium/*_spec.rb')
spec_files = FileList['vendor/plugins/*/spec_canvas/**/*_spec.rb'].exclude('vendor/plugins/*/spec_canvas/selenium/*_spec.rb') + FileList['spec/**/*_spec.rb'].exclude('spec/selenium/**/*_spec.rb')
Gem.loaded_specs.values.each do |spec|
path = spec.full_gem_path
spec_canvas_path = File.expand_path(path+"/spec_canvas")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require File.expand_path(File.dirname(__FILE__) + '/common')
require File.expand_path(File.dirname(__FILE__) + '/../common')

describe "admin avatars" do
it_should_behave_like "in-process server selenium tests"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require File.expand_path(File.dirname(__FILE__) + '/common')
require File.expand_path(File.dirname(__FILE__) + '/../common')

describe "admin courses tab" do
it_should_behave_like "in-process server selenium tests"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require File.expand_path(File.dirname(__FILE__) + '/common')
require File.expand_path(File.dirname(__FILE__) + '/manage_groups_common')
require File.expand_path(File.dirname(__FILE__) + '/../common')
require File.expand_path(File.dirname(__FILE__) + '/../helpers/manage_groups_common')
require 'thread'

describe "manage admin groups" do
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require File.expand_path(File.dirname(__FILE__) + '/common')
require File.expand_path(File.dirname(__FILE__) + '/../common')

describe "admin permissions" do
it_should_behave_like "in-process server selenium tests"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require File.expand_path(File.dirname(__FILE__) + '/common')
require File.expand_path(File.dirname(__FILE__) + '/external_tools_common')
require File.expand_path(File.dirname(__FILE__) + '/../common')
require File.expand_path(File.dirname(__FILE__) + '/../helpers/external_tools_common')

describe "admin question bank" do
it_should_behave_like "in-process server selenium tests"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require File.expand_path(File.dirname(__FILE__) + '/common')
require File.expand_path(File.dirname(__FILE__) + '/../common')

describe "admin question banks" do
it_should_behave_like "in-process server selenium tests"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require File.expand_path(File.dirname(__FILE__) + '/common')
require File.expand_path(File.dirname(__FILE__) + '/external_tools_common')
require File.expand_path(File.dirname(__FILE__) + '/../common')
require File.expand_path(File.dirname(__FILE__) + '/../helpers/external_tools_common')

describe "admin settings tabs" do
it_should_behave_like "external tools tests"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require File.expand_path(File.dirname(__FILE__) + '/common')
require File.expand_path(File.dirname(__FILE__) + '/../common')

describe "admin settings tab" do
it_should_behave_like "in-process server selenium tests"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require File.expand_path(File.dirname(__FILE__) + '/common')
require File.expand_path(File.dirname(__FILE__) + '/../common')

describe "admin courses tab" do
it_should_behave_like "in-process server selenium tests"
Expand Down
2 changes: 1 addition & 1 deletion spec/selenium/calendar2_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require File.expand_path(File.dirname(__FILE__) + '/common')
require File.expand_path(File.dirname(__FILE__) + '/calendar2_common')
require File.expand_path(File.dirname(__FILE__) + '/helpers/calendar2_common')

describe "calendar2" do
it_should_behave_like "calendar2 selenium tests"
Expand Down
4 changes: 2 additions & 2 deletions spec/selenium/common.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
require "socket"
require "timeout"
require 'coffee-script'
require File.expand_path(File.dirname(__FILE__) + '/custom_selenium_rspec_matchers')
require File.expand_path(File.dirname(__FILE__) + '/helpers/custom_selenium_rspec_matchers')
require File.expand_path(File.dirname(__FILE__) + '/server')
include I18nUtilities

Expand Down Expand Up @@ -760,7 +760,7 @@ def assert_flash_error_message(fail_message_regex)
# will only load it once even if its called multiple times
def load_simulate_js
@load_simulate_js ||= begin
js = File.read('spec/selenium/jquery.simulate.js')
js = File.read('spec/selenium/helpers/jquery.simulate.js')
driver.execute_script js
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/selenium/conversations_attachments_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require File.expand_path(File.dirname(__FILE__) + '/common')
require File.expand_path(File.dirname(__FILE__) + '/conversations_common')
require File.expand_path(File.dirname(__FILE__) + '/helpers/conversations_common')

shared_examples_for "conversations attachments selenium tests" do
it_should_behave_like "forked server selenium tests"
Expand Down
2 changes: 1 addition & 1 deletion spec/selenium/conversations_context_filtering_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require File.expand_path(File.dirname(__FILE__) + '/common')
require File.expand_path(File.dirname(__FILE__) + '/conversations_common')
require File.expand_path(File.dirname(__FILE__) + '/helpers/conversations_common')

describe "conversations context filtering" do
it_should_behave_like "in-process server selenium tests"
Expand Down
2 changes: 1 addition & 1 deletion spec/selenium/conversations_group_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require File.expand_path(File.dirname(__FILE__) + '/common')
require File.expand_path(File.dirname(__FILE__) + '/conversations_common')
require File.expand_path(File.dirname(__FILE__) + '/helpers/conversations_common')

describe "conversations group" do
it_should_behave_like "in-process server selenium tests"
Expand Down
2 changes: 1 addition & 1 deletion spec/selenium/conversations_recipient_finder_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require File.expand_path(File.dirname(__FILE__) + '/common')
require File.expand_path(File.dirname(__FILE__) + '/conversations_common')
require File.expand_path(File.dirname(__FILE__) + '/helpers/conversations_common')

describe "conversations recipient finder" do
it_should_behave_like "in-process server selenium tests"
Expand Down
2 changes: 1 addition & 1 deletion spec/selenium/conversations_sent_filter_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require File.expand_path(File.dirname(__FILE__) + '/common')
require File.expand_path(File.dirname(__FILE__) + '/conversations_common')
require File.expand_path(File.dirname(__FILE__) + '/helpers/conversations_common')

describe "conversations sent filter" do
it_should_behave_like "in-process server selenium tests"
Expand Down
2 changes: 1 addition & 1 deletion spec/selenium/conversations_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require File.expand_path(File.dirname(__FILE__) + '/common')
require File.expand_path(File.dirname(__FILE__) + '/conversations_common')
require File.expand_path(File.dirname(__FILE__) + '/helpers/conversations_common')

describe "conversations" do
it_should_behave_like "in-process server selenium tests"
Expand Down
2 changes: 1 addition & 1 deletion spec/selenium/conversations_submissions_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require File.expand_path(File.dirname(__FILE__) + '/common')
require File.expand_path(File.dirname(__FILE__) + '/conversations_common')
require File.expand_path(File.dirname(__FILE__) + '/helpers/conversations_common')

describe "conversations submissions" do
it_should_behave_like "in-process server selenium tests"
Expand Down
2 changes: 1 addition & 1 deletion spec/selenium/conversations_user_notes_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require File.expand_path(File.dirname(__FILE__) + '/common')
require File.expand_path(File.dirname(__FILE__) + '/conversations_common')
require File.expand_path(File.dirname(__FILE__) + '/helpers/conversations_common')

describe "conversations user notes" do
it_should_behave_like "in-process server selenium tests"
Expand Down
2 changes: 1 addition & 1 deletion spec/selenium/discussions_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require File.expand_path(File.dirname(__FILE__) + '/common')
require File.expand_path(File.dirname(__FILE__) + '/discussions_common')
require File.expand_path(File.dirname(__FILE__) + '/helpers/discussions_common')

describe "discussions" do
it_should_behave_like "discussions selenium tests"
Expand Down
2 changes: 1 addition & 1 deletion spec/selenium/discussions_threaded_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require File.expand_path(File.dirname(__FILE__) + '/common')
require File.expand_path(File.dirname(__FILE__) + '/discussions_common')
require File.expand_path(File.dirname(__FILE__) + '/helpers/discussions_common')

describe "threaded discussions" do
it_should_behave_like "discussions selenium tests"
Expand Down
2 changes: 1 addition & 1 deletion spec/selenium/external_tools_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require File.expand_path(File.dirname(__FILE__) + '/common')
require File.expand_path(File.dirname(__FILE__) + '/external_tools_common')
require File.expand_path(File.dirname(__FILE__) + '/helpers/external_tools_common')

describe "editing external tools" do
it_should_behave_like "external tools tests"
Expand Down
2 changes: 1 addition & 1 deletion spec/selenium/gradebook2_column_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require File.expand_path(File.dirname(__FILE__) + "/common")
require File.expand_path(File.dirname(__FILE__) + '/gradebook2_common')
require File.expand_path(File.dirname(__FILE__) + '/helpers/gradebook2_common')

describe "assignment column headers" do
it_should_behave_like "gradebook2 selenium tests"
Expand Down
2 changes: 1 addition & 1 deletion spec/selenium/gradebook2_grade_edit_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require File.expand_path(File.dirname(__FILE__) + "/common")
require File.expand_path(File.dirname(__FILE__) + '/gradebook2_common')
require File.expand_path(File.dirname(__FILE__) + '/helpers/gradebook2_common')
describe "edititing grades" do
it_should_behave_like "gradebook2 selenium tests"

Expand Down
2 changes: 1 addition & 1 deletion spec/selenium/gradebook2_group_weight_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require File.expand_path(File.dirname(__FILE__) + "/common")
require File.expand_path(File.dirname(__FILE__) + '/gradebook2_common')
require File.expand_path(File.dirname(__FILE__) + '/helpers/gradebook2_common')
describe "group weights" do
it_should_behave_like "gradebook2 selenium tests"

Expand Down
2 changes: 1 addition & 1 deletion spec/selenium/gradebook2_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require File.expand_path(File.dirname(__FILE__) + "/common")
require File.expand_path(File.dirname(__FILE__) + '/gradebook2_common')
require File.expand_path(File.dirname(__FILE__) + '/helpers/gradebook2_common')

describe "gradebook2" do
it_should_behave_like "gradebook2 selenium tests"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require File.expand_path(File.dirname(__FILE__) + '/common')
require File.expand_path(File.dirname(__FILE__) + '/../common')

shared_examples_for "external tools tests" do
it_should_behave_like "in-process server selenium tests"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ def wiki_page_tools_file_tree_setup
@sub_sub_folder = @sub_folder.sub_folders.create!(:name => 'subsubfolder', :context => @course);
@text_file = @root_folder.attachments.create!(:filename => 'text_file.txt', :context => @course) { |a| a.content_type = 'text/plain' }
@image1 = @root_folder.attachments.build(:context => @course)
path = File.expand_path(File.dirname(__FILE__) + '/../../public/images/email.png')
path = File.expand_path(File.dirname(__FILE__) + '/../../../public/images/email.png')
@image1.uploaded_data = ActionController::TestUploadedFile.new(path, Attachment.mimetype(path))
@image1.save!
@image2 = @root_folder.attachments.build(:context => @course)
path = File.expand_path(File.dirname(__FILE__) + '/../../public/images/graded.png')
path = File.expand_path(File.dirname(__FILE__) + '/../../../public/images/graded.png')
@image2.uploaded_data = ActionController::TestUploadedFile.new(path, Attachment.mimetype(path))
@image2.save!
get "/courses/#{@course.id}/wiki"
Expand Down
2 changes: 1 addition & 1 deletion spec/selenium/manage_groups_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require File.expand_path(File.dirname(__FILE__) + '/common')
require File.expand_path(File.dirname(__FILE__) + '/manage_groups_common')
require File.expand_path(File.dirname(__FILE__) + '/helpers/manage_groups_common')
require 'thread'

describe "manage groups" do
Expand Down
2 changes: 1 addition & 1 deletion spec/selenium/manage_groups_students_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require File.expand_path(File.dirname(__FILE__) + '/common')
require File.expand_path(File.dirname(__FILE__) + '/manage_groups_common')
require File.expand_path(File.dirname(__FILE__) + '/helpers/manage_groups_common')
require 'thread'

describe "manage groups students" do
Expand Down
2 changes: 1 addition & 1 deletion spec/selenium/quizzes_question_banks_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require File.expand_path(File.dirname(__FILE__) + '/common')
require File.expand_path(File.dirname(__FILE__) + '/quizzes_common')
require File.expand_path(File.dirname(__FILE__) + '/helpers/quizzes_common')

describe "quizzes question banks" do
it_should_behave_like "quizzes selenium tests"
Expand Down
2 changes: 1 addition & 1 deletion spec/selenium/quizzes_question_creation_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require File.expand_path(File.dirname(__FILE__) + '/common')
require File.expand_path(File.dirname(__FILE__) + '/quizzes_common')
require File.expand_path(File.dirname(__FILE__) + '/helpers/quizzes_common')

describe "quizzes question creation" do
it_should_behave_like "quizzes selenium tests"
Expand Down
2 changes: 1 addition & 1 deletion spec/selenium/quizzes_questions_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require File.expand_path(File.dirname(__FILE__) + '/common')
require File.expand_path(File.dirname(__FILE__) + '/quizzes_common')
require File.expand_path(File.dirname(__FILE__) + '/helpers/quizzes_common')

describe "quizzes questions" do
it_should_behave_like "quizzes selenium tests"
Expand Down
2 changes: 1 addition & 1 deletion spec/selenium/quizzes_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require File.expand_path(File.dirname(__FILE__) + '/common')
require File.expand_path(File.dirname(__FILE__) + '/quizzes_common')
require File.expand_path(File.dirname(__FILE__) + '/helpers/quizzes_common')

describe "quizzes" do
it_should_behave_like "quizzes selenium tests"
Expand Down
2 changes: 1 addition & 1 deletion spec/selenium/quizzes_students_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require File.expand_path(File.dirname(__FILE__) + '/common')
require File.expand_path(File.dirname(__FILE__) + '/quizzes_common')
require File.expand_path(File.dirname(__FILE__) + '/helpers/quizzes_common')

describe "quizzes students" do
it_should_behave_like "quizzes selenium tests"
Expand Down
2 changes: 1 addition & 1 deletion spec/selenium/scheduler_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require File.expand_path(File.dirname(__FILE__) + '/common')
require File.expand_path(File.dirname(__FILE__) + '/calendar2_common')
require File.expand_path(File.dirname(__FILE__) + '/helpers/calendar2_common')

EDIT_NAME = 'edited appointment'
EDIT_LOCATION = 'edited location'
Expand Down
2 changes: 1 addition & 1 deletion spec/selenium/wiki_and_tiny_files_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require File.expand_path(File.dirname(__FILE__) + '/common')
require File.expand_path(File.dirname(__FILE__) + '/wiki_and_tiny_common')
require File.expand_path(File.dirname(__FILE__) + '/helpers/wiki_and_tiny_common')

describe "Wiki pages and Tiny WYSIWYG editor Files" do
it_should_behave_like "wiki and tiny selenium tests"
Expand Down
2 changes: 1 addition & 1 deletion spec/selenium/wiki_and_tiny_images_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require File.expand_path(File.dirname(__FILE__) + '/common')
require File.expand_path(File.dirname(__FILE__) + '/wiki_and_tiny_common')
require File.expand_path(File.dirname(__FILE__) + '/helpers/wiki_and_tiny_common')

describe "Wiki pages and Tiny WYSIWYG editor Images" do
it_should_behave_like "wiki and tiny selenium tests"
Expand Down
2 changes: 1 addition & 1 deletion spec/selenium/wiki_and_tiny_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require File.expand_path(File.dirname(__FILE__) + '/common')
require File.expand_path(File.dirname(__FILE__) + '/wiki_and_tiny_common')
require File.expand_path(File.dirname(__FILE__) + '/helpers/wiki_and_tiny_common')

describe "Wiki pages and Tiny WYSIWYG editor" do
it_should_behave_like "wiki and tiny selenium tests"
Expand Down

0 comments on commit 31f3cc0

Please sign in to comment.