Check that your endpoints are working correctly.

Once you're familiar with the API and have started to use the endpoints, we recommend using the following test cases to ensure your calls are functioning properly.

You should run these tests in your Staging Environment to avoid being charged for a completed vision test.

Qualification

For an updated list of eligible regions, please visit our vision test page.

/**
 Test - Qualification endpoint
*/

// positive test case
Show that:
  with an age between 18 and 55
    && with an Rx between -10.00 and +3.50 sphere, 
    -3.00 and -0.25 cylinder, 
    +0.25 and +4.00 in add_power
  && with an eligible region

test returns true

// negative test case
Show that with an age less than 18 test returns false
Show that with an age greater than 55 test returns false
Show that with an Rx less than -10.00 sphere returns false
Show that with an Rx greater than +3.50 sphere test returns false
Show that with an Rx less than -3.00 cylinder test returns false
Show that with an Rx greater than -0.25 cylinder test returns false
Show that with an Rx less than +0.25 add_power test returns false
Show that with an Rx greater than +4.00 add_power test returns false
Show that with an ineligible region test returns false

Sessions

/**
 Test - Session Creation
*/

// positive test case
Show that with a qualified user test returns 201
Show that with a qualified user and an order test returns 201
Show that with a qualified user and an order and prescriptions test returns 201
Show that the created session exists

// negative test case
Show that with a disqualified user test returns 403
/**
 Test - Session Update
*/

// positive test case
Update a created, not-started session
	Show that an updated order is changed correctly
	Show that an updated prescription is changed correctly

// negative test case
Show that order does not update on a started test
Show that prescriptions do not update on a started test
/**
 Test - Session Cancel
*/

// positive test case
Show that cancelling a newly-created session cancels the session

// negative test case
Show that cancelling a session that has already entered the experience does not cancel the session
/**
 Test - Session Get
*/

// positive test case
Show that requesting sessions for a user returns a paginated response of their sessions
Show that requesting a session for a user with a specific session key returns an individual record

// negative test case
Show that requesting sessions for a user that does not exist returns []
Show that requesting a session that does not exist returns 404

Authentication

/**
 Test - Authentication endpoint
*/

// positive test case
Show that with a valid user and active session an authentication link is made
	&& the auth link redirects into the experience
If you set up a proxy domain, show that the link is redirecting properly
If you set up white labeling, show that the requested branding appears on the site

// negative test case
Show that an invalid user returns 404
Show that an inactive session returns 404

Events

/**
 Test - Events endpoints
*/

Show that Session Updated events are received upon user activity

Upon Exam Completion, contact our team to dispense or reject the test for you.
  Show that a dispensed Rx is received
  Show that a rejected Rx is received