Skip to content

Commit

Permalink
Merge pull request #2053 from oasisprotocol/lw/screenshot-size
Browse files Browse the repository at this point in the history
Fix Chrome Webstore image dimensions
  • Loading branch information
lukaw3d authored Sep 7, 2024
2 parents 899efa5 + aaf1f27 commit dc5b937
Show file tree
Hide file tree
Showing 10 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions .changelog/2053.trivial.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update screenshot size
9 changes: 6 additions & 3 deletions playwright/screenshots/chrome-webstore-screenshots.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ const screenshotCss = `
`

const chromeWebStoreDimensions = {
width: 1200,
width: 1280,
height: 800,
}

/** Scale for higher quality larger screenshots */
const deviceScaleFactor = (chromeWebStoreDimensions.height - 20) / extensionViewport.height
const deviceScaleFactor = chromeWebStoreDimensions.height / extensionViewport.height
test.use({
deviceScaleFactor: deviceScaleFactor,
viewport: {
Expand All @@ -36,7 +36,7 @@ async function setup(page: Page, url: string) {
}
iframe {
width: ${extensionViewport.width}px;
height: ${extensionViewport.height}px;
height: ${extensionViewport.height * 0.975}px;
border: 5px solid #0500e2;
}
</style>
Expand All @@ -53,6 +53,9 @@ test.beforeEach(async ({ context }) => {
})

test('make screenshots for Chrome Web Store', async ({ page }) => {
expect(page.viewportSize()!.width * deviceScaleFactor).toBe(chromeWebStoreDimensions.width)
expect(page.viewportSize()!.height * deviceScaleFactor).toBe(chromeWebStoreDimensions.height)

const frame = await setup(page, `/`)
await page.screenshot({
path: './screenshots/extension-store-1.png',
Expand Down
Binary file modified playwright/screenshots/extension-store-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified playwright/screenshots/extension-store-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified playwright/screenshots/extension-store-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified playwright/screenshots/extension-store-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified playwright/screenshots/extension-store-5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified playwright/screenshots/extension-store-6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified playwright/screenshots/extension-store-7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified playwright/screenshots/extension-store-8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit dc5b937

Please sign in to comment.