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

chore(ui): add test for font preview #32225

Merged
merged 3 commits into from
Aug 22, 2024
Merged

Conversation

Skn0tt
Copy link
Member

@Skn0tt Skn0tt commented Aug 20, 2024

Adds a test for the font preview feature.

@Skn0tt Skn0tt requested a review from mxschmitt August 20, 2024 06:37
@Skn0tt Skn0tt self-assigned this Aug 20, 2024

This comment has been minimized.

This comment has been minimized.

@Skn0tt Skn0tt requested a review from dgozman August 22, 2024 12:03
await expect(traceViewer.networkRequests).toHaveCount(1);
await traceViewer.networkRequests.getByText('font.woff2').click();
await traceViewer.page.getByTestId('network-request-details').getByTitle('Body').click();
await expect(traceViewer.page.locator('.network-request-details-tab')).toHaveScreenshot({ maxDiffPixelRatio: 0.1 });
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The chances are this screenshot will not work across various operating systems and configurations. You can try adding a label CQ1 to check that. I'd recommend checking that text "ABCDEF" is present in the preview instead.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Today I learned about CQ1! Just for my understanding, do we run those fat tests on any label, or only on CQ1? looking at https://github.com/Skn0tt/playwright/blob/2feaecd34eeaecb81534d66d9317b6bbd8463319/.github/workflows/tests_secondary.yml#L12.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated the test in a86831d

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The trigger is for any label but we never add labels for PRs, so we usually use just CQ1.

@Skn0tt Skn0tt added the CQ1 label Aug 22, 2024
Copy link
Contributor

Test results for "tests others"

1 failed
❌ [webview2] › page/page-goto.spec.ts:182:3 › should properly cancel Cross-Origin-Opener-Policy navigation

18010 passed, 488 skipped
✔️✔️✔️

Merge workflow run.

Copy link
Contributor

Test results for "tests 1"

3 failed
❌ [playwright-test] › runner.spec.ts:118:5 › should ignore subprocess creation error because of SIGINT
❌ [webkit-library] › library/modernizr.spec.ts:33:3 › safari-14-1
❌ [webkit-library] › library/modernizr.spec.ts:83:3 › mobile-safari-14-1

1 flaky ⚠️ [firefox-library] › library/trace-viewer.spec.ts:1166:1 › should ignore 304 responses

30100 passed, 870 skipped
✔️✔️✔️

Merge workflow run.

@Skn0tt Skn0tt merged commit 0b9c036 into microsoft:main Aug 22, 2024
28 of 30 checks passed
Copy link
Contributor

Test results for "tests 2"

4 fatal errors, not part of any test
29 failed
❌ [chromium-library] › library/browsertype-connect.spec.ts:490:5 › run-server › should saveAs videos from remote browser
❌ [chromium-library] › library/inspector/pause.spec.ts:33:3 › should not reset timeouts
❌ [chromium-library] › library/proxy.spec.ts:45:3 › should use proxy for second page
❌ [chromium-library] › library/proxy.spec.ts:64:3 › should work with IP:PORT notion
❌ [chromium-page] › page/page-screenshot.spec.ts:283:5 › page screenshot › should work for canvas
❌ [chromium-library] › library/trace-viewer.spec.ts:292:1 › should show font preview
❌ [firefox-library] › library/trace-viewer.spec.ts:292:1 › should show font preview
❌ [chromium-library] › library/logger.spec.ts:19:3 › should log @smoke
❌ [chromium-page] › page/page-screenshot.spec.ts:283:5 › page screenshot › should work for canvas
❌ [chromium-library] › library/trace-viewer.spec.ts:292:1 › should show font preview
❌ [webkit-library] › library/modernizr.spec.ts:33:3 › safari-14-1
❌ [webkit-library] › library/modernizr.spec.ts:83:3 › mobile-safari-14-1
❌ [webkit-library] › library/inspector/cli-codegen-2.spec.ts:493:7 › cli codegen › should --save-trace
❌ [webkit-library] › library/modernizr.spec.ts:33:3 › safari-14-1
❌ [webkit-library] › library/modernizr.spec.ts:83:3 › mobile-safari-14-1
❌ [webkit-library] › library/modernizr.spec.ts:33:3 › safari-14-1
❌ [webkit-library] › library/modernizr.spec.ts:83:3 › mobile-safari-14-1
❌ [webkit-library] › library/modernizr.spec.ts:33:3 › safari-14-1
❌ [webkit-library] › library/modernizr.spec.ts:83:3 › mobile-safari-14-1
❌ [webkit-library] › library/inspector/pause.spec.ts:355:5 › pause › should pause on page close
❌ [webkit-library] › library/modernizr.spec.ts:33:3 › safari-14-1
❌ [webkit-library] › library/modernizr.spec.ts:83:3 › mobile-safari-14-1
❌ [webkit-library] › library/trace-viewer.spec.ts:292:1 › should show font preview
❌ [webkit-library] › library/modernizr.spec.ts:33:3 › safari-14-1
❌ [webkit-library] › library/modernizr.spec.ts:83:3 › mobile-safari-14-1
❌ [webkit-library] › library/modernizr.spec.ts:33:3 › safari-14-1
❌ [webkit-library] › library/modernizr.spec.ts:83:3 › mobile-safari-14-1
❌ [webkit-library] › library/modernizr.spec.ts:33:3 › safari-14-1
❌ [webkit-library] › library/modernizr.spec.ts:83:3 › mobile-safari-14-1

98 flaky ⚠️ [chromium-library] › library/chromium/oopif.spec.ts:260:3 › ElementHandle.boundingBox() should work
⚠️ [chromium-library] › library/browsercontext-base-url.spec.ts:37:3 › should construct a new URL when a baseURL in browserType.launchPersistentContext is passed to page.goto
⚠️ [chromium-library] › library/browsertype-connect.spec.ts:490:5 › launchServer › should saveAs videos from remote browser
⚠️ [chromium-library] › library/browsertype-connect.spec.ts:381:5 › run-server › should emit close events on pages and contexts
⚠️ [chromium-library] › library/browsertype-launch-server.spec.ts:23:5 › launch server › should work
⚠️ [chromium-library] › library/channels.spec.ts:40:1 › should scope context handles
⚠️ [chromium-library] › library/chromium/chromium.spec.ts:151:15 › should close service worker together with the context
⚠️ [chromium-library] › library/chromium/connect-over-cdp.spec.ts:26:5 › should connect to an existing cdp session
⚠️ [chromium-library] › library/chromium/tracing.spec.ts:60:3 › should throw if tracing on two pages
⚠️ [chromium-library] › library/defaultbrowsercontext-1.spec.ts:22:3 › context.cookies() should work @smoke
⚠️ [chromium-library] › library/defaultbrowsercontext-1.spec.ts:64:3 › context.clearCookies() should work
⚠️ [chromium-library] › library/har.spec.ts:82:3 › should have pages in persistent context
⚠️ [chromium-library] › library/inspector/cli-codegen-2.spec.ts:493:7 › cli codegen › should --save-trace
⚠️ [chromium-library] › library/inspector/cli-codegen-python-async.spec.ts:82:5 › should save the codegen output to a file if specified
⚠️ [chromium-library] › library/inspector/cli-codegen-python.spec.ts:78:5 › should save the codegen output to a file if specified
⚠️ [chromium-library] › library/inspector/cli-codegen-test.spec.ts:88:5 › should work with --save-har
⚠️ [chromium-library] › library/logger.spec.ts:19:3 › should log @smoke
⚠️ [chromium-library] › library/tracing.spec.ts:350:5 › should survive browser.close with auto-created traces dir
⚠️ [chromium-library] › library/video.spec.ts:381:5 › screencast › should capture navigation
⚠️ [chromium-library] › library/emulation-focus.spec.ts:202:12 › should trigger hover state concurrently
⚠️ [chromium-page] › page/page-click.spec.ts:230:3 › should click on checkbox input and toggle
⚠️ [chromium-library] › library/browsercontext-viewport.spec.ts:146:12 › should drag with high dpi
⚠️ [chromium-page] › page/page-mouse.spec.ts:183:3 › should trigger hover state with removed window.Node
⚠️ [chromium-library] › library/emulation-focus.spec.ts:202:12 › should trigger hover state concurrently
⚠️ [chromium-library] › library/inspector/cli-codegen-1.spec.ts:586:7 › cli codegen › should select with size attribute
⚠️ [chromium-page] › page/page-click.spec.ts:230:3 › should click on checkbox input and toggle
⚠️ [chromium-library] › library/inspector/cli-codegen-csharp.spec.ts:30:5 › should print the correct imports and context options
⚠️ [chromium-page] › page/page-mouse.spec.ts:211:3 › should tween mouse movement
⚠️ [chromium-library] › library/chromium/oopif.spec.ts:260:3 › ElementHandle.boundingBox() should work
⚠️ [chromium-library] › library/chromium/oopif.spec.ts:260:3 › ElementHandle.boundingBox() should work
⚠️ [chromium-library] › library/global-fetch-cookie.spec.ts:130:1 › should send secure cookie over http for localhost
⚠️ [chromium-library] › library/video.spec.ts:725:5 › screencast › should capture full viewport
⚠️ [chromium-page] › page/page-screenshot.spec.ts:646:5 › page screenshot animations › should stop animations that happen right before screenshot
⚠️ [chromium-library] › library/trace-viewer.spec.ts:248:1 › should have network requests
⚠️ [firefox-page] › page/page-goto.spec.ts:182:3 › should properly cancel Cross-Origin-Opener-Policy navigation
⚠️ [firefox-page] › page/page-goto.spec.ts:182:3 › should properly cancel Cross-Origin-Opener-Policy navigation
⚠️ [firefox-library] › library/capabilities.spec.ts:260:3 › requestFullscreen
⚠️ [firefox-library] › library/video.spec.ts:381:5 › screencast › should capture navigation
⚠️ [firefox-library] › library/video.spec.ts:189:5 › screencast › should capture static page
⚠️ [firefox-page] › page/page-click.spec.ts:230:3 › should click on checkbox input and toggle
⚠️ [firefox-library] › library/video.spec.ts:189:5 › screencast › should capture static page
⚠️ [firefox-page] › page/page-goto.spec.ts:182:3 › should properly cancel Cross-Origin-Opener-Policy navigation
⚠️ [firefox-page] › page/page-mouse.spec.ts:166:3 › should trigger hover state
⚠️ [firefox-page] › page/page-mouse.spec.ts:176:3 › should trigger hover state on disabled button
⚠️ [firefox-page] › page/page-goto.spec.ts:182:3 › should properly cancel Cross-Origin-Opener-Policy navigation
⚠️ [firefox-page] › page/page-mouse.spec.ts:147:3 › should select the text with mouse
⚠️ [firefox-library] › library/browsercontext-pages.spec.ts:69:3 › should click the button with deviceScaleFactor set
⚠️ [firefox-library] › library/browsercontext-pages.spec.ts:128:3 › should not leak listeners during navigation of 20 pages
⚠️ [firefox-library] › library/capabilities.spec.ts:134:3 › should not crash on page with mp4 @smoke
⚠️ [firefox-library] › library/capabilities.spec.ts:291:3 › Intl.ListFormat should work
⚠️ [firefox-library] › library/har.spec.ts:211:3 › should include set-cookies
⚠️ [firefox-library] › library/video.spec.ts:672:5 › screencast › should wait for video to finish if page was closed
⚠️ [firefox-page] › page/page-click-scroll.spec.ts:19:3 › should not hit scroll bar
⚠️ [firefox-page] › page/page-click-timeout-4.spec.ts:20:3 › should timeout waiting for stable position
⚠️ [firefox-page] › page/page-click.spec.ts:97:3 › should click the 1x1 div
⚠️ [firefox-page] › page/page-goto.spec.ts:147:3 › should work with Cross-Origin-Opener-Policy after redirect
⚠️ [firefox-page] › page/page-goto.spec.ts:182:3 › should properly cancel Cross-Origin-Opener-Policy navigation
⚠️ [firefox-page] › page/page-goto.spec.ts:182:3 › should properly cancel Cross-Origin-Opener-Policy navigation
⚠️ [firefox-page] › page/page-goto.spec.ts:182:3 › should properly cancel Cross-Origin-Opener-Policy navigation
⚠️ [firefox-page] › page/page-set-input-files.spec.ts:40:3 › should upload a folder
⚠️ [chromium-library] › library/browser.spec.ts:54:5 › should dispatch page.on(close) upon browser.close and reject evaluate
⚠️ [chromium-library] › library/browsercontext-base-url.spec.ts:37:3 › should construct a new URL when a baseURL in browserType.launchPersistentContext is passed to page.goto
⚠️ [chromium-library] › library/browsercontext-fetch.spec.ts:1214:3 › should work with connectOverCDP
⚠️ [chromium-library] › library/browsertype-connect.spec.ts:628:5 › launchServer › should filter launch options
⚠️ [chromium-library] › library/browsertype-connect.spec.ts:681:5 › run-server › should upload large file
⚠️ [chromium-library] › library/browsertype-launch-server.spec.ts:23:5 › launch server › should work
⚠️ [chromium-library] › library/browsertype-launch-server.spec.ts:29:5 › launch server › should work with host
⚠️ [chromium-library] › library/chromium/connect-over-cdp.spec.ts:26:5 › should connect to an existing cdp session
⚠️ [chromium-library] › library/defaultbrowsercontext-1.spec.ts:22:3 › context.cookies() should work @smoke
⚠️ [chromium-library] › library/har.spec.ts:82:3 › should have pages in persistent context
⚠️ [chromium-library] › library/inspector/cli-codegen-2.spec.ts:493:7 › cli codegen › should --save-trace
⚠️ [chromium-library] › library/inspector/cli-codegen-test.spec.ts:88:5 › should work with --save-har
⚠️ [chromium-library] › library/inspector/pause.spec.ts:22:3 › should resume when closing inspector
⚠️ [chromium-library] › library/signals.spec.ts:78:7 › signals › should close the browser on SIGINT
⚠️ [chromium-library] › library/tracing.spec.ts:350:5 › should survive browser.close with auto-created traces dir
⚠️ [chromium-library] › library/video.spec.ts:381:5 › screencast › should capture navigation
⚠️ [chromium-library] › library/trace-viewer.spec.ts:1203:1 › should pick locator in iframe
⚠️ [chromium-page] › page/elementhandle-misc.spec.ts:27:3 › should hover when Node is removed
⚠️ [chromium-library] › library/trace-viewer.spec.ts:1203:1 › should pick locator in iframe
⚠️ [chromium-library] › library/tracing.spec.ts:412:14 › should produce screencast frames crop
⚠️ [webkit-library] › library/inspector/cli-codegen-1.spec.ts:553:7 › cli codegen › should select
⚠️ [webkit-library] › library/inspector/cli-codegen-test.spec.ts:88:5 › should work with --save-har
⚠️ [webkit-library] › library/page-clock.spec.ts:526:3 › Date.now › check Date.now is an integer (2)
⚠️ [webkit-library] › library/trace-viewer.spec.ts:1203:1 › should pick locator in iframe
⚠️ [webkit-library] › library/browsercontext-reuse.spec.ts:50:1 › should reset serviceworker
⚠️ [webkit-library] › library/inspector/cli-codegen-3.spec.ts:531:7 › cli codegen › should consume pointer events
⚠️ [webkit-library] › library/popup.spec.ts:115:3 › should inherit viewport size from browser context
⚠️ [webkit-library] › library/browsercontext-viewport.spec.ts:146:12 › should drag with high dpi
⚠️ [webkit-library] › library/inspector/cli-codegen-1.spec.ts:197:7 › cli codegen › should not target selector preview by text regexp
⚠️ [webkit-library] › library/inspector/cli-codegen-1.spec.ts:341:7 › cli codegen › should press
⚠️ [webkit-library] › library/inspector/cli-codegen-3.spec.ts:473:7 › cli codegen › should generate getByLabel
⚠️ [webkit-library] › library/inspector/cli-codegen-3.spec.ts:502:7 › cli codegen › should generate getByLabel without regex
⚠️ [webkit-library] › library/inspector/cli-codegen-3.spec.ts:679:7 › cli codegen › should assert value on disabled input
⚠️ [webkit-library] › library/trace-viewer.spec.ts:237:1 › should have correct stack trace
⚠️ [webkit-library] › library/video.spec.ts:381:5 › screencast › should capture navigation
⚠️ [webkit-page] › page/page-request-continue.spec.ts:184:5 › post data › should amend post data
⚠️ [webkit-library] › library/tracing.spec.ts:412:14 › should produce screencast frames fit
⚠️ [webkit-library] › library/tracing.spec.ts:412:14 › should produce screencast frames crop

230837 passed, 9844 skipped, 5 did not run
✔️✔️✔️

Merge workflow run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants