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
205b5380
Commit
205b5380
authored
Mar 23, 2017
by
Robert Raposa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Resume Course tests.
parent
f0ec2660
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
7 deletions
+37
-7
common/test/acceptance/pages/lms/course_home.py
+27
-7
common/test/acceptance/tests/lms/test_lms.py
+10
-0
No files found.
common/test/acceptance/pages/lms/course_home.py
View file @
205b5380
...
...
@@ -16,6 +16,8 @@ class CourseHomePage(CoursePage):
url_path
=
"course/"
HEADER_RESUME_COURSE_SELECTOR
=
'.page-header .action-resume-course'
def
is_browser_on_page
(
self
):
return
self
.
q
(
css
=
'.course-outline'
)
.
present
...
...
@@ -32,6 +34,14 @@ class CourseHomePage(CoursePage):
bookmarks_page
=
BookmarksPage
(
self
.
browser
,
self
.
course_id
)
bookmarks_page
.
visit
()
def
resume_course_from_header
(
self
):
"""
Navigate to courseware using Resume Course button in the header.
"""
self
.
q
(
css
=
self
.
HEADER_RESUME_COURSE_SELECTOR
)
.
first
.
click
()
courseware_page
=
CoursewarePage
(
self
.
browser
,
self
.
course_id
)
courseware_page
.
wait_for_page
()
class
CourseOutlinePage
(
PageObject
):
"""
...
...
@@ -44,11 +54,11 @@ class CourseOutlinePage(PageObject):
SECTION_TITLES_SELECTOR
=
'.section-name span'
SUBSECTION_SELECTOR
=
SECTION_SELECTOR
+
' .subsection:nth-of-type({1}) .outline-item'
SUBSECTION_TITLES_SELECTOR
=
SECTION_SELECTOR
+
' .subsection a span:first-child'
OUTLINE_RESUME_COURSE_SELECTOR
=
'.outline-item .resume-right'
def
__init__
(
self
,
browser
,
parent_page
):
super
(
CourseOutlinePage
,
self
)
.
__init__
(
browser
)
self
.
parent_page
=
parent_page
self
.
courseware_page
=
CoursewarePage
(
self
.
browser
,
self
.
parent_page
.
course_id
)
def
is_browser_on_page
(
self
):
return
self
.
parent_page
.
is_browser_on_page
...
...
@@ -114,14 +124,17 @@ class CourseOutlinePage(PageObject):
# Click the subsection and ensure that the page finishes reloading
self
.
q
(
css
=
subsection_css
)
.
first
.
click
()
self
.
courseware_page
.
wait_for_page
()
# TODO: TNL-6546: Remove this if/visit_unified_course_view
if
self
.
parent_page
.
unified_course_view
:
self
.
courseware_page
.
nav
.
visit_unified_course_view
()
self
.
_wait_for_course_section
(
section_title
,
subsection_title
)
def
resume_course_from_outline
(
self
):
"""
Navigate to courseware using Resume Course button in the header.
"""
self
.
q
(
css
=
self
.
OUTLINE_RESUME_COURSE_SELECTOR
)
.
first
.
click
()
courseware_page
=
CoursewarePage
(
self
.
browser
,
self
.
parent_page
.
course_id
)
courseware_page
.
wait_for_page
()
def
_section_titles
(
self
):
"""
Return a list of all section titles on the page.
...
...
@@ -142,7 +155,14 @@ class CourseOutlinePage(PageObject):
"""
Ensures the user navigates to the course content page with the correct section and subsection.
"""
courseware_page
=
CoursewarePage
(
self
.
browser
,
self
.
parent_page
.
course_id
)
courseware_page
.
wait_for_page
()
# TODO: TNL-6546: Remove this if/visit_unified_course_view
if
self
.
parent_page
.
unified_course_view
:
courseware_page
.
nav
.
visit_unified_course_view
()
self
.
wait_for
(
promise_check_func
=
lambda
:
self
.
courseware_page
.
nav
.
is_on_section
(
section_title
,
subsection_title
),
promise_check_func
=
lambda
:
courseware_page
.
nav
.
is_on_section
(
section_title
,
subsection_title
),
description
=
"Waiting for course page with section '{0}' and subsection '{1}'"
.
format
(
section_title
,
subsection_title
)
)
common/test/acceptance/tests/lms/test_lms.py
View file @
205b5380
...
...
@@ -860,6 +860,16 @@ class HighLevelTabTest(UniqueCourseTest):
bookmarks_page
=
BookmarksPage
(
self
.
browser
,
self
.
course_id
)
self
.
assertTrue
(
bookmarks_page
.
is_browser_on_page
())
# Test "Resume Course" button from header
self
.
course_home_page
.
visit
()
self
.
course_home_page
.
resume_course_from_header
()
self
.
assertTrue
(
self
.
courseware_page
.
nav
.
is_on_section
(
'Test Section 2'
,
'Test Subsection 3'
))
# Test "Resume Course" button from within outline
self
.
course_home_page
.
visit
()
self
.
course_home_page
.
outline
.
resume_course_from_outline
()
self
.
assertTrue
(
self
.
courseware_page
.
nav
.
is_on_section
(
'Test Section 2'
,
'Test Subsection 3'
))
@attr
(
'a11y'
)
def
test_course_home_a11y
(
self
):
self
.
course_home_page
.
visit
()
...
...
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