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
ade62ab9
Commit
ade62ab9
authored
Sep 12, 2013
by
Jay Zoldak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix acceptance tests to capture images for paid cert flow
parent
8194eedc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
9 deletions
+3
-9
lms/djangoapps/courseware/features/certificates.py
+3
-9
No files found.
lms/djangoapps/courseware/features/certificates.py
View file @
ade62ab9
...
...
@@ -113,15 +113,9 @@ def goto_next_step(step, step_num):
@step
(
u'I capture my "([^"]*)" photo$'
)
def
capture_my_photo
(
step
,
name
):
# Draw a red rectangle in the image element
snapshot_script
=
'"{}{}{}{}{}{}"'
.
format
(
"var canvas = $('#{}_canvas');"
.
format
(
name
),
"var ctx = canvas[0].getContext('2d');"
,
"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').replace('image/png', 'image/octet-stream');"
)
# Hard coded red dot image
image_data
=
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg=='
snapshot_script
=
"$('#{}_image')[0].src = '{}';"
.
format
(
name
,
image_data
)
# Mirror the javascript of the photo_verification.html page
world
.
browser
.
execute_script
(
snapshot_script
)
...
...
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