Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

ci: add @notesnook/web e2e tests workflow

Abdullah Attacc36951b9496
diff --git a/.github/workflows/core.tests.yml b/.github/workflows/core.tests.yml
index b84b0c64b..744697d66 100644
--- a/.github/workflows/core.tests.yml
+++ b/.github/workflows/core.tests.yml
@@ -19,11 +19,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v2
+ - uses: actions/checkout@v3
- name: Use Node.js 16.x
- uses: actions/setup-node@v2
+ uses: actions/setup-node@v3
with:
node-version: 16.x
+ cache: 'npm'
+ cache-dependency-path: '**/package-lock.json'
+
- name: Prepare environment
run: |
npm install
diff --git a/.github/workflows/web.tests.yml b/.github/workflows/web.tests.yml
new file mode 100644
index 000000000..2841ea971
--- /dev/null
+++ b/.github/workflows/web.tests.yml
@@ -0,0 +1,43 @@
+name: Test @notesnook/web
+
+on:
+ workflow_dispatch:
+ push:
+ branches:
+ - "master"
+ paths:
+ - "apps/web/**"
+ # re-run workflow if workflow file changes
+ - ".github/workflows/web.tests.yml"
+ pull_request:
+ types:
+ - "ready_for_review"
+ - "opened"
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ - name: Use Node.js 16.x
+ uses: actions/setup-node@v3
+ with:
+ node-version: 16.x
+ cache: 'npm'
+ cache-dependency-path: '**/package-lock.json'
+
+ - name: Add environment variables
+ run: |
+ echo "USER_EMAIL=${{ secrets.USER_EMAIL }}" >> $GITHUB_ENV
+ echo "CURRENT_USER_PASSWORD='${{ secrets.USER_PASSWORD }}'" >> $GITHUB_ENV
+ echo "CURRENT_USER_KEY=${{ secrets.USER_KEY }}" >> $GITHUB_ENV
+
+ - name: Prepare environment
+ run: npm install
+
+ - name: Install Playwright Browsers
+ run: npx playwright install --with-deps
+ working-directory: ./apps/web
+
+ - name: Run all @notesnook/web tests
+ run: npm run test:web
diff --git a/apps/web/.github/workflows/e2e.yml.disabled b/apps/web/.github/workflows/e2e.yml.disabled
deleted file mode 100644
index 8566ecd40..000000000
--- a/apps/web/.github/workflows/e2e.yml.disabled
+++ /dev/null
@@ -1,31 +0,0 @@
-name: E2E Tests
-
-on:
- push:
- branches: [master]
- pull_request:
- branches: [master]
-
-jobs:
- build:
- runs-on: ubuntu-latest
- env:
- GH_DEPLOY_KEY: ${{ secrets.GH_DEPLOY_KEY }}
- steps:
- - run: echo "CI=true" >> $GITHUB_ENV
- - name: Checkout 🛎️
- uses: actions/checkout@v2 # If you're using actions/checkout@v2 you must set persist-credentials to false in most cases for the deployment to work correctly.
- with:
- persist-credentials: false
-
- - name: Use Node.js 16.x
- uses: actions/setup-node@v2
- with:
- node-version: 16.x
- - run: npm ci
- - run: npm exec playwright install-deps
- - run: npm exec playwright install
- - run: npm run test
- env:
- USER_EMAIL: ${{ secrets.USER_EMAIL }}
- USER_PASSWORD: ${{ secrets.USER_PASSWORD }}