Open rikukissa opened 8 months ago
@naftis can you make a technical design for this?
we should be able to do it via cypress
@Zangetsu101 that sounds like a good idea – I'm spinning up a Node.js server to respond to incoming webhook requests won't be that difficult inside the cypress code either. Wonder if there's something built-in already @naftis
Description
We need to have guarantees our external APIs won't change, or even worse, break when we release new OpenCRVS versions.
Dev tasks
[ ] In Farajaland, create a directory
e2e/integration
. This directory is what we're going to use for tests verifying integrations to OpenCRVS are stable[ ] Write a test that first fetches
j.campbell
authorization token from auth with an HTTP request[ ] Using APIs, creates a system integration. Save the client id, client secret and sha secret for later to create webhooks.
[ ] Create a new RequestBin using the following 3rd party service. Store the resulting JSON.
[ ] Create a webhook with the client details, set the webhook to send info to the request bin endpoint
https://<data.api_key from JSON data>.x.pipedream.net/
. Give the webhook all permissions.[ ] Get
k.mweene
authorization header using the auth API[ ] Send requests as GraphQL to gateway to
createBirthRegistration
with correct variables. Use the GraphQL type generation to make these type-safe.[ ] Read the
GET https://requestbin-api.pipedream.com/api/v2/events/<data.api_key from JSON data>
endpoint to get the payload OpenCRVS webhooks sent to the request bin.[ ] Create a few different types of births. Consider how many meaningful variations there are in the form; for example "No father available" is a fairly large change so that is at least one variation to test.
[ ] Make sure Github Actions trigger these tests when other E2E are ran