diff --git a/.github/workflows/run-playwright-browserstack.yml b/.github/workflows/run-playwright-browserstack.yml index e743778..69dcc41 100644 --- a/.github/workflows/run-playwright-browserstack.yml +++ b/.github/workflows/run-playwright-browserstack.yml @@ -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: @@ -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 @@ -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 }} diff --git a/README.md b/README.md index 9bdc802..a2eb294 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/package.json b/package.json index cb7acd4..30ab83b 100644 --- a/package.json +++ b/package.json @@ -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",