Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: adding cypress integration tests #240

Merged
merged 10 commits into from
Jan 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
pull_request:

jobs:
test:
unit-test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
Expand All @@ -20,7 +20,7 @@ jobs:
node_version: 16
fail-fast: false

name: 'Build & Test: node-${{ matrix.node_version }}, ${{ matrix.os }}'
name: 'Build & Unit Test: node-${{ matrix.node_version }}, ${{ matrix.os }}'
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -45,6 +45,24 @@ jobs:
- name: Test
run: pnpm run test

e2e-test:
runs-on: ubuntu-latest
name: 'E2E Doc Test: node-16, ubuntu-latest'
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 6

- name: Install deps
run: pnpm install

- name: Run E2E
run: pnpm run docs:build:ci

lint:
runs-on: ubuntu-latest
name: 'Lint: node-16, ubuntu-latest'
Expand Down
11 changes: 11 additions & 0 deletions cypress.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"video": false,
"e2e": {
"baseUrl": "http://localhost:5000",
"integrationFolder": "cypress/e2e",
"testFiles": "**/*.cy.*",
"pluginsFile": false,
"supportFile": false,
"fixturesFolder": false
}
}
11 changes: 11 additions & 0 deletions cypress/e2e/smoke.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
describe('Smoke Test', () => {
it('compiles the guide page', () => {
cy.visit('/guide/');
cy.contains('Getting Started');
});

// it('compiles the playground page', () => {
// cy.visit('/playground/');
// cy.contains('Playground under construction');
// });
});
8 changes: 8 additions & 0 deletions cypress/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"compilerOptions": {
"target": "ES5",
"lib": ["ES5", "DOM"],
"types": ["cypress"]
},
"include": ["**/*.ts"]
}
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,11 @@
"format": "prettier --write .",
"lint": "echo 'TODO eslint'",
"test": "vitest",
"coverage": "vitest run --coverage"
"coverage": "vitest run --coverage",
"cypress": "cypress",
"docs:test:e2e:ci": "run-s docs:build:ci docs:test:e2e:run",
"docs:test:e2e:run": "run-p --race docs:serve \"cypress run\"",
"docs:test:e2e:open": "run-p --race docs:serve \"cypress open\""
},
"simple-git-hooks": {
"pre-commit": "npx lint-staged --concurrent false",
Expand All @@ -85,6 +89,7 @@
"@vitest/ui": "~0.1.24",
"c8": "~7.11.0",
"conventional-changelog-cli": "~2.2.2",
"cypress": "~9.3.1",
"esbuild": "~0.14.13",
"eslint": "^6.5.1",
"esno": "~0.13.0",
Expand Down
Loading