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
a660cd85
Commit
a660cd85
authored
Apr 22, 2014
by
Jay Zoldak
Committed by
Carson Gee
Apr 23, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set up page objects and base test file for staff view and staff debug.
parent
64a9ec5b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
120 additions
and
0 deletions
+120
-0
common/test/acceptance/pages/lms/staff_view.py
+59
-0
common/test/acceptance/tests/test_staff_view.py
+61
-0
No files found.
common/test/acceptance/pages/lms/staff_view.py
0 → 100644
View file @
a660cd85
"""
Staff view of courseware
"""
from
bok_choy.page_object
import
PageObject
class
StaffPage
(
PageObject
):
"""
View of courseware pages while logged in as course staff
"""
url
=
None
def
is_browser_on_page
(
self
):
return
self
.
q
(
css
=
'#staffstatus'
)
.
present
@property
def
staff_status
(
self
):
"""
Return the current status, either Staff view or Student view
"""
return
self
.
q
(
css
=
'#staffstatus'
)
.
text
[
0
]
def
open_staff_debug_info
(
self
):
"""
Open the staff debug window
Return the page object for it.
"""
self
.
q
(
css
=
'a.instructor-info-action'
)
.
first
.
click
()
staff_debug_page
=
StaffDebugPage
(
self
.
browser
)
staff_debug_page
.
wait_for_page
()
return
staff_debug_page
class
StaffDebugPage
(
PageObject
):
"""
Staff Debug modal
"""
url
=
None
def
is_browser_on_page
(
self
):
return
self
.
q
(
css
=
'section.staff-modal'
)
.
present
def
_click_link
(
self
,
link_text
):
for
link
in
self
.
q
(
css
=
'section.staff-modal a'
)
.
execute
():
if
link
.
text
==
link_text
:
return
link
.
click
()
raise
Exception
(
'Could not find the {} link to click on.'
.
format
(
link_text
))
def
reset_attempts
(
self
):
self
.
_click_link
(
'Reset Attempts'
)
@property
def
idash_msg
(
self
):
self
.
wait_for_ajax
()
return
self
.
q
(
css
=
'#idash_msg'
)
.
text
common/test/acceptance/tests/test_staff_view.py
0 → 100644
View file @
a660cd85
# -*- coding: utf-8 -*-
"""
E2E tests for the LMS.
"""
from
.helpers
import
UniqueCourseTest
from
..pages.studio.auto_auth
import
AutoAuthPage
from
..pages.lms.courseware
import
CoursewarePage
from
..pages.lms.staff_view
import
StaffPage
from
..fixtures.course
import
CourseFixture
,
XBlockFixtureDesc
from
textwrap
import
dedent
class
StaffDebugTest
(
UniqueCourseTest
):
"""
Tests that verify the staff debug info.
"""
def
setUp
(
self
):
super
(
StaffDebugTest
,
self
)
.
setUp
()
self
.
courseware_page
=
CoursewarePage
(
self
.
browser
,
self
.
course_id
)
# Install a course with sections/problems, tabs, updates, and handouts
course_fix
=
CourseFixture
(
self
.
course_info
[
'org'
],
self
.
course_info
[
'number'
],
self
.
course_info
[
'run'
],
self
.
course_info
[
'display_name'
]
)
problem_data
=
dedent
(
"""
<problem markdown="Simple Problem" max_attempts="" weight="">
<p>Choose Yes.</p>
<choiceresponse>
<checkboxgroup direction="vertical">
<choice correct="true">Yes</choice>
</checkboxgroup>
</choiceresponse>
</problem>
"""
)
course_fix
.
add_children
(
XBlockFixtureDesc
(
'chapter'
,
'Test Section'
)
.
add_children
(
XBlockFixtureDesc
(
'sequential'
,
'Test Subsection'
)
.
add_children
(
XBlockFixtureDesc
(
'problem'
,
'Test Problem 1'
,
data
=
problem_data
)
)
)
)
.
install
()
# Auto-auth register for the course.
# Do this as global staff so that you will see the Staff View
AutoAuthPage
(
self
.
browser
,
course_id
=
self
.
course_id
,
staff
=
True
)
.
visit
()
def
test_staff_debug
(
self
):
self
.
courseware_page
.
visit
()
staff_page
=
StaffPage
(
self
.
browser
)
self
.
assertEqual
(
staff_page
.
staff_status
,
'Staff view'
)
staff_debug_page
=
staff_page
.
open_staff_debug_info
()
staff_debug_page
.
reset_attempts
()
msg
=
staff_debug_page
.
idash_msg
self
.
assertEqual
(
'foo'
,
msg
)
# Not sure what is supposed to happen
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