Skip to content

Commit

Permalink
Test/remove viewport autoscaling (#144)
Browse files Browse the repository at this point in the history
* test: mark e2e-local-sh as executable

* test: remove viewport autoscaling

This is a leftover from our internal projects. We don't need this here as we run the VRTs always with the entire application
  • Loading branch information
spike-rabbit authored Jan 29, 2025
1 parent 5636715 commit a36f537
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 36 deletions.
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

0 comments on commit a36f537

Please sign in to comment.