Skip to content

Commit

Permalink
Fix linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
cy6erskunk committed May 2, 2024
1 parent 2798c5d commit 8182e8a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 21 deletions.
22 changes: 12 additions & 10 deletions e2e/viewport-defined.spec.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import { test, expect } from '@playwright/test';
import { test, expect } from '@playwright/test'

test('png generation: viewbox is defined', async ({ page }) => {
await page.goto('http://localhost:3000/index-umd.html');
const downloadPromise = page.waitForEvent('download');
await page.getByRole('button', { name: 'PNG' }).click();
const download = await downloadPromise;
await download.saveAs('./manual-tests/test-results/' + download.suggestedFilename());
expect(download.suggestedFilename()).toBe('sample-png.png');
await page.goto('http://localhost:3000/test-results/sample-png.png');
await expect(page).toHaveScreenshot();
});
await page.goto('http://localhost:3000/index-umd.html')
const downloadPromise = page.waitForEvent('download')
await page.getByRole('button', { name: 'PNG' }).click()
const download = await downloadPromise
await download.saveAs(
`./manual-tests/test-results/${download.suggestedFilename()}`
)
expect(download.suggestedFilename()).toBe('sample-png.png')
await page.goto('http://localhost:3000/test-results/sample-png.png')
await expect(page).toHaveScreenshot()
})
21 changes: 10 additions & 11 deletions playwright.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// @ts-check
const { defineConfig, devices } = require('@playwright/test');
const { defineConfig, devices } = require('@playwright/test')

/**
* Read environment variables from file.
Expand Down Expand Up @@ -28,7 +28,7 @@ module.exports = defineConfig({
// baseURL: 'http://127.0.0.1:3000',

/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: 'on-first-retry',
trace: 'on-first-retry'
},

/* Configure projects for major browsers */
Expand All @@ -37,13 +37,13 @@ module.exports = defineConfig({
// name: 'chromium',
// use: { ...devices['Desktop Chrome'] },
// },
/*
/*
{
name: 'firefox',
use: { ...devices['Desktop Firefox'] },
},
*/

// {
// name: 'webkit',
// use: { ...devices['Desktop Safari'] },
Expand All @@ -66,19 +66,18 @@ module.exports = defineConfig({
// },
{
name: 'Google Chrome',
use: {
use: {
...devices['Desktop Chrome'],
channel: 'chrome',
deviceScaleFactor: 2
},
},
],
deviceScaleFactor: 2
}
}
]

/* Run your local dev server before starting the tests */
// webServer: {
// command: 'npm run start',
// url: 'http://127.0.0.1:3000',
// reuseExistingServer: !process.env.CI,
// },
});

})

0 comments on commit 8182e8a

Please sign in to comment.