Skip to content

Commit

Permalink
test: puppeteer@23 (#586)
Browse files Browse the repository at this point in the history
* test: [email protected]

* test: update snapshots

* test: use latest

* test: update snapshot

* build: update jimp

* docs: avoid isIncognito

* chore: turn uint8array into buffer
  • Loading branch information
Kikobeats authored Aug 13, 2024
1 parent 0be3e00 commit 8103e6b
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 18 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ It returns the internal [Browser](https://github.com/puppeteer/puppeteer/blob/v1
const headlessBrowser = await browser.browser()

console.log('My headless browser PID is', headlessBrowser.process().pid)
console.log('My headless browser version is', await headlessBrowser.version())
```

### .respawn()
Expand Down Expand Up @@ -761,8 +762,8 @@ It returns the [BrowserContext](https://github.com/puppeteer/puppeteer/blob/main
```js
const browserContext = await browserless.context()

console.log({ isIncognito: browserContext.isIncognito() })
// => { isIncognito: true }
console.log(browserContext.id)
// => 'D2CD28FDECB1859772B9C5919E563C84'
```

### .withPage(fn, [options])
Expand Down
4 changes: 2 additions & 2 deletions packages/goto/test/unit/evasions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ test('webgl vendor is not bot', async t => {
}
: {
vendor: 'Google Inc. (Apple)',
renderer: 'ANGLE (Apple, Apple M1 Pro, OpenGL 4.1)'
renderer: 'ANGLE (Apple, ANGLE Metal Renderer: Apple M1 Pro, Unspecified Version)'
}

t.deepEqual(await webgl(), expected)
Expand Down Expand Up @@ -213,7 +213,7 @@ test('webgl2 vendor is not bot', async t => {
}
: {
vendor: 'Google Inc. (Apple)',
renderer: 'ANGLE (Apple, Apple M1 Pro, OpenGL 4.1)'
renderer: 'ANGLE (Apple, ANGLE Metal Renderer: Apple M1 Pro, Unspecified Version)'
}

t.deepEqual(await webgl2(), expected)
Expand Down
2 changes: 1 addition & 1 deletion packages/screenshot/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"got": "~11.8.6",
"is-html-content": "~1.0.0",
"is-url-http": "~2.3.7",
"jimp": "~0.22.10",
"jimp": "~0.22.12",
"map-values-deep": "~1.0.2",
"mime": "~3.0.0",
"p-reflect": "~2.1.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/screenshot/src/is-white-screenshot.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

const jimp = require('jimp')

module.exports = async buffer => {
const image = await jimp.read(buffer)
module.exports = async uint8array => {
const image = await jimp.read(Buffer.from(uint8array))
const firstPixel = image.getPixelColor(0, 0)
const height = image.getHeight()
const width = image.getWidth()
Expand Down
5 changes: 3 additions & 2 deletions packages/screenshot/test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,13 @@ test('graphics features', async t => {
OpenGL: 'Enabled',
Rasterization: 'Hardware accelerated',
'Raw Draw': 'Disabled',
'Skia Graphite': 'Disabled',
'Skia Graphite': 'Enabled',
'Video Decode': 'Hardware accelerated',
'Video Encode': 'Hardware accelerated',
WebGL: 'Hardware accelerated',
WebGL2: 'Hardware accelerated',
WebGPU: 'Hardware accelerated'
WebGPU: 'Hardware accelerated',
WebNN: 'Disabled'
}
)
})
18 changes: 9 additions & 9 deletions packages/screenshot/test/snapshots/pretty.js.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,15 +166,15 @@ Generated by [AVA](https://avajs.dev).
<style>#screenshot code.language-js{font-family:"Roboto Mono"}</style><style>#screenshot .token{color:#f81ce5}</style></head>␊
<body id="screenshot">␊
<pre class="language-js" tabindex="0"><code class="language-js"><span class="token punctuation">{</span>␊
<span class="token string-property property">"version"</span><span class="token operator">:</span> <span class="token number">2</span><span class="token punctuation">,</span>␊
<span class="token string-property property">"status"</span><span class="token operator">:</span> <span class="token string">"success"</span><span class="token punctuation">,</span>␊
<span class="token string-property property">"data"</span><span class="token operator">:</span> <span class="token punctuation">{</span>␊
<span class="token string-property property">"emoji"</span><span class="token operator">:</span> <span class="token string">" an URL for getting conte…"</span><span class="token punctuation">,</span>␊
<span class="token string-property property">"vendor"</span><span class="token operator">:</span> <span class="token string">"[optional] The vendor look and feel…"</span>␊
<span class="token punctuation">}</span><span class="token punctuation">,</span>␊
<span class="token string-property property">"example"</span><span class="token operator">:</span> <span class="token string">"https://emojipedia-api.vercel.app?e…"</span><span class="token punctuation">,</span>␊
<span class="token string-property property">"message"</span><span class="token operator">:</span> <span class="token string">"Welcome to Emojipedia unofficial AP…"</span><span class="token punctuation">,</span>␊
<span class="token string-property property">"author"</span><span class="token operator">:</span> <span class="token string">"https://twitter.com/Kikobeats"</span>␊
<span class="token string-property property">"version"</span><span class="token operator">:</span> <span class="token number">2</span><span class="token punctuation">,</span>␊
<span class="token string-property property">"status"</span><span class="token operator">:</span> <span class="token string">"success"</span><span class="token punctuation">,</span>␊
<span class="token string-property property">"data"</span><span class="token operator">:</span> <span class="token punctuation">{</span>␊
<span class="token string-property property">"emoji"</span><span class="token operator">:</span> <span class="token string">" an URL for getting conte…"</span><span class="token punctuation">,</span>␊
<span class="token string-property property">"vendor"</span><span class="token operator">:</span> <span class="token string">"[optional] The vendor look and feel…"</span>␊
<span class="token punctuation">}</span><span class="token punctuation">,</span>␊
<span class="token string-property property">"example"</span><span class="token operator">:</span> <span class="token string">"https://emojipedia-api.vercel.app?e…"</span><span class="token punctuation">,</span>␊
<span class="token string-property property">"message"</span><span class="token operator">:</span> <span class="token string">"Welcome to Emojipedia unofficial AP…"</span><span class="token punctuation">,</span>␊
<span class="token string-property property">"author"</span><span class="token operator">:</span> <span class="token string">"https://twitter.com/Kikobeats"</span>␊
<span class="token punctuation">}</span></code></pre>␊
<script>/* PrismJS 1.29.0␊
https://prismjs.com/download.html#themes=prism&languages=clike+javascript */␊
Expand Down
Binary file modified packages/screenshot/test/snapshots/pretty.js.snap
Binary file not shown.

0 comments on commit 8103e6b

Please sign in to comment.