demo of testing an app that uses Stripe Checkout with Selenium
Switch branches/tags
Nothing to show
Clone or download
Permalink
Failed to load latest commit information.
.eslintrc.js
.gitignore
.travis.yml explicit chrome version, update README (#7) May 8, 2018
README.md
requirements.txt
run_test.sh
server.py
site.html initial integration demo (#1) Nov 12, 2017
site.js
test.py

README.md

Stripe Checkout / Selenium Demo

This is an unofficial demonstration of how to test a webapp using Stripe Checkout with Selenium in Python. You should already be familiar with https://stripe.com/docs/checkout and have implemented an application using Checkout before reading this.

This code is filled with horrible hacks. If anyone reading this has ideas for improvement, I'm open to them.

It goes something like this:

  1. run_test.sh fetches ChromeDriver runs test.py.

  2. test.py starts a server, server.py.

  3. test.py starts up Chrome, and connects to server.py.

  4. server.py has a simple webapp that lets you specify an amount to pretend-pay, then accepts a pretend payment with Stripe Checkout. test.py uses Selenium to click through this process.

  5. test.py checks that the webapp reports success, and uses a debugging endpoint (/payments) to check that the webapp indeed recorded the fake payment to the server.

  6. test.py repeats this, the second time asking Chrome to emulate an iPhone 5, so the mobile Stripe Checkout interface is tested.

license

This code was written by Madeleine Thompson, who releases it into the public domain.

This code comes with no warranty. Use at your own risk.

The author has no affiliation with Stripe.