From f96c922248166c93a3e762cf491e8f80dbfe0264 Mon Sep 17 00:00:00 2001 From: Tanmay-Bstack Date: Mon, 22 Sep 2025 19:16:12 +0530 Subject: [PATCH 1/7] Set up CI with Azure Pipelines [skip ci] --- azure-pipelines.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 azure-pipelines.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 0000000..3dd099c --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,26 @@ +# Node.js +# Build a general Node.js project with npm. +# Add steps that analyze code, save build artifacts, deploy, and more: +# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript + +trigger: +- main + +pool: + vmImage: ubuntu-latest + +steps: +- script: echo Hello, world! + displayName: 'Run a one-line script' + +- script: | + npm install + printenv + npm run sample-test + env: + BROWSERSTACK_USERNAME: $(BROWSERSTACK_USERNAME) + BROWSERSTACK_ACCESS_KEY: ${BROWSERSTACK_ACCESS_KEY} + BROWSERSTACK_PROJECT_NAME: $(BROWSERSTACK_PROJECT_NAME) + BROWSERSTACK_BUILD_NAME: ${BROWSERSTACK_BUILD_NAME} + BUILD_NUMBER: ${BUILD_NUMBER} + displayName: 'Run a multi-line script' From 1fe8b14bf09166c604a18aaea94fb7e647a1a630 Mon Sep 17 00:00:00 2001 From: Tanmay Lokhande Date: Mon, 22 Sep 2025 19:23:04 +0530 Subject: [PATCH 2/7] acc test on az --- browserstack.yml | 13 +++---------- package.json | 2 +- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/browserstack.yml b/browserstack.yml index 931609d..0aecbb3 100644 --- a/browserstack.yml +++ b/browserstack.yml @@ -11,7 +11,7 @@ accessKey: YOUR_ACCESS_KEY # ====================== # 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 +projectName: TL Acc Az 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 @@ -30,15 +30,7 @@ platforms: - os: Windows osVersion: 11 browserName: chrome - browserVersion: latest - - os: OS X - osVersion: Ventura - browserName: playwright-webkit - browserVersion: latest - - os: Windows - osVersion: 11 - browserName: playwright-firefox - browserVersion: latest + browserVersion: 138 # ======================= # Parallels per Platform @@ -79,3 +71,4 @@ consoleLogs: errors # Remote browser's console debug levels to be print # 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 +accessibility: true diff --git a/package.json b/package.json index 2688f82..006cbcf 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "author": "", "license": "ISC", "devDependencies": { - "@playwright/test": "latest", + "@playwright/test": "1.53.0", "browserstack-node-sdk": "latest" } } From 1412d8d47dce2e9f009cd50b8df9ca8955715a64 Mon Sep 17 00:00:00 2001 From: Tanmay-Bstack Date: Mon, 22 Sep 2025 19:23:40 +0530 Subject: [PATCH 3/7] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 3dd099c..41f0f58 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -4,7 +4,7 @@ # https://docs.microsoft.com/azure/devops/pipelines/languages/javascript trigger: -- main +- tl-acc-pw pool: vmImage: ubuntu-latest From 1c86bb4b72116f42bc66a66de998b6f2b029f525 Mon Sep 17 00:00:00 2001 From: Tanmay Lokhande Date: Mon, 22 Sep 2025 19:36:00 +0530 Subject: [PATCH 4/7] acc test on az --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 41f0f58..3dd099c 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -4,7 +4,7 @@ # https://docs.microsoft.com/azure/devops/pipelines/languages/javascript trigger: -- tl-acc-pw +- main pool: vmImage: ubuntu-latest From 9247696878ef5e4a02661ccf16dee6055bc0dd16 Mon Sep 17 00:00:00 2001 From: Tanmay Lokhande Date: Tue, 23 Sep 2025 12:37:27 +0530 Subject: [PATCH 5/7] acc test on az --- browserstack.yml | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/browserstack.yml b/browserstack.yml index 0aecbb3..628a82c 100644 --- a/browserstack.yml +++ b/browserstack.yml @@ -62,13 +62,16 @@ source: node-js-playwright-sample-sdk:v1 # =================== # Debugging features # =================== -debug: false # # Set to true if you need screenshots for every selenium command ran -networkLogs: false # Set to true to enable HAR logs capturing -consoleLogs: errors # Remote browser's console debug levels to be printed (Default: errors) -# 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 +debug: true # # Set to true if you need screenshots for every selenium command ran +networkLogs: true +consoleLogs: verbose +video: true +logLevel: debug accessibility: true +accessibilityOptions: + wcagVersion: wcag2aa # Default: wcag21aa + includeIssueType: + bestPractice: true # Default: false + needsReview: true # Default: true + experimental: false # Default: true + advanced_scan_timeout: 120 From 5abefa5df74d027831e96c5093a6473c3c9d8214 Mon Sep 17 00:00:00 2001 From: Tanmay Lokhande Date: Wed, 24 Sep 2025 19:24:24 +0530 Subject: [PATCH 6/7] updated pom.xml and bs.yml --- browserstack.yml | 7 +++- playwright.config.js | 89 +++++++++++++++++++++++++++++++++++++++----- 2 files changed, 86 insertions(+), 10 deletions(-) diff --git a/browserstack.yml b/browserstack.yml index 628a82c..dcdec77 100644 --- a/browserstack.yml +++ b/browserstack.yml @@ -49,7 +49,12 @@ parallelsPerPlatform: 1 # ========================================== # 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) +browserstackLocal: false # (Default false) +browserstackLocalOptions: + localIdentifier: null + forceLocal: true # Route all traffic through BrowserStack Local + forceKill: true + # 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. diff --git a/playwright.config.js b/playwright.config.js index 0f3a2f4..7128634 100644 --- a/playwright.config.js +++ b/playwright.config.js @@ -1,28 +1,99 @@ // This is a sample config for what users might be running locally const config = { + fullyParallel: true, testDir: './tests', testMatch: '**/bstack_test*.js', /* Maximum time one test can run for. */ timeout: 90 * 1000, - expect: { - /** - * Maximum time expect() should wait for the condition to be met. - * For example in `await expect(locator).toHaveText();` - */ - timeout: 5000, + expect: { + timeout: 60000, + toMatchSnapshot: { + threshold: 0.3, + maxDiffPixelRatio: 0.3 + } }, /* tests in parallel */ workers: 1, /* Reporter to use. See https://playwright.dev/docs/test-reporters */ - reporter: 'line', + reporter: [ + ['junit', { open: 'never', outputFile: 'results.xml' }], + ['html', { open: 'never', outputFolder: 'test-html-results/report' }] + ], /* Configure projects for major browsers */ + use: { + headless: true, + ignoreHTTPSErrors: true, + actionTimeout: 60000, + viewport: { + width: 1920, + height: 1080 + }, + geolocation: { longitude: 22.5726, latitude: 88.3639 }, + permissions: ['geolocation'], + extraHTTPHeaders: { + // We set this header per GitHub guidelines. + 'Accept': 'application/json' + // Add authorization token to all requests. + // 'Authorization': `token ${process.env.API_TOKEN}`, + }, + trace: 'on-first-retry', + screenshot: 'only-on-failure', + video: 'retain-on-failure', + launchOptions: { + slowMo: 500, + }, + }, projects: [ { - name: 'chrome', + name: 'chromium', + use: { + ...devices['Desktop Chrome'], + }, + }, + + { + name: 'firefox', + use: { + ...devices['Desktop Firefox'], + }, + }, + + { + name: 'webkit', + use: { + ...devices['Desktop Safari'], + }, + }, + + { + name: 'mobile-chrome', + use: { + ...devices['Pixel 7'], + viewport: { width: 412, height: 915 } + }, + }, + + // Add BrowserStack-specific projects + { + name: '-latest:Windows 11-browserstack', + use: { + browserName: 'chromium', + // BrowserStack SDK injects additional settings + }, + }, + { + name: '-latest:OS X Ventura-browserstack', use: { browserName: 'chromium', - channel: 'chrome', + }, + }, + + { + name: 'mobile-safari', + use: { + ...devices['iPhone 14 Pro'], + viewport: { width: 412, height: 915 } }, }, ], From c6042e431664a32692527fd173affe31d02e8bd9 Mon Sep 17 00:00:00 2001 From: Tanmay Lokhande Date: Wed, 24 Sep 2025 19:32:26 +0530 Subject: [PATCH 7/7] updated playwright.conf.js --- playwright.config.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/playwright.config.js b/playwright.config.js index 7128634..44cab83 100644 --- a/playwright.config.js +++ b/playwright.config.js @@ -1,3 +1,5 @@ +import { devices } from '@playwright/test'; + // This is a sample config for what users might be running locally const config = { fullyParallel: true,