Skip to content

Commit

Permalink
Merge pull request #411 from o1-labs/e2e-playwright-tests
Browse files Browse the repository at this point in the history
Initial E2E tests for SnarkyJS Web version
  • Loading branch information
shimkiv authored Sep 15, 2022
2 parents 235dc35 + 838f053 commit 1223f2e
Show file tree
Hide file tree
Showing 20 changed files with 825 additions and 37 deletions.
34 changes: 21 additions & 13 deletions .github/workflows/build-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,17 @@ jobs:
steps:
- name: Checkout Repository
uses: actions/checkout@v2

- name: Setup node
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: '18'

- name: run build:node & tests
node-version: "18"
- name: Build SnarkyJS and Execute Tests
run: |
npm ci
npm run build:node
npm run test:unit
npm run test
npm run test:integration
- name: Publish to NPM if version has changed
uses: JS-DevTools/npm-publish@v1
if: github.ref == 'refs/heads/releases'
Expand All @@ -37,18 +34,29 @@ jobs:
env:
INPUT_TOKEN: ${{ secrets.NPM_TOKEN }}

Build-Web:
Build-And-Test-Web:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2

- name: Setup node
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: '18'

- name: run build:web
node-version: "18"
- name: Install Node Dependencies
run: npm ci
- name: Install Playwright Browsers
run: npm run e2e:install
- name: Build SnarkyJS and Prepare the Web Server
run: |
npm ci
npm run build:web
npm run e2e:prepare-server
- name: Execute E2E Tests
run: npm run test:e2e
- name: Upload E2E Test Artifacts
uses: actions/upload-artifact@v2
if: always()
with:
name: e2e-tests-report
path: tests/report/
retention-days: 30
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
node_modules
dist/
o1labs*.tgz
tests/report/
tests/test-artifacts/
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- `reducer.getActions` partially implemented for local testing https://github.com/o1-labs/snarkyjs/pull/327
- `gte` and `assertGte` methods on `UInt32`, `UInt64` https://github.com/o1-labs/snarkyjs/pull/349
- Return sent transaction `hash` for `RemoteBlockchain` https://github.com/o1-labs/snarkyjs/pull/399

### Changed

Expand Down
31 changes: 26 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ See [CHANGELOG.md](https://github.com/o1-labs/snarkyjs/blob/main/CHANGELOG.md) f

## Run examples in Node

```
```sh
npm install
npm run build

Expand All @@ -17,7 +17,7 @@ npm run build

## Build and run web version

```
```sh
npm install
npm run build:web
npm run serve:web
Expand All @@ -27,9 +27,30 @@ Then go to `http://localhost:8000/`

## Run tests

```
npm run test
```
- Unit tests

```sh
npm run test
npm run test:unit
```

- Integration tests

```sh
npm run test:integration
```

- E2E tests

```sh
npm install
npm run e2e:install
npm run build:web

npm run e2e:prepare-server
npm run test:e2e
npm run e2e:show-report
```

## Contributing

Expand Down
195 changes: 195 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 1223f2e

Please sign in to comment.