forked from instructure/canvas-lms
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnew_ui_spec.rb
More file actions
167 lines (143 loc) · 7.62 KB
/
Copy pathnew_ui_spec.rb
File metadata and controls
167 lines (143 loc) · 7.62 KB
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
#
# 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_relative 'common'
require_relative 'helpers/files_common'
describe 'new ui' do
include_context "in-process server selenium tests"
include FilesCommon
context 'as teacher' do
before(:each) do
course_with_teacher_logged_in
end
it 'breadcrumbs show for course navigation menu item', priority: "2", test_id: 242471 do
get "/courses/#{@course.id}"
expect(f('.home + li .ellipsible')).to include_text("#{@course.course_code}")
end
it 'breadcrumbs show for course announcements navigation menu item', priority: "2", test_id: 856927 do
get "/courses/#{@course.id}/announcements"
expect(f('.home + li + li .ellipsible')).to include_text('Announcements')
expect(f('.home + li .ellipsible')).to include_text("#{@course.course_code}")
end
it 'breadcrumbs show for course assignments navigation menu item', priority: "2", test_id: 856928 do
get "/courses/#{@course.id}/assignments"
expect(f('.home + li + li .ellipsible')).to include_text('Assignments')
expect(f('.home + li .ellipsible')).to include_text("#{@course.course_code}")
end
it 'breadcrumbs show for course discussions navigation menu item', priority: "2", test_id: 856929 do
get "/courses/#{@course.id}/discussion_topics"
expect(f('.home + li + li .ellipsible')).to include_text('Discussions')
expect(f('.home + li .ellipsible')).to include_text("#{@course.course_code}")
end
it 'breadcrumbs show for course grades navigation menu item', priority: "2", test_id: 856930 do
get "/courses/#{@course.id}/gradebook"
expect(f('.home + li + li .ellipsible')).to include_text('Grades')
expect(f('.home + li .ellipsible')).to include_text("#{@course.course_code}")
end
it 'breadcrumbs show for course people navigation menu item', priority: "2", test_id: 856931 do
get "/courses/#{@course.id}/users"
expect(f('.home + li + li .ellipsible')).to include_text('People')
expect(f('.home + li .ellipsible')).to include_text("#{@course.course_code}")
end
it 'breadcrumbs show for course pages navigation menu item', priority: "2", test_id: 856932 do
get "/courses/#{@course.id}/wiki"
expect(f('.home + li + li .ellipsible')).to include_text('Pages')
expect(f('.home + li .ellipsible')).to include_text("#{@course.course_code}")
end
it 'breadcrumbs show for course files navigation menu item', priority: "2", test_id: 856933 do
get "/courses/#{@course.id}/files"
expect(f('#breadcrumbs .ellipsis')).to include_text('Files')
expect(f('.ellipsible')).to include_text("#{@course.course_code}")
end
it 'breadcrumbs show for course syllabus navigation menu item', priority: "2", test_id: 856934 do
get "/courses/#{@course.id}/assignments/syllabus"
expect(f('.home + li + li .ellipsible')).to include_text('Syllabus')
expect(f('.home + li .ellipsible')).to include_text("#{@course.course_code}")
end
it 'breadcrumbs show for course outcomes navigation menu item', priority: "2", test_id: 856935 do
get "/courses/#{@course.id}/outcomes"
expect(f('.home + li + li .ellipsible')).to include_text('Outcomes')
expect(f('.home + li .ellipsible')).to include_text("#{@course.course_code}")
end
it 'breadcrumbs show for course quizzes navigation menu item', priority: "2", test_id: 856936 do
get "/courses/#{@course.id}/quizzes"
expect(f('.home + li + li .ellipsible')).to include_text('Quizzes')
expect(f('.home + li .ellipsible')).to include_text("#{@course.course_code}")
end
it 'breadcrumbs show for course modules navigation menu item', priority: "2", test_id: 856937 do
get "/courses/#{@course.id}/modules"
expect(f('.home + li + li .ellipsible')).to include_text('Modules')
expect(f('.home + li .ellipsible')).to include_text("#{@course.course_code}")
end
it 'breadcrumbs show for course settings navigation menu item', priority: "2", test_id: 856938 do
get "/courses/#{@course.id}/settings"
expect(f('.home + li + li .ellipsible')).to include_text('Settings')
expect(f('.home + li .ellipsible')).to include_text("#{@course.course_code}")
end
it 'should show new files folder icon in course files', priority: "2", test_id: 248683 do
get "/courses/#{@course.id}/files"
add_folder
# verifying new files folder icon css property still displays with new ui
expect(f('.media-object.ef-big-icon.FilesystemObjectThumbnail.mimeClass-folder')).to be_displayed
end
it 'should not override high contrast theme', priority: "2", test_id: 244898 do
get '/profile/settings'
f('.ic-Super-toggle__switch').click
wait_for_ajaximations
f = FeatureFlag.last
expect(f.state).to eq 'on'
expect(f('.profile_settings.active').css_value('background-color')).to eq('rgba(0, 142, 226, 1)')
end
it 'should not break tiny mce css', priority: "2", test_id: 244891 do
skip_if_chrome('Chrome does not get these values properly')
get "/courses/#{@course.id}/discussion_topics/new?is_announcement=true"
mce_icons = f('.mce-ico')
expect(mce_icons.css_value('font-family')).to eq('tinymce,Arial')
expect(mce_icons.css_value('font-style')).to eq('normal')
expect(mce_icons.css_value('font-weight')).to eq('400')
expect(mce_icons.css_value('font-size')).to eq('16px')
expect(mce_icons.css_value('vertical-align')).to eq('text-top')
expect(mce_icons.css_value('display')).to eq('inline-block')
expect(mce_icons.css_value('background-size')).to eq('cover')
expect(mce_icons.css_value('width')).to eq('16px')
expect(mce_icons.css_value('height')).to eq('16px')
end
it 'should not break equation editor css', priority: "2", test_id: 273600 do
get "/courses/#{@course.id}/assignments/new"
wait_for_tiny(f('#assignment_description'))
f('div#mceu_19.mce-widget.mce-btn').click
wait_for_ajaximations
expect(f('.mathquill-toolbar-panes, .mathquill-tab-bar')).to be_displayed
end
end
context 'as student' do
it 'should still have courses icon when only course is unpublished', priority: "1", test_id: 288860 do
course_with_student_logged_in(active_course: false)
get "/"
# make sure that "courses" shows up in the global nav even though we only have an unpublisned course
global_nav_courses_link = fj('#global_nav_courses_link')
expect(global_nav_courses_link).to be_displayed
global_nav_courses_link.click
wait_for_ajaximations
course_link_list = fj('ul.ic-NavMenu__link-list')
course_link_list.find_element(:link_text, 'All Courses').click
# and now actually go to the "/courses" page and make sure it shows up there too as "unpublisned"
wait_for_ajaximations
expect(fj('#my_courses_table .course-list-table-row .name')).to include_text(@course.name)
expect(fj('#my_courses_table .course-list-table-row')).to include_text('This course has not been published.')
end
end
end