E2E tests here are written with Playwright. Without further ado, let's meet below below
- Do you still not have node installed? You'll be needing it.
- You also need zip files of Backwpup pro, I'll explain:
- zip the latest release - rename the zip file name to
backwpup-pro.zip. e.gbackwpup-5.3.1.zipbecomesbackwpup-pro.zip - Make sure to put the file in the
./pluginfolder in the root - Playwright will pick these files when needed and use them during tests. - To generate the zip, you can follow the steps here
- zip the latest release - rename the zip file name to
- Clone this repo
- run a
npm installto install dependencies, well for this case it's just playwright. - Additionally, in some cases on a fresh install you might also need to run
npx playwright installto download the various browser engines as well.
You'll need to update the site you want to run tests on as well as the credentials.
Update the wp.config.sample.ts to wp.config.ts in https://github.com/wp-media/wp-rocket-e2e/blob/trunk/config/
Change the live_username & live_password & WP_BASE_URL to that of your test site.
You can find this here
- Please delete forget to delete the backup after running your tests, We will automate this step in the future.
- To run tests on playwright, simply run
npm run test:bwpupsmokewhich ever you prefer.
NB: By default, test will run in headless mode.
Use npx playwright test --debug to control and get a view of each test step.
You can also run npx playwright test --headed to view the tests being executed on the browser.
- Add option for backwpup free plugin
- Create helper function to read debug.log content