Skip to content

Commit

Permalink
add in updated document, and sponsor sport
Browse files Browse the repository at this point in the history
  • Loading branch information
jcblw committed Oct 14, 2022
1 parent 99d185c commit dc68699
Showing 1 changed file with 19 additions and 15 deletions.
34 changes: 19 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,15 @@
## Purpose

This container is available to Github Action because there is some situations ( mostly testing [Chrome Extensions](https://pptr.dev/#?product=Puppeteer&version=v1.18.1&show=api-working-with-chrome-extensions) ) where you can not run Puppeteer in headless mode.
This container is available to Github Action because there are some situations, mostly testing [Chrome Extensions](https://pptr.dev/#?product=Puppeteer&version=v1.18.1&show=api-working-with-chrome-extensions), where you can not run Puppeteer in headless mode.

## Sponsors

<a href="https://chrome.google.com/webstore/detail/muj%C5%8D-be-mindful-of-your-t/pdhdkakfpnlcbipchahefkoaiohkehao" target="_blank"><img src="https://getmujo.com/api/og?name=Puppeteer%20Headful" alt="Mujō - Be mindful with your time" width="400px"></a>

## Usage

This installs Puppeteer ontop of a [NodeJS](https://nodejs.org) container so you have access to run [npm](https://www.npmjs.com) scripts using args. For this hook we hyjack the entrypoint of the [Dockerfile](https://docs.docker.com/engine/reference/builder/) so we can startup [Xvfb](https://www.x.org/releases/X11R7.6/doc/man/man1/Xvfb.1.xhtml) before your testing starts.
This action installs Puppeteer on top of a [NodeJS](https://nodejs.org) container, so you have access to run [npm](https://www.npmjs.com) scripts using args. For this hook, we hijack the entry point of the [Dockerfile](https://docs.docker.com/engine/reference/builder/), so we can start up [Xvfb](https://www.x.org/releases/X11R7.6/doc/man/man1/Xvfb.1.xhtml) before your testing starts.

```yaml
name: CI
Expand All @@ -20,19 +24,19 @@ jobs:
name: Install Dependencies
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@Z
- name: Install Dependencies
uses: actions/setup-node@v2
env:
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: 'true'
with:
args: install
- name: Test Code
uses: mujo-code/puppeteer-headful@v2
env:
CI: 'true'
with:
args: npm test
- uses: actions/checkout@v3
- name: Install Dependencies
uses: actions/setup-node@v2
env:
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: "true"
with:
args: install
- name: Test Code
uses: mujo-code/puppeteer-headful@16.6.0
env:
CI: "true"
with:
args: npm test
```
> Note: You will need to let Puppeteer know not to download Chromium. By setting the env of your install task to PUPPETEER_SKIP_CHROMIUM_DOWNLOAD = 'true' so it does not install conflicting versions of Chromium.
Expand Down

0 comments on commit dc68699

Please sign in to comment.