diff --git a/.gitignore b/.gitignore index b576aa760..e96ba069b 100644 --- a/.gitignore +++ b/.gitignore @@ -67,3 +67,8 @@ docs/packages/javascript-sdk .nx/* !.nx/workflows **/vite.config.ts.timestamp-* + + +# Browserstack +*.obs_test_details* +*.log diff --git a/e2e/autoscript-apps/project.json b/e2e/autoscript-apps/project.json index 3f72207d9..6e1928205 100644 --- a/e2e/autoscript-apps/project.json +++ b/e2e/autoscript-apps/project.json @@ -6,7 +6,7 @@ "tags": ["scope:app"], "targets": { "build": { - "dependsOn": ["javascript-sdk:build", "ping-protect:build", "^build"], + "dependsOn": ["^build"], "inputs": ["default", "^default"], "outputs": ["{projectRoot}/dist"], "options": { @@ -19,6 +19,7 @@ } }, "serve": { + "dependsOn": ["build"], "defaultConfiguration": "development", "configurations": { "development": {}, diff --git a/e2e/autoscript-suites/.eslintignore b/e2e/autoscript-suites/.eslintignore index 7eb3b6427..e0f9009fe 100644 --- a/e2e/autoscript-suites/.eslintignore +++ b/e2e/autoscript-suites/.eslintignore @@ -6,4 +6,8 @@ LICENSE .bin dist .eslintignore -*.html \ No newline at end of file +*.html +browserstack.yml +log/* +obs* +*.log diff --git a/e2e/autoscript-suites/browserstack.yml b/e2e/autoscript-suites/browserstack.yml new file mode 100644 index 000000000..2e8b715e1 --- /dev/null +++ b/e2e/autoscript-suites/browserstack.yml @@ -0,0 +1,120 @@ +# ============================= +# Set BrowserStack Credentials +# ============================= +# Add your BrowserStack userName and accessKey here or set BROWSERSTACK_USERNAME and +# BROWSERSTACK_ACCESS_KEY as env variables +userName: ryanbasmajian_4WeXZt +accessKey: qvpytu4dRWGkFX2y5xEP + +# ====================== +# BrowserStack Reporting +# ====================== +# The following capabilities are used to set up reporting on BrowserStack: +# Set 'projectName' to the name of your project. Example, Marketing Website +projectName: BrowserStack Samples +# Set `buildName` as the name of the job / testsuite being run +buildName: browserstack build +# `buildIdentifier` is a unique id to differentiate every execution that gets appended to +# buildName. Choose your buildIdentifier format from the available expressions: +# ${BUILD_NUMBER} (Default): Generates an incremental counter with every execution +# ${DATE_TIME}: Generates a Timestamp with every execution. Eg. 05-Nov-19:30 +# Read more about buildIdentifiers here -> https://www.browserstack.com/docs/automate/selenium/organize-tests +buildIdentifier: '#${BUILD_NUMBER}' # Supports strings along with either/both ${expression} + +# ======================================= +# Platforms (Browsers / Devices to test) +# ======================================= +# Platforms object contains all the browser / device combinations you want to test on. +# Entire list available here -> (https://www.browserstack.com/list-of-browsers-and-platforms/automate) +platforms: + # - os: OS X + # osVersion: Big Sur + # browserName: Chrome + # browserVersion: latest - 2 + # - os: OS X + # osVersion: Big Sur + # browserName: playwright-firefox + # browserVersion: latest - 2 + # - os: OS X + # osVersion: Big Sur + # browserName: playwright-webkit + # browserVersion: latest - 2 + # - os: Windows + # osVersion: 10 + # browserName: Edge + # browserVersion: latest - 2 + # - os: Windows + # osVersion: 11 + # browserName: Chrome + # browserVersion: latest - 2 + # - os: Windows + # osVersion: 11 + # browserName: playwright-firefox + # browserVersion: latest - 2 + + - deviceName: iPhone 15 Pro Max + osVersion: 17 + browserName: safari + deviceOrientation: portrait + - deviceName: iPhone 15 Pro Max + osVersion: 17 + browserName: chromium + deviceOrientation: portrait + - deviceName: iPhone 13 Pro + osVersion: 15 + browserName: safari + deviceOrientation: portrait + - deviceName: iPhone 15 Pro + osVersion: 17 + browserName: chromium + deviceOrientation: portrait + - deviceName: iPhone 14 + osVersion: 18 + browserName: safari + deviceOrientation: portrait + - deviceName: iPhone 14 + osVersion: 16 + browserName: chromium + deviceOrientation: portrait + + # - deviceName: Samsung Galaxy S22 Ultra + # browserName: chrome # Try 'samsung' for Samsung browser + # osVersion: 12.0 + +# ======================= +# Parallels per Platform +# ======================= +# The number of parallel threads to be used for each platform set. +# BrowserStack's SDK runner will select the best strategy based on the configured value +# +# Example 1 - If you have configured 3 platforms and set `parallelsPerPlatform` as 2, a total of 6 (2 * 3) parallel threads will be used on BrowserStack +# +# Example 2 - If you have configured 1 platform and set `parallelsPerPlatform` as 5, a total of 5 (1 * 5) parallel threads will be used on BrowserStack +parallelsPerPlatform: 1 + +# ========================================== +# BrowserStack Local +# (For localhost, staging/private websites) +# ========================================== +# Set browserStackLocal to true if your website under test is not accessible publicly over the internet +# Learn more about how BrowserStack Local works here -> https://www.browserstack.com/docs/automate/selenium/local-testing-introduction +browserstackLocal: true # (Default false) +# browserStackLocalOptions: +# Options to be passed to BrowserStack local in-case of advanced configurations +# localIdentifier: # (Default: null) Needed if you need to run multiple instances of local. +# forceLocal: true # (Default: false) Set to true if you need to resolve all your traffic via BrowserStack Local tunnel. +# Entire list of arguments available here -> https://www.browserstack.com/docs/automate/selenium/manage-incoming-connections + +# =================== +# Debugging features +# =================== +debug: false # # Set to true if you need screenshots for every selenium command ran +networkLogs: true # Set to true to enable HAR logs capturing +consoleLogs: errors # Remote browser's console debug levels to be printed (Default: errors) +logLevel: debug +# Available options are `disable`, `errors`, `warnings`, `info`, `verbose` (Default: errors) +# CUSTOM_TAG_: # (Default: parent folder name of the test file) Custom tag for your test suite + +# Test Observability is an intelligent test reporting & debugging product. It collects data using the SDK. Read more about what data is collected at https://www.browserstack.com/docs/test-observability/references/terms-and-conditions +# Visit observability.browserstack.com to see your test reports and insights. To disable test observability, specify `testObservability: false` in the key below. +testObservability: true diff --git a/e2e/autoscript-suites/playwright.config.ts b/e2e/autoscript-suites/playwright.config.ts index 9487658e9..e6dce4c2b 100644 --- a/e2e/autoscript-suites/playwright.config.ts +++ b/e2e/autoscript-suites/playwright.config.ts @@ -1,4 +1,4 @@ -import { PlaywrightTestConfig } from '@playwright/test'; +import { devices, PlaywrightTestConfig } from '@playwright/test'; import { nxE2EPreset } from '@nx/playwright/preset'; import { workspaceRoot } from '@nx/devkit'; @@ -36,14 +36,29 @@ const config: PlaywrightTestConfig = { cwd: workspaceRoot, }, { - command: - 'pnpm nx build javascript-sdk && pnpm nx build ping-protect && pnpm nx serve autoscript-apps', + command: 'pnpm nx serve autoscript-apps', url: 'http://localhost:8443', ignoreHTTPSErrors: true, reuseExistingServer: !process.env.CI, cwd: workspaceRoot, }, ], + projects: [ + { + name: 'chromium', + use: { ...devices['Desktop Chrome'] }, + }, + + { + name: 'firefox', + use: { ...devices['Desktop Firefox'] }, + }, + + { + name: 'webkit', + use: { ...devices['Desktop Safari'] }, + }, + ], }; export default config; diff --git a/e2e/mock-api/project.json b/e2e/mock-api/project.json index c82029329..57aa42607 100644 --- a/e2e/mock-api/project.json +++ b/e2e/mock-api/project.json @@ -33,6 +33,7 @@ } }, "serve": { + "dependsOn": ["build"], "executor": "@nx/js:node", "outputs": ["{projectRoot}/dist"], "options": { diff --git a/e2e/mock-api/src/app/routes.auth.js b/e2e/mock-api/src/app/routes.auth.js index 95768433d..abb0a1784 100644 --- a/e2e/mock-api/src/app/routes.auth.js +++ b/e2e/mock-api/src/app/routes.auth.js @@ -539,7 +539,7 @@ export default function (app) { const domain = req.url.includes('localhost') ? 'localhost' : 'example.com'; res.clearCookie('redirected'); - res.cookie('iPlanetDirectoryPro', 'abcd1234', { domain, sameSite: 'none', secure: true }); + res.cookie('iPlanetDirectoryPro', 'abcd1234'); const url = new URL(`${req.protocol}://${req.headers.host}${authPaths.authorize[1]}`); url.searchParams.set('client_id', req.query.client_id); diff --git a/e2e/token-vault-proxy/project.json b/e2e/token-vault-proxy/project.json index 71b9d230e..c321a352b 100644 --- a/e2e/token-vault-proxy/project.json +++ b/e2e/token-vault-proxy/project.json @@ -6,7 +6,7 @@ "tags": ["scope:app"], "targets": { "build": { - "dependsOn": ["javascript-sdk:build", "token-vault:build", "^build"], + "dependsOn": ["^build"], "inputs": ["default", "^default"], "outputs": ["{projectRoot}/dist"], "defaultConfiguration": "production", diff --git a/nx.json b/nx.json index 19a350dd3..7707e7443 100644 --- a/nx.json +++ b/nx.json @@ -48,11 +48,7 @@ }, "e2e-ci--**/*": { "inputs": ["noMarkdown", "^noMarkdown"], - "dependsOn": [ - "javascript-sdk:build", - "ping-protect:build", - "token-vault:build" - ], + "dependsOn": ["^build"], "cache": true } }, @@ -122,7 +118,6 @@ ], "defaultProject": "javascript-sdk", "useDaemonProcess": true, - "useInferencePlugins": true, "defaultBase": "develop" } diff --git a/packages/ping-protect/project.json b/packages/ping-protect/project.json index a5f4b5cf9..93099bd50 100644 --- a/packages/ping-protect/project.json +++ b/packages/ping-protect/project.json @@ -9,7 +9,7 @@ "command": "npx typedoc --options ./packages/ping-protect/typedoc.json" }, "build": { - "dependsOn": ["javascript-sdk:build"], + "dependsOn": ["^build"], "inputs": [ "default", "^default", diff --git a/packages/token-vault/project.json b/packages/token-vault/project.json index 64070fc63..ecc545320 100644 --- a/packages/token-vault/project.json +++ b/packages/token-vault/project.json @@ -6,7 +6,7 @@ "tags": ["scope:package"], "targets": { "build": { - "dependsOn": ["javascript-sdk:build"], + "dependsOn": ["^build"], "inputs": [ "default", "^default",