-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1142 from jetstreamapp/feat/web-extension-auth-pl…
…aywright Add web-extension tests
- Loading branch information
Showing
46 changed files
with
513 additions
and
133 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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 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 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 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 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 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 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 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 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,69 +1,59 @@ | ||
import { defineConfig, devices } from '@playwright/test'; | ||
import { nxE2EPreset } from '@nx/playwright/preset'; | ||
import { defineConfig, devices } from '@playwright/test'; | ||
import * as dotenv from 'dotenv'; | ||
|
||
dotenv.config(); | ||
|
||
import { workspaceRoot } from '@nx/devkit'; | ||
const ONE_SECOND = 1000; | ||
const THIRTY_SECONDS = 30 * ONE_SECOND; | ||
|
||
// For CI, you may want to set BASE_URL to the deployed application. | ||
const baseURL = process.env['BASE_URL'] || 'http://localhost:4200'; | ||
const baseURL = process.env.NX_PUBLIC_SERVER_URL || 'http://localhost:3333'; | ||
|
||
/** | ||
* Read environment variables from file. | ||
* https://github.com/motdotla/dotenv | ||
*/ | ||
// require('dotenv').config(); | ||
// Ensure tests run via VSCode debugger are run from the root of the repo | ||
if (process.cwd().endsWith('/apps/jetstream-e2e')) { | ||
process.chdir('../../'); | ||
} | ||
|
||
/** | ||
* See https://playwright.dev/docs/test-configuration. | ||
*/ | ||
export default defineConfig({ | ||
...nxE2EPreset(__filename, { testDir: './src' }), | ||
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ | ||
|
||
use: { | ||
actionTimeout: THIRTY_SECONDS, | ||
navigationTimeout: THIRTY_SECONDS, | ||
baseURL, | ||
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */ | ||
trace: 'on-first-retry', | ||
permissions: ['notifications'], | ||
trace: 'retain-on-failure', | ||
screenshot: 'only-on-failure', | ||
video: 'retain-on-failure', | ||
}, | ||
/* Run your local dev server before starting the tests */ | ||
webServer: { | ||
command: 'yarn nx serve jetstream-web-extension', | ||
url: 'http://localhost:4200', | ||
reuseExistingServer: !process.env.CI, | ||
cwd: workspaceRoot, | ||
}, | ||
// webServer: { | ||
// command: 'yarn nx serve jetstream-web-extension', | ||
// url: 'http://localhost:4200', | ||
// reuseExistingServer: !process.env.CI, | ||
// cwd: workspaceRoot, | ||
// }, | ||
projects: [ | ||
{ | ||
name: 'chromium', | ||
use: { ...devices['Desktop Chrome'] }, | ||
name: 'setup', | ||
testMatch: /.*\.setup\.ts/, | ||
use: { | ||
...devices['Desktop Chrome'], | ||
}, | ||
}, | ||
|
||
{ | ||
name: 'firefox', | ||
use: { ...devices['Desktop Firefox'] }, | ||
}, | ||
|
||
{ | ||
name: 'webkit', | ||
use: { ...devices['Desktop Safari'] }, | ||
}, | ||
|
||
// Uncomment for mobile browsers support | ||
/* { | ||
name: 'Mobile Chrome', | ||
use: { ...devices['Pixel 5'] }, | ||
}, | ||
{ | ||
name: 'Mobile Safari', | ||
use: { ...devices['iPhone 12'] }, | ||
}, */ | ||
|
||
// Uncomment for branded browsers | ||
/* { | ||
name: 'Microsoft Edge', | ||
use: { ...devices['Desktop Edge'], channel: 'msedge' }, | ||
name: 'chromium', | ||
use: { | ||
...devices['Desktop Chrome'], | ||
// Setup is giving all sorts of issues - login state is not being saved consistently | ||
// storageState: 'playwright/.auth/web-ext-user.json', | ||
}, | ||
testMatch: /.*\.spec\.ts/, | ||
// dependencies: ['setup'], | ||
}, | ||
{ | ||
name: 'Google Chrome', | ||
use: { ...devices['Desktop Chrome'], channel: 'chrome' }, | ||
} */ | ||
], | ||
}); |
This file contains 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
Oops, something went wrong.