Add pytest.mark.run order to the rest of the pages #11
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run all tests | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
- test-branch | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
services: | |
selenium: | |
image: selenium/standalone-firefox:latest | |
ports: | |
- 4444:4444 | |
options: >- | |
--shm-size 2g | |
steps: | |
# Step 1: Checkout the repository | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
# Step 2: Set up Python | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
# Step 3: Install dependencies | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
# Step 4: Run pytest tests | |
- name: Run Selenium tests | |
env: | |
SELENIUM_REMOTE_URL: http://localhost:4444/wd/hub | |
OBI_USERNAME: ${{ secrets.OBI_USERNAME }} | |
OBI_PASSWORD: ${{ secrets.OBI_PASSWORD }} | |
BROWSER_NAME: firefox | |
run: | | |
pytest tests/test_login.py -sv --headless | |
# Step 5: Slack notification on success | |
- name: Notify Slack on Success | |
if: success() | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |
run: | | |
curl -X POST -H 'Content-type: application/json' \ | |
--data "{\"text\":\":white_check_mark: Test pipeline succeeded in *${{ github.repository }}*. Branch: *${{ github.ref_name }}*\", \"username\":\"GitHub Actions\", \"icon_emoji\":\":rocket:\"}" \ | |
$SLACK_WEBHOOK_URL | |
# Step 6: Slack notification on failure | |
- name: Notify Slack on Failure | |
if: failure() | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |
run: | | |
curl -X POST -H 'Content-type: application/json' \ | |
--data "{\"text\":\":x: Test pipeline failed in *${{ github.repository }}*. Branch: *${{ github.ref_name }}*. Check the logs for details.\", \"username\":\"GitHub Actions\", \"icon_emoji\":\":warning:\"}" \ | |
$SLACK_WEBHOOK_URL |