Purpose of this document is to help setup and execute Behat tests using Acquia BLT in local using Lando and also use the same on Github Actions.
Fully working example you can check this repo and working Github Actions tests here.
Recently I faced challenges with the setup since I started using the new Apple M1 laptop and most of the docker images don't work as explained in this Stack Overflow discussion as Google Chrome is not available in arm yet for Linux.
I checked and found out that seleniumhq-community has come up with a solution for this, a new set of Docker images which can be used to run tests in Chromium browser. These images work on Intel chip machines as well, so we can use the same for everyone.
Example repository covers
- Setting up and running Behat Tests in local (including JavaScript tests).
- Setting up and running Behat tests via cron job using Github Actions for scheduled testing.
Summary of required changes:
For local:
- Composer package acquia/blt-behat
- Chromedriver in .lando.yml
- Browser configurations detailed out in example.local.yml
For Github Actions:
- Composer package alexku/blt-github-actions
- Chromedriver using Github Actions nanasess/setup-chromedriver, usage of the same can be seen here
- All the scripts to setup and test available here