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
f0ec2660
Commit
f0ec2660
authored
Mar 22, 2017
by
Robert Raposa
Committed by
Brian Jacobel
Mar 23, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix bokchoy.
parent
14a737ec
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
16 deletions
+9
-16
common/test/acceptance/pages/lms/course_home.py
+9
-16
No files found.
common/test/acceptance/pages/lms/course_home.py
View file @
f0ec2660
...
...
@@ -40,6 +40,11 @@ class CourseOutlinePage(PageObject):
url
=
None
SECTION_SELECTOR
=
'.outline-item.section:nth-of-type({0})'
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'
def
__init__
(
self
,
browser
,
parent_page
):
super
(
CourseOutlinePage
,
self
)
.
__init__
(
browser
)
self
.
parent_page
=
parent_page
...
...
@@ -105,9 +110,7 @@ class CourseOutlinePage(PageObject):
return
# Convert list indices (start at zero) to CSS indices (start at 1)
subsection_css
=
(
".outline-item.section:nth-of-type({0}) .subsection:nth-of-type({1}) .outline-item"
)
.
format
(
section_index
+
1
,
subsection_index
+
1
)
subsection_css
=
self
.
SUBSECTION_SELECTOR
.
format
(
section_index
+
1
,
subsection_index
+
1
)
# Click the subsection and ensure that the page finishes reloading
self
.
q
(
css
=
subsection_css
)
.
first
.
click
()
...
...
@@ -123,25 +126,15 @@ class CourseOutlinePage(PageObject):
"""
Return a list of all section titles on the page.
"""
section_css
=
'.section-name span'
return
self
.
q
(
css
=
section_css
)
.
map
(
lambda
el
:
el
.
text
.
strip
())
.
results
return
self
.
q
(
css
=
self
.
SECTION_TITLES_SELECTOR
)
.
map
(
lambda
el
:
el
.
text
.
strip
())
.
results
def
_subsection_titles
(
self
,
section_index
):
"""
Return a list of all subsection titles on the page
for the section at index `section_index` (starts at 1).
"""
# Retrieve the subsection title for the section
# Add one to the list index to get the CSS index, which starts at one
subsection_css
=
(
# TODO: TNL-6387: Will need to switch to this selector for subsections
# ".outline-item.section:nth-of-type({0}) .subsection span:nth-of-type(1)"
".outline-item.section:nth-of-type({0}) .subsection a"
)
.
format
(
section_index
)
return
self
.
q
(
css
=
subsection_css
)
.
map
(
subsection_css
=
self
.
SUBSECTION_TITLES_SELECTOR
.
format
(
section_index
)
return
self
.
q
(
css
=
subsection_css
)
.
map
(
lambda
el
:
el
.
get_attribute
(
'innerHTML'
)
.
strip
()
)
.
results
...
...
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