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
a9b308e5
Commit
a9b308e5
authored
Nov 24, 2015
by
Christine Lytwynec
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Convert some problem type tests to bok choy and add a11y test
parent
44eaca08
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
76 deletions
+19
-76
common/test/acceptance/pages/lms/problem.py
+11
-2
common/test/acceptance/tests/lms/test_lms_problems.py
+8
-7
common/test/acceptance/tests/lms/test_problem_types.py
+0
-0
lms/djangoapps/courseware/features/problems.feature
+0
-67
No files found.
common/test/acceptance/pages/lms/problem.py
View file @
a9b308e5
...
...
@@ -71,11 +71,20 @@ class ProblemPage(PageObject):
description
=
"MathJax rendered in hint"
)
def
fill_answer
(
self
,
text
):
def
fill_answer
(
self
,
text
,
input_num
=
None
):
"""
Fill in the answer to the problem.
args:
text: String to fill the input with.
kwargs:
input_num: If provided, fills only the input_numth field. Else, all
input fields will be filled.
"""
self
.
q
(
css
=
'div.problem div.capa_inputtype.textline input'
)
.
fill
(
text
)
fields
=
self
.
q
(
css
=
'div.problem div.capa_inputtype.textline input'
)
fields
=
fields
.
nth
(
input_num
)
if
input_num
is
not
None
else
fields
fields
.
fill
(
text
)
def
fill_answer_numerical
(
self
,
text
):
"""
...
...
common/test/acceptance/tests/lms/test_lms_problems.py
View file @
a9b308e5
...
...
@@ -19,13 +19,14 @@ class ProblemsTest(UniqueCourseTest):
"""
Base class for tests of problems in the LMS.
"""
USERNAME
=
"joe_student"
EMAIL
=
"joe@example.com"
PASSWORD
=
"keep it secret; keep it safe."
def
setUp
(
self
):
super
(
ProblemsTest
,
self
)
.
setUp
()
self
.
username
=
"test_student_{uuid}"
.
format
(
uuid
=
self
.
unique_id
[
0
:
8
])
self
.
email
=
"{username}@example.com"
.
format
(
username
=
self
.
username
)
self
.
password
=
"keep it secret; keep it safe."
self
.
xqueue_grade_response
=
None
self
.
courseware_page
=
CoursewarePage
(
self
.
browser
,
self
.
course_id
)
...
...
@@ -46,9 +47,9 @@ class ProblemsTest(UniqueCourseTest):
# Auto-auth register for the course.
AutoAuthPage
(
self
.
browser
,
username
=
self
.
USERNAME
,
email
=
self
.
EMAIL
,
password
=
self
.
PASSWORD
,
username
=
self
.
username
,
email
=
self
.
email
,
password
=
self
.
password
,
course_id
=
self
.
course_id
,
staff
=
False
)
.
visit
()
...
...
@@ -382,7 +383,7 @@ class LogoutDuringAnswering(ProblemsTest):
login_page
=
CombinedLoginAndRegisterPage
(
self
.
browser
)
login_page
.
wait_for_page
()
login_page
.
login
(
self
.
EMAIL
,
self
.
PASSWORD
)
login_page
.
login
(
self
.
email
,
self
.
password
)
problem_page
.
wait_for_page
()
self
.
assertEqual
(
problem_page
.
problem_name
,
'TEST PROBLEM'
)
...
...
common/test/acceptance/tests/lms/test_problem_types.py
0 → 100644
View file @
a9b308e5
This diff is collapsed.
Click to expand it.
lms/djangoapps/courseware/features/problems.feature
View file @
a9b308e5
...
...
@@ -4,73 +4,6 @@ Feature: LMS.Answer problems
In order to test my understanding of the material
I want to answer problems
Scenario
:
I
can answer a problem correctly
Given
External graders respond
"correct"
And
I am viewing a
"<ProblemType>"
problem
When
I answer a
"<ProblemType>"
problem
"correctly"
Then
my
"<ProblemType>"
answer is marked
"correct"
And
The
"<ProblemType>"
problem displays a
"correct"
answer
And
a
"problem_check"
server event is emitted
And
a
"problem_check"
browser event is emitted
Examples
:
|
ProblemType
|
|
drop
down
|
|
multiple
choice
|
|
checkbox
|
|
radio
|
#| string |
|
numerical
|
|
formula
|
|
script
|
|
code
|
|
radio_text
|
|
checkbox_text
|
|
image
|
Scenario
:
I
can answer a problem incorrectly
Given
External graders respond
"incorrect"
And
I am viewing a
"<ProblemType>"
problem
When
I answer a
"<ProblemType>"
problem
"incorrectly"
Then
my
"<ProblemType>"
answer is marked
"incorrect"
And
The
"<ProblemType>"
problem displays a
"incorrect"
answer
Examples
:
|
ProblemType
|
|
drop
down
|
|
multiple
choice
|
|
checkbox
|
|
radio
|
#| string |
|
numerical
|
|
formula
|
|
script
|
|
code
|
|
radio_text
|
|
checkbox_text
|
|
image
|
Scenario
:
I
can submit a blank answer
Given
I am viewing a
"<ProblemType>"
problem
When
I check a problem
Then
my
"<ProblemType>"
answer is marked
"incorrect"
And
The
"<ProblemType>"
problem displays a
"blank"
answer
Examples
:
|
ProblemType
|
|
drop
down
|
|
multiple
choice
|
|
checkbox
|
|
radio
|
#| string |
|
numerical
|
|
formula
|
|
script
|
|
radio_text
|
|
checkbox_text
|
|
image
|
Scenario
:
I
can reset a problem
Given
I am viewing a randomization
"<Randomization>"
"<ProblemType>"
problem with reset button on
And
I answer a
"<ProblemType>"
problem
"<Correctness>ly"
...
...
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