-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
ref(e2e-tests): Make startCommand optional in shared playwright config
#12842
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
Merged
Merged
Changes from 1 commit
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
75 changes: 2 additions & 73 deletions
75
dev-packages/e2e-tests/test-applications/aws-lambda-layer-cjs/playwright.config.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,79 +1,8 @@ | ||
| import type { PlaywrightTestConfig } from '@playwright/test'; | ||
| import { devices } from '@playwright/test'; | ||
| import { getPlaywrightConfig } from '@sentry-internal/test-utils'; | ||
|
|
||
| // Fix urls not resolving to localhost on Node v17+ | ||
| // See: https://github.com/axios/axios/issues/3821#issuecomment-1413727575 | ||
| import { setDefaultResultOrder } from 'dns'; | ||
| setDefaultResultOrder('ipv4first'); | ||
|
|
||
| const eventProxyPort = 3031; | ||
| const lambdaPort = 3030; | ||
|
|
||
| /** | ||
| * See https://playwright.dev/docs/test-configuration. | ||
| */ | ||
| const config: PlaywrightTestConfig = { | ||
| testDir: './tests', | ||
| /* Maximum time one test can run for. */ | ||
| timeout: 150_000, | ||
| expect: { | ||
| /** | ||
| * Maximum time expect() should wait for the condition to be met. | ||
| * For example in `await expect(locator).toHaveText();` | ||
| */ | ||
| timeout: 5000, | ||
| }, | ||
| /* Run tests in files in parallel */ | ||
| fullyParallel: true, | ||
| /* Fail the build on CI if you accidentally left test.only in the source code. */ | ||
| forbidOnly: !!process.env.CI, | ||
| /* Retry on CI only */ | ||
| retries: 0, | ||
| /* Reporter to use. See https://playwright.dev/docs/test-reporters */ | ||
| reporter: 'list', | ||
| /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ | ||
| use: { | ||
| /* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */ | ||
| actionTimeout: 0, | ||
|
|
||
| /* Base URL to use in actions like `await page.goto('/')`. */ | ||
| baseURL: `http://localhost:${lambdaPort}`, | ||
|
|
||
| /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */ | ||
| trace: 'on-first-retry', | ||
| }, | ||
|
|
||
| /* Configure projects for major browsers */ | ||
| projects: [ | ||
| { | ||
| name: 'chromium', | ||
| use: { | ||
| ...devices['Desktop Chrome'], | ||
| }, | ||
| }, | ||
| // For now we only test Chrome! | ||
| // { | ||
| // name: 'firefox', | ||
| // use: { | ||
| // ...devices['Desktop Firefox'], | ||
| // }, | ||
| // }, | ||
| // { | ||
| // name: 'webkit', | ||
| // use: { | ||
| // ...devices['Desktop Safari'], | ||
| // }, | ||
| // }, | ||
| ], | ||
|
|
||
| /* Run your local dev server before starting the tests */ | ||
| webServer: [ | ||
| { | ||
| command: `node start-event-proxy.mjs && pnpm wait-port ${eventProxyPort}`, | ||
| port: eventProxyPort, | ||
| stdout: 'pipe', | ||
| }, | ||
| ], | ||
| }; | ||
|
|
||
| export default config; | ||
| export default getPlaywrightConfig(); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,23 +5,4 @@ import { getPlaywrightConfig } from '@sentry-internal/test-utils'; | |
| import { setDefaultResultOrder } from 'dns'; | ||
|
||
| setDefaultResultOrder('ipv4first'); | ||
|
|
||
| const eventProxyPort = 3031; | ||
|
|
||
| /** | ||
| * See https://playwright.dev/docs/test-configuration. | ||
| */ | ||
| const config = getPlaywrightConfig( | ||
| { startCommand: '' }, | ||
| { | ||
| /* Run your local dev server before starting the tests */ | ||
| webServer: [ | ||
| { | ||
| command: `node start-event-proxy.mjs && pnpm wait-port ${eventProxyPort}`, | ||
| port: eventProxyPort, | ||
| stdout: 'pipe', | ||
| }, | ||
| ], | ||
| }, | ||
| ); | ||
|
|
||
| export default config; | ||
| export default getPlaywrightConfig(); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can also get rid of these lines here!