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

Code Quality: Add E2E tests for extension and CLI #773

Merged
merged 26 commits into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
6983fcb
Add test utils in devtools.
amovar18 Jul 15, 2024
103d6fa
Add e2e test workflow.
amovar18 Jul 15, 2024
dee757e
Add cookie search and cookie landing page tests.
amovar18 Jul 15, 2024
da7c385
Add known breakages and cookie table.
amovar18 Jul 15, 2024
fc5b939
Add disqus and facebook like and comment.
amovar18 Jul 15, 2024
036a716
Add settings page test.
amovar18 Jul 15, 2024
e4ba215
Add test runners for extension.
amovar18 Jul 15, 2024
f66f468
Add config for untiTests and remove testEnvironment from shared
mayan-000 Jul 15, 2024
e1d77e7
Merge branch 'develop' of github.com:GoogleChromeLabs/ps-analysis-too…
amovar18 Jul 24, 2024
8778455
Merge branch 'ref/e2e-tests' of github.com:GoogleChromeLabs/ps-analys…
amovar18 Jul 24, 2024
e2997b1
Add test for allow list and rws membership.
amovar18 Jul 24, 2024
a170834
Merge branch 'develop' of github.com:GoogleChromeLabs/ps-analysis-too…
amovar18 Jul 30, 2024
e188b63
Fix failiing e2e test
amovar18 Jul 30, 2024
96a0557
Merge branch 'develop' of github.com:GoogleChromeLabs/ps-analysis-too…
amovar18 Jul 30, 2024
97c97b0
Fix tests.
amovar18 Jul 30, 2024
d8f54a1
Fix workflow.
amovar18 Jul 30, 2024
903c892
Merge branch 'develop' of github.com:GoogleChromeLabs/ps-analysis-too…
mohdsayed Jul 31, 2024
6e83760
Merge branch 'develop' of github.com:GoogleChromeLabs/ps-analysis-too…
amovar18 Jul 31, 2024
2f538ce
Fix node version in workflow.
amovar18 Jul 31, 2024
7495fd6
Merge branch 'ref/e2e-tests' of github.com:GoogleChromeLabs/ps-analys…
amovar18 Jul 31, 2024
2542480
Fix failing test.
amovar18 Jul 31, 2024
52e93ca
Update workflow.
amovar18 Jul 31, 2024
c354b5c
Merge branch 'develop' of github.com:GoogleChromeLabs/ps-analysis-too…
amovar18 Jul 31, 2024
42e757d
Make headless true.
amovar18 Jul 31, 2024
b21bba4
Increase testing timeout.
amovar18 Jul 31, 2024
53e770e
Use bbc.com
amovar18 Jul 31, 2024
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
63 changes: 63 additions & 0 deletions .github/workflows/tests-cli-e2e-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: PSAT E2E Tests

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches:
- develop

pull_request:
branches:
- develop

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
e2e-test:
# The type of runner that the job will run on
name: CLI E2E Tests
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18

- name: Set Chrome executable path
run: |
CHROME_PATH=$(which google-chrome-stable || which google-chrome || which chrome || which chromium)
echo "CHROME_PATH=$CHROME_PATH" >> $GITHUB_ENV
- name: Install dependancy
run: |
ls
pwd
npm install || true
npm run build:cli:dashboard
- name: Install Xvfb
run: sudo apt-get install -y xvfb

- name: Start Xvfb
run: Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &

- name: Delay for Xvfb to Start
run: sleep 6 # Adjust the sleep duration as needed

- name: Export DISPLAY
run: export DISPLAY=:99

- name: Run the tests
run: |
npm run test:cli:e2e
- name: Archive build artifacts
uses: actions/upload-artifact@v2
with:
name: my-artifact
path: cd tests/e2e-test/utils/
69 changes: 69 additions & 0 deletions .github/workflows/tests-extension-e2e-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: PSAT E2E tests

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches:
- develop

pull_request:
branches:
- develop

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Cancels all prior workflow runs associated with pull requests that are still in progress.
concurrency:
# The concurrency group contains the workflow name and the (target) branch name.
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true

jobs:
e2e-test:
# The type of runner that the job will run on
name: Extension E2E Tests
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18

- name: Set Chrome executable path
run: |
CHROME_PATH=$(which google-chrome-stable || which google-chrome || which chrome || which chromium)
echo "CHROME_PATH=$CHROME_PATH" >> $GITHUB_ENV
- name: Install dependancy
run: |
ls
pwd
npm install || true
npm run build:ext
- name: Install Xvfb
run: sudo apt-get install -y xvfb

- name: Start Xvfb
run: Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &

- name: Delay for Xvfb to Start
run: sleep 6 # Adjust the sleep duration as needed

- name: Export DISPLAY
run: export DISPLAY=:99

- name: Run the tests
run: |
npm run test:extension:e2e
- name: Archive build artifacts
uses: actions/upload-artifact@v2
with:
name: my-artifact
path: cd tests/e2e-test/utils/
Loading
Loading