Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
e7e1f647
Commit
e7e1f647
authored
Jun 02, 2016
by
ssemenova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
replace positive tab index values in the platform
TNL-4705
parent
905c5c56
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
95 additions
and
21 deletions
+95
-21
common/test/acceptance/pages/lms/textbook_view.py
+28
-0
common/test/acceptance/pages/studio/textbook_upload.py
+12
-2
common/test/acceptance/tests/studio/test_studio_general.py
+2
-2
common/test/acceptance/tests/studio/test_studio_textbooks.py
+48
-10
lms/templates/pdf_viewer.html
+0
-0
lms/templates/provider_login.html
+3
-3
lms/templates/static_pdfbook.html
+2
-4
No files found.
common/test/acceptance/pages/lms/textbook_view.py
0 → 100644
View file @
e7e1f647
"""
Course Textbooks page.
"""
from
.course_page
import
CoursePage
from
bok_choy.promise
import
EmptyPromise
class
TextbookViewPage
(
CoursePage
):
"""
Course Textbooks page.
"""
url_path
=
"pdfbook/0/"
def
is_browser_on_page
(
self
):
return
self
.
q
(
css
=
'.book-sidebar'
)
.
present
def
switch_to_pdf_frame
(
self
,
test
):
"""
Waits for pdf frame to load, then switches driver to the frame
"""
EmptyPromise
(
lambda
:
self
.
q
(
css
=
'iframe'
)
.
present
,
"Iframe loaded"
)
.
fulfill
()
driver
=
test
.
get_web_driver
()
driver
.
switch_to_frame
(
driver
.
find_element_by_tag_name
(
"iframe"
))
common/test/acceptance/pages/studio/textbook
s
.py
→
common/test/acceptance/pages/studio/textbook
_upload
.py
View file @
e7e1f647
...
...
@@ -8,7 +8,7 @@ from ..common.utils import click_css
from
.course_page
import
CoursePage
class
Textbook
s
Page
(
CoursePage
):
class
Textbook
Upload
Page
(
CoursePage
):
"""
Course Textbooks page.
"""
...
...
@@ -41,7 +41,7 @@ class TextbooksPage(CoursePage):
Uploads a pdf textbook.
"""
# If the pdf upload section has not yet been toggled on, click on the upload pdf button
test_dir
=
path
(
__file__
)
.
abspath
()
.
dirname
()
.
dirname
()
.
dirname
()
test_dir
=
path
(
__file__
)
.
abspath
()
.
dirname
()
.
dirname
()
.
dirname
()
.
dirname
()
# pylint:disable=no-value-for-parameter
file_path
=
test_dir
+
'/data/uploads/'
+
file_name
click_css
(
self
,
".edit-textbook .action-upload"
,
require_notification
=
False
)
...
...
@@ -70,3 +70,13 @@ class TextbooksPage(CoursePage):
return
False
return
response
.
status_code
==
200
def
upload_new_textbook
(
self
):
"""
Fills out form to upload a new textbook
"""
self
.
open_add_textbook_form
()
self
.
upload_pdf_file
(
'textbook.pdf'
)
self
.
set_input_field_value
(
'.edit-textbook #textbook-name-input'
,
'book_1'
)
self
.
set_input_field_value
(
'.edit-textbook #chapter1-name'
,
'chap_1'
)
self
.
click_textbook_submit_button
()
common/test/acceptance/tests/studio/test_studio_general.py
View file @
e7e1f647
...
...
@@ -18,7 +18,7 @@ from ...pages.studio.settings import SettingsPage
from
...pages.studio.settings_advanced
import
AdvancedSettingsPage
from
...pages.studio.settings_graders
import
GradingPage
from
...pages.studio.signup
import
SignupPage
from
...pages.studio.textbook
s
import
Textbooks
Page
from
...pages.studio.textbook
_upload
import
TextbookUpload
Page
from
...fixtures.course
import
XBlockFixtureDesc
from
base_studio_test
import
StudioCourseTest
...
...
@@ -82,7 +82,7 @@ class CoursePagesTest(StudioCourseTest):
# AssetIndexPage, # TODO: Skip testing this page due to FEDX-88
CourseUpdatesPage
,
PagesPage
,
ExportCoursePage
,
ImportCoursePage
,
CourseTeamPage
,
CourseOutlinePage
,
SettingsPage
,
AdvancedSettingsPage
,
GradingPage
,
Textbook
s
Page
AdvancedSettingsPage
,
GradingPage
,
Textbook
Upload
Page
]
]
...
...
common/test/acceptance/tests/studio/test_studio_textbooks.py
View file @
e7e1f647
...
...
@@ -2,7 +2,8 @@
Acceptance tests for Studio related to the textbooks.
"""
from
common.test.acceptance.tests.studio.base_studio_test
import
StudioCourseTest
from
...pages.studio.textbooks
import
TextbooksPage
from
...pages.studio.textbook_upload
import
TextbookUploadPage
from
...pages.lms.textbook_view
import
TextbookViewPage
from
...tests.helpers
import
disable_animations
from
nose.plugins.attrib
import
attr
...
...
@@ -17,15 +18,17 @@ class TextbooksTest(StudioCourseTest):
Install a course with no content using a fixture.
"""
super
(
TextbooksTest
,
self
)
.
setUp
(
is_staff
)
self
.
textbook_
page
=
Textbooks
Page
(
self
.
textbook_
upload_page
=
TextbookUpload
Page
(
self
.
browser
,
self
.
course_info
[
'org'
],
self
.
course_info
[
'number'
],
self
.
course_info
[
'run'
]
)
self
.
textbook_page
.
visit
()
self
.
textbook_
upload_
page
.
visit
()
disable_animations
(
self
)
self
.
textbook_view_page
=
TextbookViewPage
(
self
.
browser
,
self
.
course_id
)
def
test_create_first_book_message
(
self
):
"""
Scenario: A message is displayed on the textbooks page when there are no uploaded textbooks
...
...
@@ -33,7 +36,7 @@ class TextbooksTest(StudioCourseTest):
And I have not yet uploaded a textbook
Then I see a message stating that I have not uploaded any textbooks
"""
message
=
self
.
textbook_page
.
get_element_text
(
'.wrapper-content .no-textbook-content'
)
message
=
self
.
textbook_
upload_
page
.
get_element_text
(
'.wrapper-content .no-textbook-content'
)
self
.
assertIn
(
"You haven't added any textbooks"
,
message
)
def
test_new_textbook_upload
(
self
):
...
...
@@ -43,9 +46,44 @@ class TextbooksTest(StudioCourseTest):
And I have uploaded a PDF textbook and save the new textbook information
Then the "View Live" link contains a link to the textbook in the LMS
"""
self
.
textbook_page
.
open_add_textbook_form
()
self
.
textbook_page
.
upload_pdf_file
(
'textbook.pdf'
)
self
.
textbook_page
.
set_input_field_value
(
'.edit-textbook #textbook-name-input'
,
'book_1'
)
self
.
textbook_page
.
set_input_field_value
(
'.edit-textbook #chapter1-name'
,
'chap_1'
)
self
.
textbook_page
.
click_textbook_submit_button
()
self
.
assertTrue
(
self
.
textbook_page
.
is_view_live_link_worked
())
self
.
textbook_upload_page
.
upload_new_textbook
()
self
.
assertTrue
(
self
.
textbook_upload_page
.
is_view_live_link_worked
())
@attr
(
'a11y'
)
def
test_textbook_page_a11y
(
self
):
"""
Uploads a new textbook
Runs an accessibility test on the textbook page in lms
"""
self
.
textbook_upload_page
.
upload_new_textbook
()
self
.
textbook_view_page
.
visit
()
self
.
textbook_view_page
.
a11y_audit
.
config
.
set_rules
({
'ignore'
:
[
'color-contrast'
,
# AC-500
'skip-link'
,
# AC-501
'link-href'
,
# AC-502
'section'
# AC-503
],
})
self
.
textbook_view_page
.
a11y_audit
.
check_for_accessibility_errors
()
@attr
(
'a11y'
)
def
test_pdf_viewer_a11y
(
self
):
"""
Uploads a new textbook
Runs an accessibility test on the pdf viewer frame in lms
"""
self
.
textbook_upload_page
.
upload_new_textbook
()
self
.
textbook_view_page
.
visit
()
self
.
textbook_view_page
.
switch_to_pdf_frame
(
self
)
self
.
textbook_view_page
.
a11y_audit
.
config
.
set_rules
({
'ignore'
:
[
'html-lang'
,
# AC-504
'meta-viewport'
,
# AC-505
'skip-link'
,
# AC-506
'link-href'
,
# AC-507
],
})
self
.
textbook_view_page
.
a11y_audit
.
check_for_accessibility_errors
()
lms/templates/pdf_viewer.html
View file @
e7e1f647
This diff is collapsed.
Click to expand it.
lms/templates/provider_login.html
View file @
e7e1f647
...
...
@@ -43,11 +43,11 @@
%endif
<p>
${_("Your username, email, and full name will be sent to {destination}, where the collection and use of this information will be governed by their terms of service and privacy policy.").format(destination=return_to)}
</p>
<label>
${_("E-mail")}
</label>
<input
type=
"text"
name=
"email"
placeholder=
"${_('E-mail')}"
tabindex=
"1"
autofocus=
"autofocus"
/>
<input
type=
"text"
name=
"email"
placeholder=
"${_('E-mail')}"
autofocus=
"autofocus"
/>
<label>
${_("Password")}
</label>
<input
type=
"password"
name=
"password"
placeholder=
"${_('Password')}"
tabindex=
"2"
/>
<input
type=
"password"
name=
"password"
placeholder=
"${_('Password')}"
/>
<div
class=
"submit"
>
<input
name=
"submit"
type=
"submit"
value=
"${_('Return To %s') % return_to}"
tabindex=
"3"
/>
<input
name=
"submit"
type=
"submit"
value=
"${_('Return To %s') % return_to}"
/>
</div>
</form>
</div>
...
...
lms/templates/static_pdfbook.html
View file @
e7e1f647
...
...
@@ -29,7 +29,7 @@ $(function(){
<div
class=
"book-wrapper"
>
%if 'chapters' in textbook:
<section
class=
"book-sidebar"
aria-label=
"${_('Textbook Navigation')}"
>
<ul
id=
"booknav"
tabindex=
"0"
>
<ul
id=
"booknav"
>
% for (index, entry) in enumerate(textbook['chapters']):
<li>
<a
class=
"chapter"
rel=
"${entry['url']}"
href=
"#"
>
${entry.get('title')}
</a>
...
...
@@ -47,8 +47,6 @@ $(function(){
width=
"856"
height=
"1108"
frameborder=
"0"
seamless
tabindex=
"1"
aria-live=
"polite"
></iframe>
seamless
></iframe>
</div>
</div>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment