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
d3115f3c
Commit
d3115f3c
authored
Dec 12, 2015
by
solashirai
Committed by
solashirai
Mar 26, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
quality fixes
parent
d59b5fb8
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
1 deletions
+26
-1
openedx/tests/xblock_integration/pages/crowdsourcehinter_problem.py
+25
-0
openedx/tests/xblock_integration/test_crowdsourcehinter_problem.py
+1
-1
No files found.
openedx/tests/xblock_integration/pages/crowdsourcehinter_problem.py
View file @
d3115f3c
"""
PageObject for Crowdsourcehinter
"""
from
bok_choy.page_object
import
PageObject
class
CrowdsourcehinterProblemPage
(
PageObject
):
"""
A PageObject representing the Crowdsourcehinter xblock.
"""
url
=
None
def
__init__
(
self
,
browser
,
context_selector
):
"""
Args:
browser (selenium.webdriver): The Selenium-controlled browser that this page is loaded in.
"""
super
(
CrowdsourcehinterProblemPage
,
self
)
.
__init__
(
browser
)
if
isinstance
(
context_selector
,
unicode
):
context_selector
=
context_selector
.
encode
(
'utf-8'
)
self
.
context_selector
=
context_selector
def
is_browser_on_page
(
self
):
return
len
(
self
.
browser
.
find_elements_by_class_name
(
'crowdsourcehinter_block'
))
>
0
...
...
@@ -23,13 +39,22 @@ class CrowdsourcehinterProblemPage(PageObject):
return
self
.
q
(
css
=
'div.csh_hint_text'
)
.
text
def
get_student_answer_text
(
self
):
"""
Check the student answer is set correctly
"""
return
self
.
q
(
css
=
'div.csh_hint_text'
)
.
attrs
(
'student_answer'
)
def
rate_hint
(
self
):
"""
Click the rate_hint button
"""
self
.
q
(
css
=
'div.csh_rate_hint'
)
.
click
()
self
.
wait_for_ajax
()
def
submit_new_hint
(
self
,
text
):
"""
Fill in the textbox and submit a new hint
"""
self
.
q
(
css
=
'.csh_student_hint_creation input[type="button"]'
)
.
click
()
self
.
wait_for_ajax
()
self
.
q
(
css
=
'.csh_student_text_input input[type="text"]'
)
.
fill
(
text
)
...
...
openedx/tests/xblock_integration/test_crowdsourcehinter_problem.py
View file @
d3115f3c
...
...
@@ -4,7 +4,7 @@ Javascript tests for the crowdsourcehinter xblock
from
textwrap
import
dedent
from
common.test.acceptance.fixtures.course
import
CourseFixture
,
XBlockFixtureDesc
from
common.test.acceptance.pages.lms.courseware
import
CoursewarePage
from
pages.crowdsourcehinter_problem
import
CrowdsourcehinterProblemPage
from
openedx.tests.xblock_integration.
pages.crowdsourcehinter_problem
import
CrowdsourcehinterProblemPage
from
common.test.acceptance.pages.studio.auto_auth
import
AutoAuthPage
from
common.test.acceptance.tests.helpers
import
UniqueCourseTest
...
...
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