Skip to content

Commit

Permalink
update playwright.config and playwright versions (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
osundwajeff authored Oct 4, 2024
1 parent a040bc4 commit d683727
Show file tree
Hide file tree
Showing 6 changed files with 103 additions and 16 deletions.
2 changes: 1 addition & 1 deletion playwright/ci-test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"author": "",
"license": "ISC",
"devDependencies": {
"@playwright/test": "^1.39.0",
"@playwright/test": "^1.42.1",
"@types/node": "^20.8.9"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion playwright/ci-test/shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ let
# If you want use a different version, go to nix packages search, and find the
# github hash of the version you want to be using, then replace in the URL below.
#
nixpkgs = builtins.fetchTarball "https://github.com/NixOS/nixpkgs/archive/4059c4f71b3a7339261c0183e365fd8016f24bdb.tar.gz";
nixpkgs = builtins.fetchTarball "https://github.com/NixOS/nixpkgs/archive/1536926ef5621b09bba54035ae2bb6d806d72ac8.tar.gz";
pkgs = import nixpkgs { config = { }; overlays = [ ]; };
in
with pkgs;
Expand Down
24 changes: 12 additions & 12 deletions playwright/staging-tests/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion playwright/staging-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"author": "",
"license": "ISC",
"devDependencies": {
"@playwright/test": "^1.40.1",
"@playwright/test": "^1.42.1",
"@types/node": "^20.8.9"
}
}
87 changes: 87 additions & 0 deletions playwright/staging-tests/playwright.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@

import { defineConfig, devices } from '@playwright/test';

/**
* Read environment variables from file.
* https://github.com/motdotla/dotenv
*/

//require('dotenv').config();

/**
* See https://playwright.dev/docs/test-configuration.
*/
export default defineConfig({
testDir: './tests',
/* Tests timeout */
timeout: 30 * 1000,
/* 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: process.env.CI ? 2 : 0,
/* Opt out of parallel tests on CI. */
workers: process.env.CI ? 1 : undefined,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: 'html',
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
/* Base URL to use in actions like `await page.goto('/')`. */
baseURL: 'http://example.com',

/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: 'on-first-retry',
//baseURL: process.env.STAGING === '1' ? 'http://example.com' : 'http://127.0.0.1/'
},

/* Configure projects for major browsers */
projects: [
// { name: 'setup', testMatch: /.*\.setup\.ts/ },
{
name: 'chromium',
use: { ...devices['Desktop Chrome'],
// Use prepared auth state.
storageState: 'auth.json',
},
// dependencies: ['setup'],
},
//
// {
// name: 'firefox',
// use: { ...devices['Desktop Firefox'] },
// },
//
// {
// name: 'webkit',
// use: { ...devices['Desktop Safari'] },
// },

/* Test against mobile viewports. */
// {
// name: 'Mobile Chrome',
// use: { ...devices['Pixel 5'] },
// },
// {
// name: 'Mobile Safari',
// use: { ...devices['iPhone 12'] },
// },

/* Test against branded browsers. */
// {
// name: 'Microsoft Edge',
// use: { ...devices['Desktop Edge'], channel: 'msedge' },
// },
// {
// name: 'Google Chrome',
// use: { ...devices['Desktop Chrome'], channel: 'chrome' },
// },
],

/* 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,
// },
});
2 changes: 1 addition & 1 deletion playwright/staging-tests/shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ let
# If you want use a different version, go to nix packages search, and find the
# github hash of the version you want to be using, then replace in the URL below.
#
nixpkgs = builtins.fetchTarball "https://github.com/NixOS/nixpkgs/archive/4059c4f71b3a7339261c0183e365fd8016f24bdb.tar.gz";
nixpkgs = builtins.fetchTarball "https://github.com/NixOS/nixpkgs/archive/1536926ef5621b09bba54035ae2bb6d806d72ac8.tar.gz";
pkgs = import nixpkgs { config = { }; overlays = [ ]; };
in
with pkgs;
Expand Down

0 comments on commit d683727

Please sign in to comment.