Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-ora2
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-ora2
Commits
bd5bbe38
Commit
bd5bbe38
authored
9 years ago
by
Christina Roberts
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #866 from edx/christina/unique-emails
Update bok choy tests to have unique emails.
parents
c5354e07
b36fae43
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
39 deletions
+44
-39
test/acceptance/accessibility.py
+4
-4
test/acceptance/auto_auth.py
+17
-3
test/acceptance/tests.py
+23
-32
No files found.
test/acceptance/accessibility.py
View file @
bd5bbe38
...
@@ -179,21 +179,21 @@ class FullWorkflowA11yTest(OpenAssessmentA11yTest, FullWorkflowMixin):
...
@@ -179,21 +179,21 @@ class FullWorkflowA11yTest(OpenAssessmentA11yTest, FullWorkflowMixin):
"""
"""
"""
"""
# Create a learner with submission, training, and self assessment completed.
# Create a learner with submission, training, and self assessment completed.
learner
=
self
.
do_submission_training_self_assessment
(
self
.
LEARNER_EMAIL
,
self
.
LEARNER_PASSWORD
)
learner
,
learner_email
=
self
.
do_submission_training_self_assessment
(
)
# Now create a second learner so that learner 1 has someone to assess.
# Now create a second learner so that learner 1 has someone to assess.
# The second learner does all the steps as well (submission, training, self assessment, peer assessment).
# The second learner does all the steps as well (submission, training, self assessment, peer assessment).
self
.
do_submission_training_self_assessment
(
"learner2@foo.com"
,
None
)
self
.
do_submission_training_self_assessment
()
self
.
do_peer_assessment
(
options
=
self
.
PEER_ASSESSMENT
)
self
.
do_peer_assessment
(
options
=
self
.
PEER_ASSESSMENT
)
# Go back to the first learner to complete her workflow.
# Go back to the first learner to complete her workflow.
self
.
login_user
(
learner
)
self
.
login_user
(
learner
,
learner_email
)
# Learner 1 does peer assessment of learner 2 to complete workflow.
# Learner 1 does peer assessment of learner 2 to complete workflow.
self
.
do_peer_assessment
(
options
=
self
.
SUBMITTED_ASSESSMENT
)
self
.
do_peer_assessment
(
options
=
self
.
SUBMITTED_ASSESSMENT
)
# Continue grading by other students if necessary to ensure learner has a peer grade.
# Continue grading by other students if necessary to ensure learner has a peer grade.
self
.
verify_submission_has_peer_grade
(
learner
)
self
.
verify_submission_has_peer_grade
(
learner
,
learner_email
)
# At this point, the learner sees the peer assessment score (0). Verify the accessibility
# At this point, the learner sees the peer assessment score (0). Verify the accessibility
# of the "your grade" section.
# of the "your grade" section.
...
...
This diff is collapsed.
Click to expand it.
test/acceptance/auto_auth.py
View file @
bd5bbe38
...
@@ -82,11 +82,25 @@ class AutoAuthPage(PageObject):
...
@@ -82,11 +82,25 @@ class AutoAuthPage(PageObject):
def
get_username
(
self
):
def
get_username
(
self
):
"""
"""
Finds and returns the username
Finds and returns the username of the current user.
"""
username
,
_
=
self
.
_get_username_and_email
()
return
username
def
get_email
(
self
):
"""
Finds and returns the email address of the current user.
"""
_
,
email
=
self
.
_get_username_and_email
()
return
email
def
_get_username_and_email
(
self
):
"""
Finds and returns the username and email address of the current user.
"""
"""
message
=
self
.
q
(
css
=
'BODY'
)
.
text
[
0
]
.
strip
()
message
=
self
.
q
(
css
=
'BODY'
)
.
text
[
0
]
.
strip
()
match
=
re
.
search
(
r'Logged in user ([^$]+) with password ([^$]+) and user_id ([^$]+)$'
,
message
)
match
=
re
.
search
(
r'Logged in user ([^$]+) with password ([^$]+) and user_id ([^$]+)$'
,
message
)
if
not
match
:
if
not
match
:
return
None
return
None
username_and_email
=
match
.
groups
()[
0
]
username_and_email
=
match
.
groups
()[
0
]
.
split
(
' '
)
return
username_and_email
.
split
(
' '
)[
0
]
return
username_and_email
[
0
],
username_and_email
[
1
]
This diff is collapsed.
Click to expand it.
test/acceptance/tests.py
View file @
bd5bbe38
...
@@ -89,8 +89,7 @@ class OpenAssessmentTest(WebAppTest):
...
@@ -89,8 +89,7 @@ class OpenAssessmentTest(WebAppTest):
[
0
,
2
]
[
0
,
2
]
]
]
LEARNER_EMAIL
=
"learner@foo.com"
TEST_PASSWORD
=
"test_password"
LEARNER_PASSWORD
=
"learner_password"
def
setUp
(
self
,
problem_type
,
staff
=
False
):
def
setUp
(
self
,
problem_type
,
staff
=
False
):
"""
"""
...
@@ -113,17 +112,16 @@ class OpenAssessmentTest(WebAppTest):
...
@@ -113,17 +112,16 @@ class OpenAssessmentTest(WebAppTest):
self
.
staff_asmnt_page
=
AssessmentPage
(
'staff-assessment'
,
self
.
browser
,
self
.
problem_loc
)
self
.
staff_asmnt_page
=
AssessmentPage
(
'staff-assessment'
,
self
.
browser
,
self
.
problem_loc
)
self
.
grade_page
=
GradePage
(
self
.
browser
,
self
.
problem_loc
)
self
.
grade_page
=
GradePage
(
self
.
browser
,
self
.
problem_loc
)
def
login_user
(
self
,
learner
,
email
=
LEARNER_EMAIL
,
password
=
LEARNER_PASSWORD
):
def
login_user
(
self
,
learner
,
email
):
"""
"""
Logs in an already existing user.
Logs in an already existing user.
Args:
Args:
learner (str): the username of the user.
learner (str): the username of the user.
email (str): email (if not specified, LEARNER_EMAIL is used).
email (str): email address of the user.
password (str): password (if not specified, LEARNER_PASSWORD is used).
"""
"""
auto_auth_page
=
AutoAuthPage
(
auto_auth_page
=
AutoAuthPage
(
self
.
browser
,
email
=
email
,
password
=
password
,
username
=
learner
,
self
.
browser
,
email
=
email
,
password
=
self
.
TEST_PASSWORD
,
username
=
learner
,
course_id
=
self
.
TEST_COURSE_ID
,
staff
=
True
course_id
=
self
.
TEST_COURSE_ID
,
staff
=
True
)
)
auto_auth_page
.
visit
()
auto_auth_page
.
visit
()
...
@@ -769,42 +767,35 @@ class FullWorkflowMixin(object):
...
@@ -769,42 +767,35 @@ class FullWorkflowMixin(object):
SUBMITTED_ASSESSMENT
=
[
0
,
3
]
SUBMITTED_ASSESSMENT
=
[
0
,
3
]
STAFF_AREA_SUBMITTED
=
[
'Poor'
,
u''
,
u'0'
,
u'5'
,
u'Excellent'
,
u''
,
u'3'
,
u'3'
]
STAFF_AREA_SUBMITTED
=
[
'Poor'
,
u''
,
u'0'
,
u'5'
,
u'Excellent'
,
u''
,
u'3'
,
u'3'
]
def
do_submission
(
self
,
email
,
password
):
def
do_submission
(
self
):
"""
"""
Creates a user and submission.
Creates a user and submission.
Args:
email (str): email for the new user
password (str): password for the new user
Returns:
Returns:
str: the username
of the newly created user
(str, str): the username and email
of the newly created user
"""
"""
auto_auth_page
=
AutoAuthPage
(
auto_auth_page
=
AutoAuthPage
(
self
.
browser
,
email
=
email
,
password
=
password
,
course_id
=
self
.
TEST_COURSE_ID
,
staff
=
True
self
.
browser
,
password
=
self
.
TEST_PASSWORD
,
course_id
=
self
.
TEST_COURSE_ID
,
staff
=
True
)
)
auto_auth_page
.
visit
()
auto_auth_page
.
visit
()
username
=
auto_auth_page
.
get_username
()
username
=
auto_auth_page
.
get_username
()
email
=
auto_auth_page
.
get_email
()
self
.
submission_page
.
visit
()
.
submit_response
(
self
.
SUBMISSION
)
self
.
submission_page
.
visit
()
.
submit_response
(
self
.
SUBMISSION
)
return
username
return
username
,
email
def
do_submission_training_self_assessment
(
self
,
email
,
password
):
def
do_submission_training_self_assessment
(
self
):
"""
"""
Creates a user and then does submission, training, and self assessment.
Creates a user and then does submission, training, and self assessment.
Args:
email (str): email for the new user
password (str): password for the new user
Returns:
Returns:
str: the username
of the newly created user
(str, str): the username and password
of the newly created user
"""
"""
username
=
self
.
do_submission
(
email
,
password
)
username
,
email
=
self
.
do_submission
(
)
self
.
do_training
()
self
.
do_training
()
self
.
submit_self_assessment
(
self
.
SELF_ASSESSMENT
)
self
.
submit_self_assessment
(
self
.
SELF_ASSESSMENT
)
return
username
return
username
,
email
def
do_train_self_peer
(
self
,
peer_to_grade
=
True
):
def
do_train_self_peer
(
self
,
peer_to_grade
=
True
):
"""
"""
...
@@ -815,23 +806,23 @@ class FullWorkflowMixin(object):
...
@@ -815,23 +806,23 @@ class FullWorkflowMixin(object):
but no peers to submit a grade for learner in return.
but no peers to submit a grade for learner in return.
"""
"""
# Create a learner with submission, training, and self assessment completed.
# Create a learner with submission, training, and self assessment completed.
learner
=
self
.
do_submission_training_self_assessment
(
self
.
LEARNER_EMAIL
,
self
.
LEARNER_PASSWORD
)
learner
,
learner_email
=
self
.
do_submission_training_self_assessment
(
)
# Now create a second learner so that learner 1 has someone to assess.
# Now create a second learner so that learner 1 has someone to assess.
# The second learner does all the steps as well (submission, training, self assessment, peer assessment).
# The second learner does all the steps as well (submission, training, self assessment, peer assessment).
self
.
do_submission_training_self_assessment
(
"learner2@foo.com"
,
None
)
self
.
do_submission_training_self_assessment
()
if
peer_to_grade
:
if
peer_to_grade
:
self
.
do_peer_assessment
(
options
=
self
.
PEER_ASSESSMENT
)
self
.
do_peer_assessment
(
options
=
self
.
PEER_ASSESSMENT
)
# Go back to the first learner to complete her workflow.
# Go back to the first learner to complete her workflow.
self
.
login_user
(
learner
)
self
.
login_user
(
learner
,
learner_email
)
# Learner 1 does peer assessment of learner 2 to complete workflow.
# Learner 1 does peer assessment of learner 2 to complete workflow.
self
.
do_peer_assessment
(
options
=
self
.
SUBMITTED_ASSESSMENT
)
self
.
do_peer_assessment
(
options
=
self
.
SUBMITTED_ASSESSMENT
)
# Continue grading by other students if necessary to ensure learner has a peer grade.
# Continue grading by other students if necessary to ensure learner has a peer grade.
if
peer_to_grade
:
if
peer_to_grade
:
self
.
verify_submission_has_peer_grade
(
learner
)
self
.
verify_submission_has_peer_grade
(
learner
,
learner_email
)
return
learner
return
learner
...
@@ -853,7 +844,7 @@ class FullWorkflowMixin(object):
...
@@ -853,7 +844,7 @@ class FullWorkflowMixin(object):
self
.
assertEqual
(
submitted_assessments
,
self
.
staff_area_page
.
status_text
(
'submitted__assessments'
))
self
.
assertEqual
(
submitted_assessments
,
self
.
staff_area_page
.
status_text
(
'submitted__assessments'
))
self
.
assertEqual
(
self_assessment
,
self
.
staff_area_page
.
status_text
(
'self__assessments'
))
self
.
assertEqual
(
self_assessment
,
self
.
staff_area_page
.
status_text
(
'self__assessments'
))
def
verify_submission_has_peer_grade
(
self
,
learner
,
max_attempts
=
5
):
def
verify_submission_has_peer_grade
(
self
,
learner
,
learner_email
,
max_attempts
=
5
):
"""
"""
If learner does not now have a score, it means that "extra" submissions are in the system,
If learner does not now have a score, it means that "extra" submissions are in the system,
and more need to be scored. Create additional learners and have them grade until learner has
and more need to be scored. Create additional learners and have them grade until learner has
...
@@ -871,9 +862,9 @@ class FullWorkflowMixin(object):
...
@@ -871,9 +862,9 @@ class FullWorkflowMixin(object):
count
=
0
count
=
0
while
not
peer_grade_exists
()
and
count
<
max_attempts
:
while
not
peer_grade_exists
()
and
count
<
max_attempts
:
count
+=
1
count
+=
1
self
.
do_submission_training_self_assessment
(
"extra_{}@looping.com"
.
format
(
count
),
None
)
self
.
do_submission_training_self_assessment
()
self
.
do_peer_assessment
(
options
=
self
.
PEER_ASSESSMENT
)
self
.
do_peer_assessment
(
options
=
self
.
PEER_ASSESSMENT
)
self
.
login_user
(
learner
)
self
.
login_user
(
learner
,
learner_email
)
self
.
assertTrue
(
self
.
assertTrue
(
peer_grade_exists
(),
peer_grade_exists
(),
...
@@ -983,7 +974,7 @@ class FullWorkflowOverrideTest(OpenAssessmentTest, FullWorkflowMixin):
...
@@ -983,7 +974,7 @@ class FullWorkflowOverrideTest(OpenAssessmentTest, FullWorkflowMixin):
And all fields in the staff area tool are correct
And all fields in the staff area tool are correct
"""
"""
# Create only the initial submission before doing the staff override.
# Create only the initial submission before doing the staff override.
learner
=
self
.
do_submission
(
self
.
LEARNER_EMAIL
,
self
.
LEARNER_PASSWORD
)
learner
,
learner_email
=
self
.
do_submission
(
)
# Verify no grade present (and no staff grade section), no assessment information in staff area.
# Verify no grade present (and no staff grade section), no assessment information in staff area.
self
.
assertIsNone
(
self
.
grade_page
.
wait_for_page
()
.
score
)
self
.
assertIsNone
(
self
.
grade_page
.
wait_for_page
()
.
score
)
...
@@ -999,10 +990,10 @@ class FullWorkflowOverrideTest(OpenAssessmentTest, FullWorkflowMixin):
...
@@ -999,10 +990,10 @@ class FullWorkflowOverrideTest(OpenAssessmentTest, FullWorkflowMixin):
self
.
_verify_staff_grade_section
(
self
.
STAFF_GRADE_EXISTS
,
self
.
STAFF_OVERRIDE_LEARNER_STEPS_NOT_COMPLETE
)
self
.
_verify_staff_grade_section
(
self
.
STAFF_GRADE_EXISTS
,
self
.
STAFF_OVERRIDE_LEARNER_STEPS_NOT_COMPLETE
)
# Now create a second learner so that "learner" has someone to assess.
# Now create a second learner so that "learner" has someone to assess.
self
.
do_submission
(
"learner2@foo.com"
,
None
)
self
.
do_submission
()
# Go back to the original learner to complete her workflow and view score.
# Go back to the original learner to complete her workflow and view score.
self
.
login_user
(
learner
)
self
.
login_user
(
learner
,
learner_email
)
# Do training exercise and self assessment
# Do training exercise and self assessment
self
.
student_training_page
.
visit
()
self
.
student_training_page
.
visit
()
...
...
This diff is collapsed.
Click to expand it.
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