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
454 changes: 232 additions & 222 deletions bun.lock

Large diffs are not rendered by default.

43 changes: 15 additions & 28 deletions e2e/screenshots.spec.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
import { test } from '@playwright/test'
import {
captureScreenshot,
createMockScreenlyForScreenshots,
getScreenshotsDir,
RESOLUTIONS,
setupClockMock,
setupScreenlyJsMock,
} from '@screenly/edge-apps/test/screenshots'
import path from 'path'

const RSS_URL = 'http://feeds.bbci.co.uk/news/rss.xml'

Expand Down Expand Up @@ -68,30 +65,20 @@ 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()

await setupClockMock(page)
await setupScreenlyJsMock(page, screenlyJsContent)

await page.route(RSS_URL, async (route) => {
await route.fulfill({
status: 200,
contentType: 'application/rss+xml',
body: MOCK_RSS_XML,
})
await captureScreenshot(browser, {
width,
height,
filenamePrefix: 'rss-reader-app',
screenlyJsContent,
Comment on lines +69 to +72
setupMocks: async (page) => {
await page.route(RSS_URL, async (route) => {
await route.fulfill({
status: 200,
contentType: 'application/rss+xml',
body: MOCK_RSS_XML,
})
})
},
})

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

await page.screenshot({
path: path.join(screenshotsDir, `${width}x${height}.png`),
fullPage: false,
})

await context.close()
})
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "1.0.0",
"devDependencies": {
"@playwright/test": "^1.58.0",
"@screenly/edge-apps": "^1.2.1",
"@screenly/edge-apps": "26.8.0",
"@types/bun": "^1.3.13",
"@types/jsdom": "^28.0.1",
"bun-types": "^1.3.13",
Expand Down
Binary file added screenshots/rss-reader-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/rss-reader-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/rss-reader-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/rss-reader-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/rss-reader-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/rss-reader-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/rss-reader-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/rss-reader-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/rss-reader-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/rss-reader-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.