Skip to content

E2E Tests

E2E Tests #11

Workflow file for this run

name: E2E Tests
on:
schedule:
# Run everday at midnight UTC / 5:30 IST
- cron: "0 0 * * *"
jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
name: UI Tests
services:
mariadb:
image: mariadb:10.6
env:
MYSQL_ROOT_PASSWORD: root
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3
steps:
- name: Clone
uses: actions/checkout@v2
- name: Check files
run: |
python -m compileall -q -f "${GITHUB_WORKSPACE}"
if grep -lr --exclude-dir=node_modules "^<<<<<<< " "${GITHUB_WORKSPACE}"
then echo "Found merge conflicts"
exit 1
fi
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16
- name: Cache pip
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/*requirements.txt', '**/pyproject.toml', '**/setup.py', '**/setup.cfg') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-ui-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-ui-
- name: Install Dependencies
run: |
bash ${GITHUB_WORKSPACE}/.github/helpers/install_dependencies.sh
- name: Setup Frappe Bench
run: |
pip install frappe-bench
bench init --skip-assets --python "$(which python)" ~/frappe-bench
mysql --host 127.0.0.1 --port 3306 -u root -proot -e "SET GLOBAL character_set_server = 'utf8mb4'"
mysql --host 127.0.0.1 --port 3306 -u root -proot -e "SET GLOBAL collation_server = 'utf8mb4_unicode_ci'"
- name: Install Insights
working-directory: /home/runner/frappe-bench
run: |
bench get-app insights $GITHUB_WORKSPACE --skip-assets
bench setup requirements
bench new-site --db-root-password root --admin-password frappe frappe-insights
bench --site frappe-insights add-to-hosts
bench --site frappe-insights install-app insights
bench build
env:
CI: "Yes"
- name: Complete Setup Wizard
run: |
cd ~/frappe-bench/
bench --site frappe-insights execute frappe.utils.install.complete_setup_wizard
bench --site frappe-insights set-config admin_password frappe
bench --site frappe-insights execute frappe.tests.ui_test_helpers.create_test_user
- name: Start Bench
working-directory: /home/runner/frappe-bench
run: |
sed -i 's/^watch:/# watch:/g' Procfile
sed -i 's/^schedule:/# schedule:/g' Procfile
bench start &> bench_start.log &
- name: Install Playwright Browsers
run: cd ~/frappe-bench/apps/insights/frontend && yarn playwright install --with-deps
- name: Run Playwright tests
run: cd ~/frappe-bench/apps/insights/frontend && yarn playwright test
- uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30