Skip to content
Open
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
450 changes: 222 additions & 228 deletions bun.lock

Large diffs are not rendered by default.

37 changes: 12 additions & 25 deletions e2e/screenshots.spec.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
import { test } from '@playwright/test'
import {
captureScreenshot,
createMockScreenlyForScreenshots,
getScreenshotsDir,
RESOLUTIONS,
setupClockMock,
setupOpenWeatherMocks,
setupScreenlyJsMock,
} from '@screenly/edge-apps/test/screenshots'
import { mockGeocodingResponse, mockWeatherResponse } from './weather-mocks'
import path from 'path'

const { screenlyJsContent } = createMockScreenlyForScreenshots(
{
Expand All @@ -24,27 +21,17 @@ const { screenlyJsContent } = createMockScreenlyForScreenshots(

for (const { width, height } of RESOLUTIONS) {
test(`screenshot ${width}x${height}`, async ({ browser }) => {
const screenshotsDir = getScreenshotsDir()

const context = await browser.newContext({ viewport: { width, height } })
const page = await context.newPage()

// Setup mocks
await setupClockMock(page)
await setupScreenlyJsMock(page, screenlyJsContent)
await setupOpenWeatherMocks(page, {
geocoding: mockGeocodingResponse,
weather: mockWeatherResponse,
})

await page.goto('/')
await page.waitForLoadState('networkidle')

await page.screenshot({
path: path.join(screenshotsDir, `${width}x${height}.png`),
fullPage: false,
await captureScreenshot(browser, {
width,
height,
filenamePrefix: 'clock-app',
screenlyJsContent,
Comment on lines +24 to +28
setupMocks: async (page) => {
await setupOpenWeatherMocks(page, {
geocoding: mockGeocodingResponse,
weather: mockWeatherResponse,
})
},
})

await context.close()
})
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
"dependencies": {},
"prettier": "./.prettierrc.json",
"devDependencies": {
"@screenly/edge-apps": "^1.5.0",
"@playwright/test": "^1.60.0",
"@screenly/edge-apps": "26.8.0",
"@types/bun": "^1.3.14",
"@types/jsdom": "^28.0.3",
"bun-types": "^1.3.14",
Expand Down
Binary file added screenshots/clock-app-1080x1920.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/clock-app-1280x720.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/clock-app-1920x1080.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/clock-app-2160x3840.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/clock-app-2160x4096.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/clock-app-3840x2160.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/clock-app-4096x2160.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/clock-app-480x800.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/clock-app-720x1280.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/clock-app-800x480.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.