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
ab7ba280
Commit
ab7ba280
authored
Aug 22, 2012
by
Dean Dieker
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated smart-accordion to iterate through tabs, checking them against the data
parent
e7450a81
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
7 deletions
+19
-7
lms/djangoapps/acceptance_testing/features/smart-accordion.py
+19
-7
No files found.
lms/djangoapps/acceptance_testing/features/smart-accordion.py
View file @
ab7ba280
...
...
@@ -77,24 +77,36 @@ def browse_course(course_id):
## Iterate the chapters
while
chapter_it
<
num_chapters
:
world
.
browser
.
find_element_by_xpath
(
"//*[@id='accordion']//nav//div["
+
str
(
chapter_it
+
1
)
+
"]//h3"
)
.
click
()
num_sections
=
len
(
chapters
[
chapter_it
][
'sections'
])
sections
=
chapters
[
chapter_it
][
'sections'
]
num_sections
=
len
(
sections
)
accordion_class
=
"ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content-active"
rendered_sections
=
len
(
world
.
browser
.
find_elements_by_xpath
(
"//*[@id='accordion']//nav//div["
+
str
(
chapter_it
+
1
)
+
"]//ul//li"
))
assert
num_sections
==
rendered_sections
,
'
%
d sections expected,
%
d sections found on page, iteration number
%
d'
%
(
num_sections
,
rendered_sections
,
chapter_it
)
section_it
=
0
## Iterate the sections
while
section_it
<
num_sections
:
world
.
browser
.
find_element_by_xpath
(
"//*[@id='accordion']//nav//div["
+
str
(
chapter_it
+
1
)
+
"]//ul[@class='"
+
accordion_class
+
"']//li["
+
str
(
section_it
+
1
)
+
"]//a"
)
.
click
()
wait_until_class_renders
(
'p'
,
3
)
section_it
+=
1
wait_until_class_renders
(
'course-content'
,
3
)
#tab = current_course.get_children()[0].get_children()[0]
num_tabs
=
sections
[
section_it
][
'clickable_tab_count'
]
if
num_tabs
!=
0
:
rendered_tabs
=
len
(
world
.
browser
.
find_elements_by_xpath
(
"//ol[@id='sequence-list']//li"
))
else
:
rendered_tabs
=
0
assert
num_tabs
==
rendered_tabs
,
'
%
d tabs expected,
%
d tabs found, iteration number
%
d'
%
(
num_tabs
,
rendered_tabs
,
section_it
)
## Iterate the tabs
tab_it
=
0
while
tab_it
<
num_tabs
:
tab
=
world
.
browser
.
find_element_by_xpath
(
"//ol[@id='sequence-list']//li["
+
str
(
tab_it
+
1
)
+
"]//a[@data-element='"
+
str
(
tab_it
+
1
)
+
"']"
)
tab
.
click
()
tab_it
+=
1
section_it
+=
1
chapter_it
+=
1
...
...
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