Skip to content

Commit

Permalink
Merge pull request #9006 from infor-design/fix-tests2
Browse files Browse the repository at this point in the history
Chore - Add new build commands
  • Loading branch information
tmcconechy authored Sep 6, 2024
2 parents 65ba0b1 + 654989d commit bb11f7b
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 12 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,13 @@ jobs:
run: npx playwright install --with-deps

- name: Run Tests
run: npx percy exec -- npm run test:ci
run: npm run test:ci
env:
NODE_OPTIONS: "--max-old-space-size=8192"
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}

- name: Run Percy Tests
run: npx percy exec -- npm run test:ci:percy
env:
NODE_OPTIONS: "--max-old-space-size=8192"
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/env-deploy-gha.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Extract branch name
shell: bash
Expand Down Expand Up @@ -46,7 +46,7 @@ jobs:
tags: hookandloop/enterprise:${{ steps.extract_branch.outputs.branch }}
push: true

- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
repository: infor-design/apps
ref: main
Expand Down Expand Up @@ -94,15 +94,15 @@ jobs:
repository: infor-design/apps
github_token: ${{ secrets.GH_ACCESS_TOKEN }}
branch: main

- name: Install Browsers
run: npx playwright install --with-deps

- name: Install
run: npm ci

- name: Run Tests
run: npx percy exec -- npm run test:ci
- name: Install Browsers
run: npx playwright install --with-deps

- name: Run Percy Tests
run: npx percy exec -- npm run test:ci:percy
env:
NODE_OPTIONS: "--max-old-space-size=8192"
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/file-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
name: Test changed-files
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,13 @@
"stylelint:demo": "npx stylelint app/src/**/*.scss --config .stylelintrc",
"stylelint:src": "npx stylelint src/**/**/*.scss --config .stylelintrc",
"test:start-server": "node app/server.js --test-port",
"test": "PERCY_LOGLEVEL=silent npx playwright test --reporter=list",
"test": "npx playwright test --reporter=list",
"test:build": "npm run build:demoapp && npm run build",
"test:visual": "PERCY_LOGLEVEL=silent npx percy exec -- npx playwright test --reporter=list",
"test:visual": "npx percy exec -- npx playwright test --reporter=list",
"test:coverage": "npx rimraf .nyc_output && npm run build:coverage && npm run test && npx nyc report && open coverage/index.html",
"test:coverage:no-build": "npx rimraf .nyc_output && npm run test && npx nyc report && open coverage/index.html",
"test:ci": "PERCY_LOGLEVEL=silent npx rimraf .nyc_output && npm run build:coverage && npm run test && npx nyc report",
"test:ci": "npx rimraf .nyc_output && npm run build:coverage && npx playwright test --reporter=list --workers=3 --grep-invert 'percy' && npx nyc report",
"test:ci:percy": "npm run build && npx playwright test --reporter=list --workers=1 --grep 'percy'",
"watch": "npm run watch:js & npm run watch:scss",
"watch:js": "nodemon --watch \"src/\" -e js --ignore dist/ --ignore app/ -x \"npm run build:js\" --on-change-only",
"watch:scss": "nodemon --watch \"src/\" -e scss --ignore dist/ --ignore app/ -x \"npm run build:css\" --on-change-only",
Expand Down
1 change: 1 addition & 0 deletions tests/toolbar/toolbar.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ test.describe('Toolbar tests', () => {
test.describe('snapshot tests', () => {
test('should match the visual snapshot in percy', async ({ page, browserName }) => {
if (browserName !== 'chromium') return;
await page.waitForLoadState();
await percySnapshot(page, 'toolbar-light');
});
});
Expand Down

0 comments on commit bb11f7b

Please sign in to comment.