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

Added testing to each pr request #261

Draft
wants to merge 2 commits into
base: is-sprint-26
Choose a base branch
from
Draft
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
34 changes: 34 additions & 0 deletions .github/workflows/run-synpress-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Run Synpress Tests and Build

on:
pull_request:
branches:
- is-sprint-24 # adjust if the main branch has a different name

jobs:
build-and-test:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '16.14.0' # or whatever version you need

- name: Install jq
run: sudo apt-get install jq

- name: Execute Build Script
run: ./scripts/build-station-extension.sh

- name: Checkout synpress test repository
uses: actions/checkout@v2
with:
repository: DimitrijeDragasevic/synpress
path: synpress

- name: Execute Synpress Test Script
run: ./scripts/run-synpress-tests.sh
25 changes: 25 additions & 0 deletions scripts/build-station-extension.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash

# Remove node_modules and build directories
rm -rf node_modules
rm -rf build

# Install dependencies
npm install

# Comment out lines 25-27 in browser-polyfill.js
sed -i '25,27s/^/\/\//g' node_modules/webextension-polyfill/dist/browser-polyfill.js

# Build the project
npm run build

# Navigate to build directory and modify manifest.json
cd build

# Using jq to modify the JSON
jq '.content_scripts[0].js = ["contentScript.js"]' manifest.json > manifest.tmp.json && mv manifest.tmp.json manifest.json

# (Optional) Navigate back to the root for any subsequent steps in the workflow
cd ..

echo "Build complete!"
8 changes: 8 additions & 0 deletions scripts/run-synpress-tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

# Navigate to the synpress directory
cd path/to/synpress

# Install dependencies & run synpress tests
yarn install
yarn test:e2e
Loading