Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanheinze committed Feb 5, 2024
2 parents 0eec1e6 + eaf47ca commit d21a1bd
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 13 deletions.
20 changes: 12 additions & 8 deletions .github/workflows/run-playwright-browserstack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@ name: Run Playwright on Browserstack

on:
workflow_dispatch:
secrets:
inputs:
user_name:
description: browserstack user name
description: 'browserstack user name'
required: true
type: string
access_key:
description: browserstack access key
description: 'browserstack access key'
required: true
type: string

jobs:
build:
Expand All @@ -24,6 +22,15 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Mask Credentials and store them in env
run: |
BROWSERSTACK_USER_NAME=$(jq -r '.inputs.user_name' $GITHUB_EVENT_PATH)
BROWSERSTACK_ACCESS_KEY=$(jq -r '.inputs.access_key' $GITHUB_EVENT_PATH)
echo ::add-mask::$BROWSERSTACK_USER_NAME
echo ::add-mask::$BROWSERSTACK_ACCESS_KEY
echo BROWSERSTACK_USER_NAME=$BROWSERSTACK_USER_NAME >> $GITHUB_ENV
echo BROWSERSTACK_ACCESS_KEY=$BROWSERSTACK_ACCESS_KEY >> $GITHUB_ENV
# setting up node
- name: Setup Node.js
uses: actions/setup-node@v3
Expand All @@ -46,6 +53,3 @@ jobs:
- name: PlayWright Test
run: |
npm run e2e:playwright:ci-browserstack
env:
BROWSERSTACK_USER_NAME: ${{ inputs.user_name }}
BROWSERSTACK_ACCESS_KEY: ${{ inputs.access_key }}
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ Run `npm run e2e:playwright` to execute the end-to-end tests via Playwright.

Run `npm run e2e:playwright:ui` to start [Playwright UI Mode](https://playwright.dev/docs/test-ui-mode).

### Running Playwright tests with Browserstack
### Running Playwright tests with BrowserStack

Precondition: You need a browserstack account to get your username and access key https://www.browserstack.com/docs/iaam/security/manage-access-keys.
Precondition: You need a BrowserStack account to get your username and access key: https://www.browserstack.com/docs/iaam/security/manage-access-keys.

Run tests with Github workflow:

- Follow the Github Guide (https://docs.github.com/en/actions/using-workflows/manually-running-a-workflow)
- The workflow that needs to be started is called `Run Playwright on Browserstack`
- Enter the Browserstack credentials as input parameters.
- Enter the BrowserStack credentials as input parameters.

## Running layout tests

Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
"e2e:wdio:ci": "start-server-and-test start http://localhost:4200 e2e:wdio",
"galen": "galen",
"layout-tests:browserstack": "bash ./layout-tests/run-tests-on-browserstack.sh",
"prepare": "husky install",
"postinstall": "npm update browserstack-node-sdk"
"prepare": "husky install"
},
"dependencies": {
"@angular/animations": "17.0.7",
Expand Down

0 comments on commit d21a1bd

Please sign in to comment.