Skip to content
Open
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
30 changes: 30 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Integration Tests

on:
push:
branches: [master, main]
pull_request:
branches: [master, main]

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 24
- uses: browser-actions/setup-firefox@v1

- name: Install dependencies and build extension
run: |
npm install
npm run build

- name: Install test dependencies
working-directory: test
run: npm install

- name: Run integration tests
working-directory: test
run: HEADLESS=1 npm test
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ tomato-clock.zip
*.swp

node_modules/
test/package-lock.json
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,31 @@ Run the following command with the appropriate `npm version {patch/minor/major}`
npm version patch && git push && git push --tags
```

### Running integration tests

The integration tests require additional packages and your Firefox installation on your PATH.

1. Build the extension first:

```sh
npm run build
```

2. Enter test directory, install dependencies, and run the integration tests:

```sh
cd test
npm install
npm test
```

Or you can run the tests headlessly with

```sh
cd test
HEADLESS=1 npm test
```

### Building submission file

Run one of the following commands so that webpack can build the submission zip file into `/dist-zip`:
Expand Down
12 changes: 12 additions & 0 deletions test/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "tomato-clock-tests",
"private": true,
"scripts": {
"test": "node test.js"
},
"dependencies": {
"geckodriver": "*",
"selenium-webdriver": "^4.0.0",
"selenium-webext-bridge": "^0.3.0"
}
}
Loading