Skip to content

Commit dbf09b5

Browse files
udpate dwith the customer changes
1 parent 7ce2443 commit dbf09b5

File tree

4 files changed

+145
-3
lines changed

4 files changed

+145
-3
lines changed

.github/workflows/bs-wf.yml

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
name: Automation Test Workflow execution in Prod for Backcountry
2+
3+
on:
4+
push:
5+
branches: [main, develop]
6+
# Allows the workflow to be manually triggered from the GitHub Actions UI with user-defined input parameters.
7+
# The 'build_name' input is required, has a description for user guidance, and a default value of "Backcountry Prod Suite".
8+
workflow_dispatch: # Allows manual triggering of the workflow
9+
inputs:
10+
build_name:
11+
description: "Backcountry Prod Suite"
12+
required: true
13+
default: "Backcountry Prod Suite"
14+
15+
jobs:
16+
test:
17+
runs-on: ubuntu-latest
18+
env:
19+
LOCAL_IDENTIFIER: github-actions-tunnel
20+
21+
steps:
22+
# Step 1: Checkout the repository
23+
- name: Checkout code
24+
uses: actions/checkout@v4
25+
26+
# Step 2: Set up Node.js
27+
- name: Set up Node.js
28+
uses: actions/setup-node@v4
29+
with:
30+
node-version: "20"
31+
cache: "npm"
32+
33+
# Step 3: Install dependencies
34+
- name: Install dependencies
35+
run: npm ci
36+
37+
# Step 4: Install Playwright browsers
38+
- name: Install Playwright Browsers
39+
run: npx playwright install --with-deps chromium
40+
41+
- name: "BrowserStack Env Setup" # Invokes the setup-env action
42+
uses: browserstack/[email protected]
43+
with:
44+
username: ${{ secrets.BROWSERSTACK_USERNAME }}
45+
access-key: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
46+
47+
- name: "BrowserStack Local Tunnel Setup" # Invokes the setup-local action
48+
uses: browserstack/github-actions/setup-local@master
49+
with:
50+
local-testing: start
51+
local-logging-level: all-logs
52+
local-identifier: ${{ env.LOCAL_IDENTIFIER }}
53+
54+
- name: Wait for tunnel
55+
run: sleep 10
56+
57+
# Step 5: Run Playwright tests with Cucumber
58+
- name: Run Playwright tests
59+
run: npx cucumber-js --tags "@BC_STAGE_01"
60+
env:
61+
BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }}
62+
BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
63+
BROWSERSTACK_LOCAL: "true"
64+
BROWSERSTACK_LOCAL_IDENTIFIER: ${{ env.LOCAL_IDENTIFIER }}
65+
BUILD_NAME: ${{ github.event.inputs.build_name || 'Backcountry Prod Suite - Scheduled' }}
66+
PROJECT_NAME: "BC Automation"
67+
BROWSER_NAME: chrome
68+
BROWSER_VERSION: latest
69+
OS_NAME: Windows
70+
OS_VERSION: "11"
71+
72+
- name: Generate HTML Report
73+
if: always()
74+
run: npm run report
75+
76+
- name: Upload Test Results
77+
if: always()
78+
uses: actions/upload-artifact@v4
79+
with:
80+
name: test-results-cc-prod-${{ github.run_number }}
81+
path: |
82+
test-results/
83+
cucumber-report.html
84+
retention-days: 30
85+
86+
- name: Upload Screenshots
87+
if: failure()
88+
uses: actions/upload-artifact@v4
89+
with:
90+
name: failed-screenshots-cc-prod-${{ github.run_number }}
91+
path: test-results/screenshots/
92+
retention-days: 30
93+
94+
- name: Upload Videos
95+
if: failure()
96+
uses: actions/upload-artifact@v4
97+
with:
98+
name: failed-videos-cc-prod-${{ github.run_number }}
99+
path: test-results/videos/
100+
retention-days: 30
101+
102+
- name: "BrowserStackLocal Stop" # Terminating the BrowserStackLocal tunnel connection
103+
if: always()
104+
uses: browserstack/github-actions/setup-local@master
105+
with:
106+
local-testing: stop
107+
local-identifier: ${{ env.LOCAL_IDENTIFIER }}

.github/workflows/node.js.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ name: Node.js CI
55

66
on:
77
push:
8-
branches: [ "main" ]
8+
branches: [ "develop" ]
99
pull_request:
10-
branches: [ "main" ]
10+
branches: [ "develop" ]
1111
workflow_dispatch:
1212

1313
jobs:

customer-browserstack.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#BrowserStackLocal.exe --key 9cHptYeVk5e8mFXzj8kA
2+
userName:
3+
accessKey:
4+
5+
platforms:
6+
- os: OS X
7+
osVersion: Big Sur
8+
browserName: Chrome
9+
browserVersion: latest
10+
#chrome:
11+
# driver: 112.0.5615.28
12+
chromeOptions:
13+
args:
14+
- incognito
15+
- --disable-blink-features=AutomationControlled
16+
- --disable-infobars
17+
18+
bstack:options:
19+
http2: false
20+
#localIdentifier: ${LOCAL_IDENTIFIER}
21+
browserstackLocal: true
22+
browserStackLocalOptions:
23+
skipBinaryInitialisation: true
24+
localIdentifier: ${LOCAL_IDENTIFIER}
25+
acceptInsecureCerts: true
26+
buildName: browserstack-build-1
27+
projectName: BrowserStack Prod Suite Backcountry
28+
framework: playwright
29+
source: node-js-playwright-sample-sdk:v1
30+
networkLogs: true
31+
local: true
32+
geoLocation: US
33+
testObservability: true
34+
35+
#source: java:intellij:v1.1.6

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "",
55
"main": "index.js",
66
"scripts": {
7-
"test": "npx browserstack-node-sdk playwright test --config=./playwright.config.js --trace on",
7+
"test": "npx browserstack-node-sdk playwright test --config=./playwright.config.js --trace on --browserstack.config 'customer-browserstack.yml'",
88
"sample-test": "npx browserstack-node-sdk playwright test --config=./playwright.config.js --project='project1', 'project5'",
99
"sample-ats-test": "npx browserstack-node-sdk playwright test --config=./playwright.config.js --browserstack.config grid.browserstack.yml",
1010
"sample-local-test": "npx browserstack-node-sdk playwright test --config=./playwright.local.config.js",

0 commit comments

Comments
 (0)