Merge remote-tracking branch 'origin/main' #38
This file contains hidden or 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 Tests | |
| on: | |
| workflow_dispatch: # 👈 enables manual trigger | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| env: | |
| BASE_URL_FE: https://ultimateqa.com/complicated-page # <-- Set your actual BASE_URL here | |
| BASE_URL_API: https://jsonplaceholder.typicode.com | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v2 | |
| with: | |
| node-version: '22' | |
| - name: Install Allure Commandline | |
| run: npm install -g allure-commandline --save-dev | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.11' | |
| - name: Install dependencies | |
| run: | | |
| python -m venv .venv | |
| source .venv/bin/activate | |
| pip install --upgrade pip | |
| pip install -r requirements.txt | |
| - name: Install all Playwright Browsers | |
| run: | | |
| source .venv/bin/activate | |
| python -m playwright install chrome --with-deps | |
| - name: Create .env file from workflow | |
| run: | | |
| echo "BASE_URL_FE=${BASE_URL_FE}" > .env | |
| echo "BASE_URL_API=${BASE_URL_API}" > .env | |
| - name: Run tests(UI & API) with Pytest | |
| run: | | |
| source .venv/bin/activate | |
| pytest Ultimateqa/ui_tests api_tests -n auto --alluredir=allure-results | |
| - name: Generate Allure Report | |
| run: | | |
| npx allure generate allure-results --clean -o allure-report | |
| - name: Deploy Allure Report to GitHub Pages | |
| uses: peaceiris/actions-gh-pages@v3 | |
| with: | |
| github_token: ${{ secrets.GH_PAGES_ALLURE }} | |
| publish_dir: ./allure-report | |