Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Chrome Webstore image dimensions #2053

Merged
merged 3 commits into from
Sep 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,
lukaw3d marked this conversation as resolved.
Show resolved Hide resolved
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.
Loading