spec: selenium updates for rails 3
in particular, change "it_should_behave_like" to "include_examples" (in rails 3, "it_should_behave_like" does not extend the defined methods to nested examples) Change-Id: I24c3d0a214e763cd61bbe73e055f610e021fddd0 Reviewed-on: https://gerrit.instructure.com/28157 Tested-by: Jenkins <jenkins@instructure.com> Reviewed-by: Cody Cutrer <cody@instructure.com> Product-Review: James Williams <jamesw@instructure.com> QA-Review: James Williams <jamesw@instructure.com>
This commit is contained in:
parent
507fe54e27
commit
86384632e3
|
@ -1,7 +1,7 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + '/common')
|
||||
|
||||
describe "account" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
before (:each) do
|
||||
course_with_admin_logged_in
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + '/../common')
|
||||
|
||||
describe "account admin courses tab" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
def add_course(course_name, has_student = false)
|
||||
Account.default.courses.create(:name => course_name).offer!
|
||||
|
|
|
@ -2,7 +2,7 @@ require File.expand_path(File.dirname(__FILE__) + '/../common')
|
|||
require File.expand_path(File.dirname(__FILE__) + '/../helpers/grading_schemes_common')
|
||||
|
||||
describe "account admin grading schemes" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
let(:account) { Account.default }
|
||||
let(:url) { "/accounts/#{Account.default.id}/grading_standards" }
|
||||
|
|
|
@ -2,7 +2,7 @@ require File.expand_path(File.dirname(__FILE__) + '/../helpers/manage_groups_com
|
|||
require 'thread'
|
||||
|
||||
describe "account admin manage groups" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
def add_account_category (account, name)
|
||||
f(".add_category_link").click
|
||||
|
|
|
@ -4,7 +4,7 @@ require File.expand_path(File.dirname(__FILE__) + '/../common')
|
|||
require File.expand_path(File.dirname(__FILE__) + '/../helpers/outcome_common')
|
||||
|
||||
describe "account admin outcomes" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
let(:outcome_url) { "/accounts/#{Account.default.id}/outcomes" }
|
||||
let(:who_to_login) { 'admin' }
|
||||
let(:account) { Account.default }
|
||||
|
|
|
@ -2,7 +2,7 @@ require File.expand_path(File.dirname(__FILE__) + '/../common')
|
|||
require File.expand_path(File.dirname(__FILE__) + '/../helpers/external_tools_common')
|
||||
|
||||
describe "account admin question bank" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
before(:each) do
|
||||
admin_logged_in
|
||||
|
|
|
@ -3,7 +3,7 @@ require File.expand_path(File.dirname(__FILE__) + '/../helpers/rubrics_common')
|
|||
require File.expand_path(File.dirname(__FILE__) + '/../common')
|
||||
|
||||
describe "account shared rubric specs" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
let(:rubric_url) { "/accounts/#{Account.default.id}/rubrics" }
|
||||
let(:who_to_login) { 'admin' }
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + '/../common')
|
||||
|
||||
describe "sis imports ui" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
def account_with_admin_logged_in(opts = {})
|
||||
@account = Account.default
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + '/../common')
|
||||
|
||||
describe "account admin terms" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
def click_term_action_link(term_div, action_link_css)
|
||||
term_div.find_element(:css, action_link_css).click
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + '/../common')
|
||||
|
||||
describe "admin avatars" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
before (:each) do
|
||||
course_with_admin_logged_in
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + '/../common')
|
||||
|
||||
describe "admin settings tab" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
before (:each) do
|
||||
course_with_admin_logged_in
|
||||
get "/accounts/#{Account.default.id}/settings"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + '/../common')
|
||||
|
||||
describe "admin sub accounts" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
DEFAULT_ACCOUNT_ID = Account.default.id
|
||||
|
||||
def create_sub_account(name = 'sub account', number_to_create = 1, parent_account = Account.default)
|
||||
|
|
|
@ -3,7 +3,7 @@ require File.expand_path(File.dirname(__FILE__) + '/../helpers/shared_user_metho
|
|||
require File.expand_path(File.dirname(__FILE__) + '/../helpers/basic/users_specs')
|
||||
|
||||
describe "admin courses tab" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
context "add user basic" do
|
||||
describe "shared users specs" do
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + '/../common')
|
||||
|
||||
describe "assignments" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
context "as an admin" do
|
||||
before do
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + '/../common')
|
||||
|
||||
describe "Account Authorization Configs" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
context "Server errors " do
|
||||
|
||||
it "should show the error message generated by the server" do
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + '/../common')
|
||||
|
||||
describe "managing developer keys" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
before :each do
|
||||
account_admin_user(:account => Account.site_admin)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + '/../common')
|
||||
|
||||
describe "site admin jobs ui" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
module FlavorTags
|
||||
ALL = 'All'
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + '/../../common')
|
||||
|
||||
describe "sub account courses" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
let(:account) { Account.create(:name => 'sub account from default account', :parent_account => Account.default) }
|
||||
let(:url) { "/accounts/#{account.id}" }
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ require File.expand_path(File.dirname(__FILE__) + '/../../common')
|
|||
require File.expand_path(File.dirname(__FILE__) + '/../../helpers/grading_schemes_common')
|
||||
|
||||
describe "sub account grading schemes" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
let(:account) { Account.create(:name => 'sub account from default account', :parent_account => Account.default) }
|
||||
let(:url) { "/accounts/#{account.id}/grading_standards" }
|
||||
|
|
|
@ -2,7 +2,7 @@ require File.expand_path(File.dirname(__FILE__) + '/../../common')
|
|||
require File.expand_path(File.dirname(__FILE__) + '/../../helpers/outcome_common')
|
||||
|
||||
describe "sub account outcomes" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
describe "account outcome specs" do
|
||||
let(:account) { Account.create(:name => 'sub account from default account', :parent_account => Account.default) }
|
||||
|
|
|
@ -2,7 +2,7 @@ require File.expand_path(File.dirname(__FILE__) + '/../../common')
|
|||
require File.expand_path(File.dirname(__FILE__) + '/../../helpers/rubrics_common')
|
||||
|
||||
describe "sub account shared rubric specs" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
let(:account) { Account.create(:name => 'sub account from default account', :parent_account => Account.default) }
|
||||
let(:rubric_url) { "/accounts/#{account.id}/rubrics" }
|
||||
let(:who_to_login) { 'admin' }
|
||||
|
|
|
@ -3,7 +3,7 @@ require File.expand_path(File.dirname(__FILE__) + '/helpers/calendar2_common')
|
|||
require File.expand_path(File.dirname(__FILE__) + '/../cassandra_spec_helper')
|
||||
|
||||
describe "admin_tools" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
def load_admin_tools_page
|
||||
get "/accounts/#{@account.id}/admin_tools"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + '/common')
|
||||
|
||||
describe "Alerts" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
before (:each) do
|
||||
@context = Account.default
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + '/common')
|
||||
|
||||
describe "announcements" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
def create_announcement(message = 'announcement message')
|
||||
@context = @course
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + '/common')
|
||||
|
||||
describe "Authenticity Tokens" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
it "should change the authenticity token on each request" do
|
||||
user_logged_in
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + '/helpers/assignments_common')
|
||||
|
||||
describe "discussion assignments" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
|
||||
before (:each) do
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + '/common')
|
||||
|
||||
describe "external tool assignments" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
before (:each) do
|
||||
course_with_teacher_logged_in
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + '/common')
|
||||
|
||||
describe "assignment groups" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
def get_assignment_groups
|
||||
ff('#groups .assignment_group')
|
||||
|
|
|
@ -3,7 +3,7 @@ require File.expand_path(File.dirname(__FILE__) + '/helpers/assignment_overrides
|
|||
|
||||
describe "assignment groups" do
|
||||
include AssignmentOverridesSeleniumHelper
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
context "as a teacher" do
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + '/helpers/assignments_common')
|
||||
|
||||
describe "quizzes assignments" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
|
||||
before (:each) do
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + '/common')
|
||||
|
||||
describe "assignment rubrics" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
context "assignment rubrics as a teacher" do
|
||||
before (:each) do
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + '/common')
|
||||
|
||||
describe "assignments" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
context "as a teacher" do
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + '/common')
|
||||
|
||||
describe "assignments" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
context "as a student" do
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + '/common')
|
||||
|
||||
describe "assignments turn it in" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
before (:each) do
|
||||
course_with_teacher_logged_in
|
||||
|
|
|
@ -2,7 +2,7 @@ require File.expand_path(File.dirname(__FILE__) + '/common')
|
|||
require File.expand_path(File.dirname(__FILE__) + '/helpers/calendar2_common')
|
||||
|
||||
describe "calendar2" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
before (:each) do
|
||||
Account.default.tap do |a|
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + '/common')
|
||||
|
||||
describe "calendar" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
def go_to_calendar
|
||||
get "/calendar"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + '/common')
|
||||
|
||||
describe "collaborations" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
# Helper methods
|
||||
# ==============
|
||||
|
|
|
@ -16,6 +16,15 @@
|
|||
# with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
require File.expand_path(File.dirname(__FILE__) + '/../../config/canvas_rails3')
|
||||
if CANVAS_RAILS2
|
||||
Spec::Example::ExampleGroupMethods.module_eval do
|
||||
def include_examples(*args)
|
||||
it_should_behave_like(*args)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
|
||||
require "selenium-webdriver"
|
||||
require "socket"
|
||||
|
@ -191,10 +200,14 @@ module SeleniumTestsHelperMethods
|
|||
def self.rack_app()
|
||||
app = Rack::Builder.new do
|
||||
use Rails::Rack::Debugger unless Rails.env.test?
|
||||
if CANVAS_RAILS2
|
||||
map '/' do
|
||||
use Rails::Rack::Static
|
||||
run ActionController::Dispatcher.new
|
||||
end
|
||||
else
|
||||
run CanvasRails::Application
|
||||
end
|
||||
end.to_app
|
||||
return app
|
||||
end
|
||||
|
@ -275,7 +288,11 @@ shared_examples_for "all selenium tests" do
|
|||
include CustomSeleniumRspecMatchers
|
||||
|
||||
# set up so you can use rails urls helpers in your selenium tests
|
||||
if CANVAS_RAILS2
|
||||
include ActionController::UrlWriter
|
||||
else
|
||||
include Rails.application.routes.url_helpers
|
||||
end
|
||||
|
||||
def selenium_driver;
|
||||
$selenium_driver
|
||||
|
@ -1058,7 +1075,7 @@ def find_css_in_string(string_of_html, css_selector)
|
|||
end
|
||||
|
||||
shared_examples_for "in-process server selenium tests" do
|
||||
it_should_behave_like "all selenium tests"
|
||||
include_examples "all selenium tests"
|
||||
prepend_before (:all) do
|
||||
$in_proc_webserver_shutdown ||= SeleniumTestsHelperMethods.start_webserver(WEBSERVER)
|
||||
end
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + '/common')
|
||||
|
||||
describe "communication channel selenium tests" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
context "confirm" do
|
||||
it "should register the user" do
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + '/common')
|
||||
|
||||
describe "concluded/unconcluded" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
before (:each) do
|
||||
username = "nobody@example.com"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + "/common")
|
||||
|
||||
describe "web conference" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
before (:each) do
|
||||
course_with_teacher_logged_in
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + '/common')
|
||||
|
||||
describe "content exports" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
context "as a teacher" do
|
||||
|
||||
|
|
|
@ -146,7 +146,7 @@ def test_selective_content(source_course=nil)
|
|||
end
|
||||
|
||||
describe "content migrations" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
context "common cartridge importing" do
|
||||
before :each do
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + '/common')
|
||||
|
||||
describe "courses" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
before do
|
||||
course_with_student_logged_in(:active_all => true)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + '/helpers/context_modules_common')
|
||||
|
||||
describe "context_modules" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
context "as a teacher" do
|
||||
|
||||
before (:each) do
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + "/common")
|
||||
|
||||
describe "context_modules" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
context "as a student" do
|
||||
def create_context_module(module_name)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + '/helpers/conversations_common')
|
||||
|
||||
describe "conversations attachments local tests" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
before do
|
||||
conversation_setup
|
||||
|
@ -140,7 +140,7 @@ describe "conversations attachments local tests" do
|
|||
end
|
||||
|
||||
describe "conversations attachments S3 tests" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
before do
|
||||
conversation_setup
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + '/helpers/conversations_common')
|
||||
|
||||
describe "conversations context filtering" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
before (:each) do
|
||||
conversation_setup
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + '/helpers/conversations_common')
|
||||
|
||||
describe "conversations group" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
before(:each) do
|
||||
conversation_setup
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + '/helpers/conversations_common')
|
||||
|
||||
describe "conversations new" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
def conversations_url
|
||||
"/conversations"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + '/helpers/conversations_common')
|
||||
|
||||
describe "conversations recipient finder" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
def conversations_path(params={})
|
||||
hash = params.to_json.unpack('H*').first
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + '/helpers/conversations_common')
|
||||
|
||||
describe "conversations sent filter" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
before (:each) do
|
||||
conversation_setup
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + '/helpers/conversations_common')
|
||||
|
||||
describe "conversations" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
before (:each) do
|
||||
conversation_setup
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + '/helpers/conversations_common')
|
||||
|
||||
describe "conversations submissions" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
before (:each) do
|
||||
conversation_setup
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + '/helpers/conversations_common')
|
||||
|
||||
describe "conversations user notes" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
before(:each) do
|
||||
conversation_setup
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + '/common')
|
||||
|
||||
describe "course copy" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
def validate_course_main_page
|
||||
header = f('#section-tabs-header')
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + '/common')
|
||||
|
||||
describe "course sections" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
def add_enrollment(enrollment_state, section)
|
||||
enrollment = student_in_course(:workflow_state => enrollment_state, :course_section => section)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + '/common')
|
||||
|
||||
describe "course settings" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
before (:each) do
|
||||
course_with_teacher_logged_in :limit_privileges_to_course_section => false
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + '/common')
|
||||
|
||||
describe "course statistics" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
before (:each) do
|
||||
course_with_teacher_logged_in
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + '/common')
|
||||
|
||||
describe "courses" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
context "as a teacher" do
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + '/common')
|
||||
|
||||
describe "cross-listing" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
before do
|
||||
course_with_teacher_logged_in
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + '/common')
|
||||
|
||||
describe "dashboard" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
context "as a student" do
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + '/common')
|
||||
|
||||
describe "default plugins" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
before(:each) do
|
||||
user_logged_in
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + '/helpers/discussions_common')
|
||||
|
||||
describe "discussions" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
let(:course) { course_model.tap(&:offer!) }
|
||||
let(:default_section) { course.default_section }
|
||||
|
|
|
@ -2,7 +2,7 @@ require File.expand_path(File.dirname(__FILE__) + '/helpers/discussions_common')
|
|||
|
||||
|
||||
describe "threaded discussions" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
before (:each) do
|
||||
@topic_title = 'threaded discussion topic'
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + '/common')
|
||||
|
||||
describe "enhanceable_content" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
it "should automatically enhance content using jQuery UI" do
|
||||
stub_kaltura
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + '/common')
|
||||
|
||||
describe "eportfolios" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
def create_eportfolio(is_public = false)
|
||||
get "/dashboard/eportfolios"
|
||||
|
@ -265,7 +265,7 @@ describe "eportfolios" do
|
|||
end
|
||||
|
||||
describe "eportfolios file upload" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
before (:each) do
|
||||
@password = "asdfasdf"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + '/common')
|
||||
|
||||
describe "error reporting" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
it "should log the same error at most 1 time per 5 seconds" do
|
||||
get('/logout')
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + '/common')
|
||||
|
||||
describe "external tool buttons" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
before (:each) do
|
||||
course_with_teacher_logged_in
|
||||
|
|
|
@ -2,7 +2,7 @@ require File.expand_path(File.dirname(__FILE__) + '/common')
|
|||
require File.expand_path(File.dirname(__FILE__) + '/helpers/files_common')
|
||||
|
||||
describe "shared files tests" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
def fixture_file_path(file)
|
||||
path = ActionController::TestCase.respond_to?(:fixture_path) ? ActionController::TestCase.send(:fixture_path) : nil
|
||||
|
@ -189,7 +189,7 @@ end
|
|||
|
||||
|
||||
describe "zip file uploads" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
context "courses" do
|
||||
before do
|
||||
|
|
|
@ -59,7 +59,7 @@ def file_setup
|
|||
end
|
||||
|
||||
describe "common file behaviors" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
def add_file(file_fullpath)
|
||||
attachment_field = keep_trying_until do
|
||||
|
@ -168,7 +168,7 @@ describe "common file behaviors" do
|
|||
end
|
||||
|
||||
describe "files without s3 and forked tests" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
before (:each) do
|
||||
@folder_name = "my folder"
|
||||
|
@ -219,7 +219,7 @@ describe "files without s3 and forked tests" do
|
|||
end
|
||||
|
||||
describe "course files" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
it "should not show root folder files in the collaborations folder when there is a collaboration" do
|
||||
course_with_teacher_logged_in
|
||||
|
@ -252,7 +252,7 @@ describe "course files" do
|
|||
end
|
||||
|
||||
describe "scribd re-rendering" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
before do
|
||||
ScribdAPI.stubs(:config).returns({ :key => "key", :secret => "what" })
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + '/common')
|
||||
|
||||
describe "google analytics" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
it "should not include tracking script if not asked to" do
|
||||
get "/"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + '/common')
|
||||
|
||||
describe "grade exchange course settings tab" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
def getpseudonym(user_sis_id)
|
||||
pseudo = Pseudonym.find_by_sis_user_id(user_sis_id)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + '/helpers/gradebook2_common')
|
||||
|
||||
describe "assignment column headers" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
ASSIGNMENT_1_POINTS = "10"
|
||||
ASSIGNMENT_2_POINTS = "5"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + '/helpers/gradebook2_common')
|
||||
describe "edititing grades" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
ASSIGNMENT_1_POINTS = "10"
|
||||
ASSIGNMENT_2_POINTS = "5"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + '/helpers/gradebook2_common')
|
||||
describe "group weights" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
ASSIGNMENT_1_POINTS = "10"
|
||||
ASSIGNMENT_2_POINTS = "5"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + '/helpers/gradebook2_common')
|
||||
|
||||
describe "gradebook2" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
ASSIGNMENT_1_POINTS = "10"
|
||||
ASSIGNMENT_2_POINTS = "5"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + "/common")
|
||||
|
||||
describe "gradebook uploads" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
before do
|
||||
course_with_teacher_logged_in(:active_all => 1, :username => 'teacher@example.com')
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + "/common")
|
||||
|
||||
describe "gradebook1" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
before(:each) do
|
||||
course_with_teacher_logged_in(:active_all => true)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + "/common")
|
||||
|
||||
describe "grades" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
before (:each) do
|
||||
course_with_teacher(:active_all => true)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + '/common')
|
||||
|
||||
describe "grading standards" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
it "should allow creating/deleting grading standards" do
|
||||
course_with_teacher_logged_in
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + '/common')
|
||||
|
||||
describe "groups" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
it "should allow students to join self signup groups" do
|
||||
course_with_student_logged_in(:active_all => true)
|
||||
|
|
|
@ -2,7 +2,7 @@ require File.expand_path(File.dirname(__FILE__) + "/common")
|
|||
require 'lib/handlebars/handlebars'
|
||||
|
||||
describe "handlebars" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
before (:each) do
|
||||
course_with_teacher_logged_in
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + '/common')
|
||||
|
||||
describe "help dialog" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
context "no user logged in" do
|
||||
it "should work with no logged in user" do
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
shared_examples_for "permission tests" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
before (:each) do
|
||||
course_with_admin_logged_in
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
shared_examples_for "question bank basic tests" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
before (:each) do
|
||||
admin_logged_in
|
||||
get url
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
shared_examples_for "settings basic tests" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
before (:each) do
|
||||
course_with_admin_logged_in
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
shared_examples_for "statistics basic tests" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
def item_lists
|
||||
ff('.item_list')
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + '/../..//helpers/shared_user_methods')
|
||||
|
||||
shared_examples_for "users basic tests" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
it "should add a new user" do
|
||||
pending('newly added user in sub account does not show up') if account != Account.default
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + '/../common')
|
||||
|
||||
shared_examples_for "external tools tests" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
def add_external_tool (*opts)
|
||||
name = "external tool"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + '/../common')
|
||||
|
||||
shared_examples_for "quizzes selenium tests" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
def create_multiple_choice_question
|
||||
question = fj(".question_form:visible")
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + "/common")
|
||||
|
||||
describe "i18n js" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
before (:each) do
|
||||
course_with_teacher_logged_in
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + "/common")
|
||||
|
||||
describe "jquery" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
|
||||
# jquery keeps breaking attr() ... see http://bugs.jquery.com/ticket/10278
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + "/common")
|
||||
|
||||
describe "jquery ui" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
def active
|
||||
driver.switch_to.active_element
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + '/common')
|
||||
|
||||
describe "layout" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
before (:each) do
|
||||
course_with_student_logged_in
|
||||
|
|
|
@ -2,7 +2,7 @@ require File.expand_path(File.dirname(__FILE__) + '/helpers/manage_groups_common
|
|||
require 'thread'
|
||||
|
||||
describe "manage groups" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
before (:each) do
|
||||
course_with_teacher_logged_in
|
||||
|
|
|
@ -2,7 +2,7 @@ require File.expand_path(File.dirname(__FILE__) + '/helpers/manage_groups_common
|
|||
require 'thread'
|
||||
|
||||
describe "manage groups students" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
before (:each) do
|
||||
course_with_teacher_logged_in
|
||||
|
|
|
@ -2,7 +2,7 @@ require File.expand_path(File.dirname(__FILE__) + '/common')
|
|||
|
||||
|
||||
describe "oauth2 flow" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
before do
|
||||
@key = DeveloperKey.create!(:name => 'Specs', :redirect_uri => 'http://www.example.com')
|
||||
|
@ -50,7 +50,7 @@ describe "oauth2 flow" do
|
|||
end
|
||||
|
||||
describe "oauth2 tool icons" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
before do
|
||||
course_with_student_logged_in(:active_all => true)
|
||||
end
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + '/helpers/outcome_common')
|
||||
|
||||
describe "outcomes" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
let(:who_to_login) { 'teacher' }
|
||||
let(:outcome_url) { "/courses/#{@course.id}/outcomes" }
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + '/common')
|
||||
|
||||
describe "course people" do
|
||||
it_should_behave_like "in-process server selenium tests"
|
||||
include_examples "in-process server selenium tests"
|
||||
|
||||
before (:each) do
|
||||
course_with_teacher_logged_in :limit_privileges_to_course_section => false
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue