forked from capability-boosters-dev/canvas-lms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
collaborations_teacher_spec.rb
97 lines (82 loc) · 3.28 KB
/
collaborations_teacher_spec.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#
# Copyright (C) 2015 - present Instructure, Inc.
#
# This file is part of Canvas.
#
# Canvas is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License as published by the Free
# Software Foundation, version 3 of the License.
#
# Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
# details.
#
# You should have received a copy of the GNU Affero General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
require File.expand_path(File.dirname(__FILE__) + '/common')
require File.expand_path(File.dirname(__FILE__) + '/helpers/collaborations_common')
require File.expand_path(File.dirname(__FILE__) + '/helpers/collaborations_specs_common')
require File.expand_path(File.dirname(__FILE__) + '/helpers/google_drive_common')
describe "collaborations" do
include_context "in-process server selenium tests"
include CollaborationsCommon
include CollaborationsSpecsCommon
include GoogleDriveCommon
context "a teacher's" do
title = 'Google Docs'
type = 'google_docs'
context "#{title} collaboration" do
before(:each) do
course_with_teacher_logged_in
setup_google_drive
end
it 'should be editable', priority: "1", test_id: 138612 do
be_editable(type, title)
end
it 'should be delete-able', priority: "1", test_id: 152301 do
be_deletable(type, title)
end
it 'should display available collaborators', priority: "1", test_id: 158507 do
display_available_collaborators(type)
end
it 'start collaboration with people', priority: "1", test_id: 132544 do
skip_if_safari(:alert)
select_collaborators_and_look_for_start(type)
end
end
context "Google Docs collaborations with google docs not having access" do
before(:each) do
course_with_teacher_logged_in
setup_google_drive(false, false)
end
it 'should not be editable if google drive does not have access to your account', priority: "1", test_id: 160259 do
no_edit_with_no_access
end
it 'should not be delete-able if google drive does not have access to your account', priority: "2", test_id: 162364 do
no_delete_with_no_access
end
end
end
describe "Accessibility" do
before(:each) do
course_with_teacher_logged_in
create_collaboration!('etherpad', 'Collaboration 1')
create_collaboration!('etherpad', 'Collaboration 2')
get "/courses/#{@course.id}/collaborations"
end
it 'should set focus to the previous delete icon when deleting an etherpad collaboration' do
all_icons = ff('.delete_collaboration_link')
all_icons.last.click
driver.switch_to.alert.accept
wait_for_ajaximations
expect(check_element_has_focus(all_icons.first)).to be
end
it 'should set focus to the add collaboration button if there are no previous collaborations' do
f('.delete_collaboration_link').click
driver.switch_to.alert.accept
wait_for_ajaximations
expect(check_element_has_focus(f('.add_collaboration_link'))).to be
end
end
end