Commit 1d07b278 by Chris Rodriguez

Test fixes

parent a31eb4a8
......@@ -82,7 +82,7 @@ class CourseNavPage(PageObject):
# Click the section to ensure it's open (no harm in clicking twice if it's already open)
# Add one to convert from list index to CSS index
section_css = 'nav>div.chapter:nth-of-type({0})'.format(sec_index + 1)
section_css = 'nav>.chapter:nth-of-type({0})'.format(sec_index + 1)
self.q(css=section_css).first.click()
# Get the subsection by index
......@@ -94,7 +94,7 @@ class CourseNavPage(PageObject):
return
# Convert list indices (start at zero) to CSS indices (start at 1)
subsection_css = "nav>div.chapter-content-container:nth-of-type({0})>div>ol>li:nth-of-type({1})>a".format(
subsection_css = "nav>.chapter-content-container:nth-of-type({0})>.chapter-menu:nth-of-type({1})>a".format(
sec_index + 1, subsec_index + 1
)
......@@ -130,7 +130,7 @@ class CourseNavPage(PageObject):
"""
Return a list of all section titles on the page.
"""
chapter_css = 'nav > button.chapter > h3'
chapter_css = 'nav > .chapter > .group-heading'
return self.q(css=chapter_css).map(lambda el: el.text.strip()).results
def _subsection_titles(self, section_index):
......@@ -140,7 +140,7 @@ class CourseNavPage(PageObject):
"""
# Retrieve the subsection title for the section
# Add one to the list index to get the CSS index, which starts at one
subsection_css = 'nav>.chapter-content-container:nth-of-type({0})>div>ol>li>a>p:nth-of-type(1)'.format(
subsection_css = 'nav>.chapter-content-container:nth-of-type({0})>.chapter-menu>a>p:nth-of-type(1)'.format(
section_index
)
......@@ -173,8 +173,8 @@ class CourseNavPage(PageObject):
That's true right after we click the section/subsection, but not true in general
(the user could go to a section, then expand another tab).
"""
current_section_list = self.q(css='nav>button.chapter.is-open>h3').text
current_subsection_list = self.q(css='nav div.chapter-content-container ol li.active>a>p').text
current_section_list = self.q(css='nav>.chapter.is-open>.group-heading').text
current_subsection_list = self.q(css='nav .chapter-content-container a.active>p').text
if len(current_section_list) == 0:
self.warning("Could not find the current section")
......
......@@ -14,7 +14,7 @@ class CoursewarePage(CoursePage):
url_path = "courseware/"
xblock_component_selector = '.vert .xblock'
section_selector = '.chapter'
subsection_selector = '.chapter-content-container ol li'
subsection_selector = '.chapter-content-container .chapter-menu a'
def is_browser_on_page(self):
return self.q(css='body.courseware').present
......@@ -102,7 +102,7 @@ class CoursewarePage(CoursePage):
"""
return the url of the active subsection in the left nav
"""
return self.q(css='.chapter-content-container ol li.active a').attrs('href')[0]
return self.q(css='.chapter-content-container .chapter-menu a.active').attrs('href')[0]
@property
def can_start_proctored_exam(self):
......
......@@ -1121,7 +1121,7 @@ class EntranceExamTest(UniqueCourseTest):
When I view the courseware that has an entrance exam
Then there should be an "Entrance Exam" chapter.'
"""
entrance_exam_link_selector = 'div#accordion nav button h3'
entrance_exam_link_selector = '#accordion nav .chapter .group-heading'
# visit courseware page and make sure there is not entrance exam chapter.
self.courseware_page.visit()
self.courseware_page.wait_for_page()
......
......@@ -10,14 +10,14 @@
</button>
<div class="chapter-content-container" tabindex="-1" aria-expanded="true">
<div class="chapter-menu" id="accordion-menu-1">
<a href="http://www.edx.org">
<a href="#">
<p>edX Homepage</p>
<p class="subtitle">Ungraded</p>
</a>
<a class="active" href="http://blog.edx.org">
<a class="active" href="#">
<p>The edX Blog</p>
</a>
<a class="graded" href="http://courses.edx.org">
<a class="graded" href="#">
<p>Courses Dashboard</p>
<p class="subtitle">Graded</p>
</a>
......@@ -30,14 +30,14 @@
</button>
<div class="chapter-content-container" tabindex="-1" aria-expanded="false">
<div class="chapter-menu" id="accordion-menu-2">
<a href="http://www.edx.org">
<a href="#">
<p>edX Homepage</p>
<p class="subtitle">Ungraded</p>
</a>
<a href="http://blog.edx.org">
<a href="#">
<p>The edX Blog</p>
</a>
<a class="graded" href="http://courses.edx.org">
<a class="graded" href="#">
<p>Courses Dashboard</p>
<p class="subtitle">Graded</p>
</a>
......
......@@ -25,11 +25,7 @@ var edx = edx || {},
active = $('#accordion div div:has(a.active)').index('#accordion div div');
if (active < 0) {
active = $('#accordion group-heading.active').index('#accordion h3');
}
if (active < 0) {
if (typeof active === 'undefined' || active < 0) {
active = 0;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment