This repository contains an example of how to end-to-end test the Chrome Developers Hello Extensions Chrome extension using Puppeteer.
This repository has been created as part of the following blog post: End-to-end testing a Chrome extension using Puppeteer
This repository contains a number of different Branches. These branches enable you to jump to a particular part of the code referenced in the blog post.
Hello-Extensions
- The exampleHello Extensions
Chrome Extension code taken from the Chrome Developers Hello Extensions Development basics tutorial.Hello-Extensions-Updated-Structure
- Extension restructured following Structuring an extension project.Puppeteer
- Testing the Hello-Extensions Chrome extension end-to-end using Puppeteer
To check out this repository and a particular branch:
git clone -b THE-BRANCH-NAME git@github.com:vivrichards600/puppeteer-extension-example.git
Alternatively, If you've already cloned the repository you can just switch to the branch you'd like:
git checkout THE-BRANCH-NAME
Replace THE-BRANCH-NAME with a branch from the Branches
section i.e. Hello-Extensions
or Hello-Extensions-Updated-Structure
The Puppeteer example test can be found here.
In order to run this test you will need to:
- Run
npm install
to install the required npm packages for the end-to-end test. This is only required to be done the first time open this project - To run the Puppeteer end-to-end test run
npm test