add vdd specs for teacher
Test Plan: - pass Jenkins - check for syntax errors - make sure new test_ids match up to an existing test case in TestRails mhargiss,panda,9 Change-Id: I0809439031e9430000dcfbc50cf19eb443c03864 Reviewed-on: https://gerrit.instructure.com/61935 Tested-by: Jenkins Reviewed-by: Derek Hansen <dhansen@instructure.com> Product-Review: Derek Hansen <dhansen@instructure.com> QA-Review: Derek Hansen <dhansen@instructure.com>
This commit is contained in:
parent
eef1a84498
commit
bb9e9027a3
|
@ -163,6 +163,14 @@ module AssignmentOverridesSeleniumHelper
|
|||
create_quiz_with_multiple_due_dates
|
||||
end
|
||||
|
||||
def prepare_multiple_due_dates_scenario_for_teacher
|
||||
prepare_multiple_due_dates_scenario
|
||||
|
||||
@teacher1 = user_with_pseudonym(username: 'teacher1@example.com', active_all: 1)
|
||||
@course.enroll_teacher(@teacher1, section: @section_a)
|
||||
@course.enroll_teacher(@teacher1, section: @section_b)
|
||||
end
|
||||
|
||||
def prepare_multiple_due_dates_scenario_for_ta
|
||||
prepare_multiple_due_dates_scenario
|
||||
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + '/../helpers/quizzes_common')
|
||||
require File.expand_path(File.dirname(__FILE__) + '/../helpers/assignment_overrides')
|
||||
|
||||
describe 'viewing a quiz with variable due dates on the quizzes index page' do
|
||||
include AssignmentOverridesSeleniumHelper
|
||||
include_context 'in-process server selenium tests'
|
||||
|
||||
before(:all) do
|
||||
prepare_multiple_due_dates_scenario_for_teacher
|
||||
end
|
||||
|
||||
context 'with a teacher in both sections' do
|
||||
before(:each) do
|
||||
user_session(@teacher1)
|
||||
get "/courses/#{@course.id}/quizzes"
|
||||
end
|
||||
|
||||
it 'shows the due dates for Section A', priority: "1", test_id: 282167 do
|
||||
validate_quiz_dates('.date-due', "Everyone else\n#{format_date_for_view(@due_at_a)}")
|
||||
end
|
||||
|
||||
it 'shows the due dates for Section B', priority: "1", test_id: 315661 do
|
||||
validate_quiz_dates('.date-due', "#{@section_b.name}\n#{format_date_for_view(@due_at_b)}")
|
||||
end
|
||||
|
||||
it 'shows the availability dates for Section A', priority: "1", test_id: 282393 do
|
||||
validate_quiz_dates('.date-available', "Everyone else\nAvailable until #{format_date_for_view(@lock_at_a)}")
|
||||
end
|
||||
|
||||
it 'shows the availability dates for Section B', priority: "1", test_id: 315663 do
|
||||
validate_quiz_dates('.date-available', "#{@section_b.name}\nNot available until #{format_date_for_view(@unlock_at_b)}")
|
||||
end
|
||||
end
|
||||
end
|
|
@ -0,0 +1,40 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + '/../helpers/quizzes_common')
|
||||
require File.expand_path(File.dirname(__FILE__) + '/../helpers/assignment_overrides')
|
||||
|
||||
describe 'viewing a quiz with variable due dates on the quiz show page' do
|
||||
include AssignmentOverridesSeleniumHelper
|
||||
include_context 'in-process server selenium tests'
|
||||
|
||||
before(:all) do
|
||||
prepare_multiple_due_dates_scenario_for_teacher
|
||||
end
|
||||
|
||||
context 'with a teacher in both sections' do
|
||||
before(:each) do
|
||||
user_session(@teacher1)
|
||||
get "/courses/#{@course.id}/quizzes/#{@quiz.id}"
|
||||
end
|
||||
|
||||
it 'shows the due dates for Section A', priority: "1", test_id: 315658 do
|
||||
expect(obtain_due_date(@section_a)).to include_text("#{format_time_for_view(@due_at_a)}")
|
||||
end
|
||||
|
||||
it 'shows the due dates for Section B', priority: "1", test_id: 315660 do
|
||||
expect(obtain_due_date(@section_b)).to include_text("#{format_time_for_view(@due_at_b)}")
|
||||
end
|
||||
|
||||
it 'shows the availability dates for Section A', priority: "1", test_id: 315662 do
|
||||
expect(obtain_availability_start_date(@section_a)).to include_text("#{format_time_for_view(@unlock_at_a)}")
|
||||
expect(obtain_availability_end_date(@section_a)).to include_text("#{format_time_for_view(@lock_at_a)}")
|
||||
end
|
||||
|
||||
it 'shows the availability dates for Section B', priority: "1", test_id: 315664 do
|
||||
expect(obtain_availability_start_date(@section_b)).to include_text("#{format_time_for_view(@unlock_at_b)}")
|
||||
expect(obtain_availability_end_date(@section_b)).to include_text("#{format_time_for_view(@lock_at_b)}")
|
||||
end
|
||||
|
||||
it 'allows taking the quiz', priority: "1", test_id: 282394 do
|
||||
expect(f('.take_quiz_button')).to be_displayed
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue