Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
b9ccc37c
Commit
b9ccc37c
authored
11 years ago
by
Jay Zoldak
Browse files
Options
Downloads
Patches
Plain Diff
Automate more scenarios
parent
7bc997d0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lms/djangoapps/courseware/features/certificates.feature
+8
-4
8 additions, 4 deletions
lms/djangoapps/courseware/features/certificates.feature
lms/djangoapps/courseware/features/certificates.py
+53
-22
53 additions, 22 deletions
lms/djangoapps/courseware/features/certificates.py
with
61 additions
and
26 deletions
lms/djangoapps/courseware/features/certificates.feature
+
8
−
4
View file @
b9ccc37c
...
...
@@ -21,15 +21,19 @@ Feature: Verified certificates
And
I select a contribution amount
And
I confirm that the details match
And
I go to step
"4"
Then
The course is added to my cart
And
I view the payment page
Then
I am at the payment page
Scenario
:
I
can pay for a verified certificate
Given
I have submitted photos to verify my identity
When
I submit valid payment information
Then
I see that my payment was successful
And
I receive an email confirmation
And
I see that I am registered for a verified certificate course on my dashboard
Scenario
:
Verified courses display correctly on dashboard
Given
I have submitted photos to verify my identity
When
I submit valid payment information
And
I navigate to my dashboard
Then
I see the course on my dashboard
And
I see that I am on the verified track
Scenario
:
I
can re-take photos
Given
I have submitted my
"<PhotoType>"
photo
...
...
This diff is collapsed.
Click to expand it.
lms/djangoapps/courseware/features/certificates.py
+
53
−
22
View file @
b9ccc37c
...
...
@@ -5,6 +5,7 @@ from lettuce import world, step
from
lettuce.django
import
django_url
from
course_modes.models
import
CourseMode
from
selenium.common.exceptions
import
WebDriverException
from
nose.tools
import
assert_equal
def
create_cert_course
():
world
.
clear_courses
()
...
...
@@ -105,7 +106,7 @@ def capture_my_photo(step, name):
"
ctx.fillStyle =
'
rgb(200,0,0)
'
;
"
,
"
ctx.fillRect(0, 0, 640, 480);
"
,
"
var image = $(
'
#{}_image
'
);
"
.
format
(
name
),
"
image[0].src = canvas[0].toDataURL(
'
image/png
'
);
"
"
image[0].src = canvas[0].toDataURL(
'
image/png
'
)
.replace(
'
image/png
'
,
'
image/octet-stream
'
)
;
"
)
# Mirror the javascript of the photo_verification.html page
...
...
@@ -113,7 +114,7 @@ def capture_my_photo(step, name):
world
.
browser
.
execute_script
(
"
$(
'
#{}_capture_button
'
).hide();
"
.
format
(
name
))
world
.
browser
.
execute_script
(
"
$(
'
#{}_reset_button
'
).show();
"
.
format
(
name
))
world
.
browser
.
execute_script
(
"
$(
'
#{}_approve_button
'
).show();
"
.
format
(
name
))
assert
world
.
css_
visible
(
'
#{}_approve_button
'
.
format
(
name
))
assert
world
.
css_
find
(
'
#{}_approve_button
'
.
format
(
name
))
@step
(
u
'
I approve my
"
([^
"
]*)
"
photo$
'
)
...
...
@@ -129,7 +130,7 @@ def approve_my_photo(step, name):
# Make sure that the carousel is in the right place
assert
world
.
css_has_class
(
wrapper_css
[
name
],
'
carousel-active
'
)
assert
world
.
css_
visible
(
button_css
[
name
])
assert
world
.
css_
find
(
button_css
[
name
])
# HACK: for now don't bother clicking the approve button for
# id_photo, because it is sending you back to Step 1.
...
...
@@ -158,29 +159,59 @@ def confirm_details_match(step):
assert
world
.
css_find
(
cb_css
).
checked
@step
(
u
'
The course is added to my cart
'
)
def
see_course_is_added_to_my_cart
(
step
):
assert
False
,
'
This step must be implemented
'
@step
(
u
'
I view the payment page
'
)
def
view_the_payment_page
(
step
):
assert
False
,
'
This step must be implemented
'
@step
(
u
'
I am at the payment page
'
)
def
at_the_payment_page
(
step
):
world
.
css_find
(
'
input
'
)
assert_equal
(
world
.
browser
.
title
,
u
'
Payment Form
'
)
@step
(
u
'
I submit valid payment information$
'
)
def
submit_payment
(
step
):
button_css
=
'
input[value=Submit]
'
world
.
css_click
(
button_css
)
@step
(
u
'
I have submitted photos to verify my identity
'
)
def
submitted_photos_to_verify_my_identity
(
step
):
assert
False
,
'
This step must be implemented
'
@step
(
u
'
I submit valid payment information
'
)
def
submit_valid_payment_information
(
step
):
assert
False
,
'
This step must be implemented
'
step
.
given
(
'
I am logged in
'
)
step
.
given
(
'
I select the verified track
'
)
step
.
given
(
'
I go to step
"
1
"'
)
step
.
given
(
'
I capture my
"
face
"
photo
'
)
step
.
given
(
'
I approve my
"
face
"
photo
'
)
step
.
given
(
'
I go to step
"
2
"'
)
step
.
given
(
'
I capture my
"
photo_id
"
photo
'
)
step
.
given
(
'
I approve my
"
photo_id
"
photo
'
)
step
.
given
(
'
I go to step
"
3
"'
)
step
.
given
(
'
I select a contribution amount
'
)
step
.
given
(
'
I confirm that the details match
'
)
step
.
given
(
'
I go to step
"
4
"'
)
@step
(
u
'
I see that my payment was successful
'
)
def
sesee_that_my_payment_was_successful
(
step
):
assert
False
,
'
This step must be implemented
'
@step
(
u
'
I receive an email confirmation
'
)
def
receive_an_email_confirmation
(
step
):
assert
False
,
'
This step must be implemented
'
@step
(
u
'
I see that I am registered for a verified certificate course on my dashboard
'
)
def
see_that_i_am_registered_for_a_verified_certificate_course_on_my_dashboard
(
step
):
assert
False
,
'
This step must be implemented
'
def
see_that_my_payment_was_successful
(
step
):
world
.
css_find
(
'
div
'
)
assert_equal
(
world
.
browser
.
title
,
u
'
Receipt for Order 1
'
)
@step
(
u
'
I navigate to my dashboard
'
)
def
navigate_to_my_dashboard
(
step
):
world
.
css_click
(
'
span.avatar
'
)
assert
world
.
css_find
(
'
section.my-courses
'
)
@step
(
u
'
I see the course on my dashboard
'
)
def
see_the_course_on_my_dashboard
(
step
):
course_link_css
=
'
section.my-courses a[href*=
"
edx/999/Certificates
"
]
'
assert
world
.
is_css_present
(
course_link_css
)
@step
(
u
'
I see that I am on the verified track
'
)
def
see_that_i_am_on_the_verified_track
(
step
):
assert
False
,
'
Implement this step after the design is done
'
@step
(
u
'
I have submitted my
"
([^
"
]*)
"
photo
'
)
def
submitted_my_
group1
_photo
(
step
,
group1
):
def
submitted_my_
foo
_photo
(
step
,
name
):
assert
False
,
'
This step must be implemented
'
@step
(
u
'
I retake my
"
([^
"
]*)
"
photo
'
)
def
retake_my_group1_photo
(
step
,
group1
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment