running-playwright-on-aws-lambda
running-playwright-on-aws-lambda copied to clipboard
Instructions
Would you mind adding instructions for someone not familiar with AWS lambda details?
Is there any configuration like how many instances to run?
How is the information from playwrights retrieved?
Hello @vprelovac (and @Unintendedz, @endonoh0, @AhmedRiyad and @andacg1), I added more informations about deploy and run here: https://github.com/PauloGoncalvesBH/running-playwright-on-aws-lambda#deploying-at-aws-lambda
You can find the configuration of how many instances to run here: https://console.aws.amazon.com/servicequotas/home/services/lambda/quotas
How is the information from playwrights retrieved?
This repository uses Jest to run the Playwright test, so I'm using the Jest's runCLI function to run the test and return the result.
This is done in this small file:
https://github.com/PauloGoncalvesBH/running-playwright-on-aws-lambda/blob/main/lambda/handler.js
This file is used to run the test inside AWS, so what we deploy to AWS is the dockerfile with chromium, our tests with dependencies and this file, which is called by the lambda.
When you run make test-serveless you call this file:
https://github.com/PauloGoncalvesBH/running-playwright-on-aws-lambda/tree/main/serverless-runner
Which is responsible for calling the Lambda function, getting the result and logging into the console.