Skip to content

Commit

Permalink
added a new sauce config, updated YML
Browse files Browse the repository at this point in the history
added a new sauce config, updated YML.  Needed to have separate playwright config since test/results dir is based off of execution location.
  • Loading branch information
amauch-adobe committed Dec 18, 2023
1 parent 761925b commit ac97267
Show file tree
Hide file tree
Showing 2 changed files with 104 additions and 7 deletions.
14 changes: 7 additions & 7 deletions .sauce/milo-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ sauce:
# owner: sso-acs-mauchley
playwright:
version: package.json # See https://docs.saucelabs.com/web-apps/automated-testing/playwright/#supported-testing-platforms for a list of supported versions.
configFile: ./configs/milo.config.js # See https://docs.saucelabs.com/web-apps/automated-testing/playwright/yaml/#configfile for a list of supported configuration files.
configFile: ./configs/milo.sauce.config.js # See https://docs.saucelabs.com/web-apps/automated-testing/playwright/yaml/#configfile for a list of supported configuration files.
# Send in specific environment variables to your tests by adding them here. These parameters are only neccessary if running locally.
#env:
# IMS_EMAIL: $IMS_EMAIL_LOCAL
Expand Down Expand Up @@ -45,7 +45,7 @@ suites:
- name: "Firefox Win"
platformName: "Windows 11"
screenResolution: "1440x900"
testMatch: ['.*.js']
testMatch: [".*.js"]
smartRetry:
failedOnly: true
params:
Expand All @@ -56,7 +56,7 @@ suites:
- name: "Chromium Win"
platformName: "Windows 11"
screenResolution: "1440x900"
testMatch: ['.*.js']
testMatch: [".*.js"]
smartRetry:
failedOnly: true
params:
Expand All @@ -67,7 +67,7 @@ suites:
- name: "Webkit Win"
platformName: "Windows 11"
screenResolution: "1440x900"
testMatch: ['.*.js']
testMatch: [".*.js"]
smartRetry:
failedOnly: true
params:
Expand All @@ -78,7 +78,7 @@ suites:
- name: "Firefox Mac"
platformName: "macOS 13"
screenResolution: "1440x900"
testMatch: ['.*.js']
testMatch: [".*.js"]
smartRetry:
failedOnly: true
params:
Expand All @@ -89,7 +89,7 @@ suites:
- name: "Chromium Mac"
platformName: "macOS 13"
screenResolution: "1440x900"
testMatch: ['.*.js']
testMatch: [".*.js"]
smartRetry:
failedOnly: true
params:
Expand All @@ -100,7 +100,7 @@ suites:
- name: "Webkit Mac"
platformName: "macOS 13"
screenResolution: "1440x900"
testMatch: ['.*.js']
testMatch: [".*.js"]
smartRetry:
failedOnly: true
params:
Expand Down
97 changes: 97 additions & 0 deletions configs/milo.sauce.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
// @ts-check
const { devices } = require('@playwright/test');

const envs = require('../envs/envs.js');

/**
* @see https://playwright.dev/docs/test-configuration
* @type {import('@playwright/test').PlaywrightTestConfig}
*/
const config = {
testDir: './tests/milo',
outputDir: './test-results',
/* Maximum time one test can run for. */
timeout: 30 * 1000,
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: process.env.CI ? 2 : 0,
/* Opt out of parallel tests on CI. */
workers: process.env.CI ? 2 : undefined,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: process.env.CI
? [['github'], ['../utils/reporters/json-reporter.js'], ['../utils/reporters/json-reporter.js']]
: [['html', { outputFolder: 'test-html-results' }]],
/* 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: 60000,
/* Base URL to use in actions like `await page.goto('/')`. */
// baseURL: 'http://localhost:3000',

/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: 'on-first-retry',
baseURL: process.env.BASE_URL || envs['@milo_live'] || 'https://main--milo--adobecom.hlx.live',
},

/* Configure projects for major browsers */
projects: [
{
name: 'milo-live-chrome',
use: {
...devices['Desktop Chrome'],
baseURL: envs['@milo-live'],
},
},

{
name: 'milo-live-firefox',
use: {
...devices['Desktop Firefox'],
baseURL: envs['@milo-live'],
},
},

{
name: 'milo-live-webkit',
use: {
...devices['Desktop Safari'],
baseURL: envs['@milo-live'],
},
},

{
name: 'milo-prod-chrome',
use: {
...devices['Desktop Chrome'],
baseURL: envs['@milo_prod'],
},
},

{
name: 'milo-prod-firefox',
use: {
...devices['Desktop Firefox'],
baseURL: envs['@milo_prod'],
},
},

{
name: 'milo-prod-webkit',
use: {
...devices['Desktop Safari'],
baseURL: envs['@milo_prod'],
},
},
],
};
export default config;

0 comments on commit ac97267

Please sign in to comment.