Skip to content

Commit

Permalink
Merge a493cb0 into ab1078a
Browse files Browse the repository at this point in the history
  • Loading branch information
oshi97 committed Jan 27, 2022
2 parents ab1078a + a493cb0 commit 3e737d9
Show file tree
Hide file tree
Showing 19 changed files with 132 additions and 33 deletions.
16 changes: 0 additions & 16 deletions .circleci/run_browserstack_acceptance.sh

This file was deleted.

11 changes: 0 additions & 11 deletions .circleci/run_headless_acceptance.sh

This file was deleted.

19 changes: 19 additions & 0 deletions .github/run_browserstack_acceptance.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

export BROWSERSTACK_USE_AUTOMATE="1"
export BROWSERSTACK_PROJECT_NAME="Answers SDK"
export BROWSERSTACK_BUILD_ID="${GITHUB_REF_NAME} - ${GITHUB_RUN_ID} + ${CIRCLE_BUILD_NUM}"
COMMIT_MSG_TITLE=$(git log -n 1 --pretty=format:%s)
export BROWSERSTACK_TEST_RUN_NAME=$COMMIT_MSG_TITLE

if [[ $GITHUB_REF_NAME == release/*
|| $GITHUB_REF_NAME == hotfix/*
|| $GITHUB_REF_NAME == master
|| $GITHUB_REF_NAME == support/* ]]
then
echo "inside the if"
npx testcafe "browserstack:ie@11.0,browserstack:safari" --config-file ./.github/testcafe.json -q
else
echo "inside the else"
npx testcafe -c 2 "browserstack:ie@11.0" --config-file ./.github/testcafe.json -q
fi
13 changes: 13 additions & 0 deletions .github/run_headless_acceptance.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

if [[ $GITHUB_REF_NAME == release/*
|| $GITHUB_REF_NAME == hotfix/*
|| $GITHUB_REF_NAME == master
|| $GITHUB_REF_NAME == support/* ]]
then
echo "inside the if"
npx testcafe -c 3 "chrome:headless,firefox:headless" --config-file ./.github/testcafe.json -q
else
echo "inside the else"
npx testcafe -c 3 "chrome:headless" --config-file ./.github/testcafe.json -q
fi
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#!/bin/bash

export BROWSERSTACK_USE_AUTOMATE="1"
export BROWSERSTACK_PROJECT_NAME="Answers SDK"
export BROWSERSTACK_BUILD_ID="${CIRCLE_BRANCH} - ${CIRCLE_BUILD_NUM}"
export BROWSERSTACK_BUILD_ID="${GITHUB_REF_NAME} - ${GITHUB_RUN_ID}"
COMMIT_MSG_TITLE=$(git log -n 1 --pretty=format:%s)
export BROWSERSTACK_TEST_RUN_NAME=$COMMIT_MSG_TITLE

npx testcafe chrome:headless,firefox:headless,browserstack:safari,browserstack:edge tests/acceptance/useragent/useragentsuite.js --config-file ./.circleci/testcafe.json
npx testcafe chrome:headless,firefox:headless,browserstack:safari,browserstack:edge tests/acceptance/useragent/useragentsuite.js --config-file ./.github/testcafe.json
File renamed without changes.
File renamed without changes.
70 changes: 70 additions & 0 deletions .github/workflows/acceptance.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Run acceptance tests

on:
workflow_call:
secrets:
BROWSERSTACK_USERNAME:
required: true
BROWSERSTACK_ACCESS_KEY:
required: true

jobs:
headless_acceptance:
name: Headless Acceptance
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js 14
uses: actions/setup-node@v2
with:
node-version: 14
cache: 'npm'
- run: npm ci
- name: Download build-output artifact
uses: actions/download-artifact@v2
with:
name: build-output
path: dist/
- run: ./.github/run_headless_acceptance.sh

browserstack_acceptance:
name: Browserstack Acceptance
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js 14
uses: actions/setup-node@v2
with:
node-version: 14
cache: 'npm'
- run: npm ci
- name: Download build-output artifact
uses: actions/download-artifact@v2
with:
name: build-output
path: dist/
- run: ./.github/run_browserstack_acceptance.sh
env:
BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }}
BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}

useragent:
name: Useragent Acceptance
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js 14
uses: actions/setup-node@v2
with:
node-version: 14
cache: 'npm'
- run: npm ci
- name: Download build-output artifact
uses: actions/download-artifact@v2
with:
name: build-output
path: dist/
- run: ./.github/run_useragent_acceptance.sh
env:
BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }}
BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
11 changes: 9 additions & 2 deletions .github/workflows/build_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ on:
branches-ignore:
- develop
- master
- support/**
- hotfix/**
- feature/**-i18n
- release/**
Expand All @@ -18,6 +17,13 @@ jobs:
uses: ./.github/workflows/unit_test.yml
needs: call_build

call_acceptance:
uses: ./.github/workflows/acceptance.yml
needs: call_build
secrets:
BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }}
BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}

format_branch_name:
runs-on: ubuntu-latest
outputs:
Expand All @@ -34,6 +40,7 @@ jobs:
needs:
- call_unit_test
- format_branch_name
- call_acceptance
uses: ./.github/workflows/deploy.yml
with:
directory: dev/${{ needs.format_branch_name.outputs.formatted_branch }}
Expand All @@ -43,4 +50,4 @@ jobs:

concurrency:
group: ci-build-and-deploy-${{ github.ref }}-1
cancel-in-progress: true
cancel-in-progress: true
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
"docs": "jsdoc -R README.md -d docs/ -r src/",
"lint": "eslint .",
"test": "eslint . && stylelint src/**/*.scss && cross-env NODE_ICU_DATA=node_modules/full-icu jest",
"acceptance": "testcafe safari,chrome --config-file ./.circleci/testcafe.json",
"acceptance": "testcafe safari,chrome --config-file ./.github/testcafe.json",
"wcag": "./tests/acceptance/wcag/index.js",
"size": "size-limit",
"fix": "eslint . --fix",
Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/blocks/filtersearchcomponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ export default class FilterSearchComponentBlock {
.typeText(this._input, displayValue)
.pressKey('space')
.wait(500)
.click(this._selector.find('.js-yext-autocomplete-option').withText(displayValue));
.click(this._selector.find('.js-yext-autocomplete-option').withExactText(displayValue));
}
}
2 changes: 2 additions & 0 deletions tests/acceptance/fixtures/html/facets.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@
verticalKey: 'people',
},
onReady: function () {
this.setGeolocation(38.8955, -77.0699);

this.addComponent('SearchBar', {
container: '.search-bar-container',
clearButton: true,
Expand Down
2 changes: 2 additions & 0 deletions tests/acceptance/fixtures/html/facetsonload.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@
verticalKey: 'people',
},
onReady: function () {
this.setGeolocation(38.8955, -77.0699);

this.addComponent('SearchBar', {
container: '.search-bar-container',
clearButton: true,
Expand Down
2 changes: 2 additions & 0 deletions tests/acceptance/fixtures/html/filterbox.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@
defaultInitialSearch: ''
},
onReady: function () {
this.setGeolocation(38.8955, -77.0699);

this.addComponent('SearchBar', {
container: '.search-bar-container',
clearButton: true,
Expand Down
2 changes: 2 additions & 0 deletions tests/acceptance/fixtures/html/no-unsafe-eval.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
defaultInitialSearch: 'virginia'
},
onReady: function () {
this.setGeolocation(38.8955, -77.0699);

this.addComponent('SearchBar', {
container: '.search-bar-container',
verticalKey: 'people'
Expand Down
2 changes: 2 additions & 0 deletions tests/acceptance/fixtures/html/searchbaronly.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
experienceVersion: 'PRODUCTION',
templateBundle: TemplateBundle.default,
onReady: function() {
this.setGeolocation(38.8955, -77.0699);

this.addComponent('SearchBar', {
container: '.search-bar-container',
clearButton: true,
Expand Down
2 changes: 2 additions & 0 deletions tests/acceptance/fixtures/html/universal.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
experienceVersion: 'PRODUCTION',
templateBundle: TemplateBundle.default,
onReady: function() {
this.setGeolocation(38.8955, -77.0699);

this.addComponent('SearchBar', {
container: '.search-bar-container',
clearButton: true,
Expand Down
2 changes: 2 additions & 0 deletions tests/acceptance/fixtures/html/universalinitialsearch.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
defaultInitialSearch: ''
},
onReady: function () {
this.setGeolocation(38.8955, -77.0699);

this.addComponent('SearchBar', {
container: '.search-bar-container',
clearButton: true,
Expand Down
2 changes: 2 additions & 0 deletions tests/acceptance/fixtures/html/vertical.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
displayAllResults: true
},
onReady: function() {
this.setGeolocation(38.8955, -77.0699);

this.addComponent('SearchBar', {
container: '.search-bar-container',
verticalKey:'KM',
Expand Down

0 comments on commit 3e737d9

Please sign in to comment.