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

Test/remove viewport autoscaling #144

Merged
merged 2 commits into from
Jan 29, 2025
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
Empty file modified e2e-local.sh
100644 → 100755
Empty file.
14 changes: 7 additions & 7 deletions playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@ if (!isA11y && !isVrt) {
isVrt = true;
}

const baseViewport = {
width: 1000,
height: 660
};

const chromeLaunchOptions = {
args: [
'--disable-skia-runtime-opts',
Expand Down Expand Up @@ -95,7 +90,6 @@ export default defineConfig({
use: {
baseURL: `http://${localAddress}:${port}`,
launchOptions: chromeLaunchOptions,
viewport: baseViewport,
actionTimeout: 0,
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: 'on-first-retry'
Expand All @@ -105,7 +99,13 @@ export default defineConfig({
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] }
use: {
...devices['Desktop Chrome'],
viewport: {
width: 1280,
height: 780
}
}
}
],

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 1 addition & 13 deletions playwright/support/test-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class SiTestHelpers {
private testInfo: TestInfo
) {}

public async visitExample(name: string, autoScaleViewport = true): Promise<void> {
public async visitExample(name: string): Promise<void> {
await test.step(
'visitExample: ' + name,
async () => {
Expand All @@ -71,18 +71,6 @@ class SiTestHelpers {
await this.page.goto(newHash);

await this.page.evaluate(() => document.fonts.ready);

if (autoScaleViewport) {
const height = await this.page.evaluate(() => document.body.scrollHeight);
const width = await this.page.evaluate(() => document.body.scrollWidth);
const viewportSize = this.page.viewportSize();
if (!viewportSize || viewportSize.height < height || viewportSize.width < width) {
await this.page.setViewportSize({
height: Math.max(height, viewportSize?.height ?? 0),
width: Math.max(width, viewportSize?.width ?? 0)
});
}
}
},
{ box: true }
);
Expand Down
Loading