Commit ade62ab9 by Jay Zoldak

Fix acceptance tests to capture images for paid cert flow

parent 8194eedc
...@@ -113,15 +113,9 @@ def goto_next_step(step, step_num): ...@@ -113,15 +113,9 @@ def goto_next_step(step, step_num):
@step(u'I capture my "([^"]*)" photo$') @step(u'I capture my "([^"]*)" photo$')
def capture_my_photo(step, name): def capture_my_photo(step, name):
# Draw a red rectangle in the image element # Hard coded red dot image
snapshot_script = '"{}{}{}{}{}{}"'.format( image_data = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg=='
"var canvas = $('#{}_canvas');".format(name), snapshot_script = "$('#{}_image')[0].src = '{}';".format(name, image_data)
"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');"
)
# Mirror the javascript of the photo_verification.html page # Mirror the javascript of the photo_verification.html page
world.browser.execute_script(snapshot_script) world.browser.execute_script(snapshot_script)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment