Skip to content

UI Tests

UI Tests #10

name: UI Tests
on: workflow_dispatch
jobs:
ui-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install Chrome
run: sudo apt-get install google-chrome-stable
- name: Show current directory
run: ls -lah
- name: Install dependencies
working-directory: ./English-exercises-AQA
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
working-directory: ./English-exercises-AQA
run: |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Run tests
working-directory: ./English-exercises-AQA
run: |
pytest -s -vv --alluredir=allure-results
- name: Add allure information
working-directory: ./English-exercises-AQA/allure-results
if: always()
run: |
echo GIT_BRANCH=${{ github.head_ref || github.ref_name }} >> environment.properties
echo GIT_COMMIT_ID=${{ github.sha }} >> environment.properties
echo GIT_COMMIT_MESSAGE=$(git show -s --format=%s HEAD) >> environment.properties
echo GIT_COMMIT_AUTHOR_NAME=$(git show -s --format='%ae' HEAD) >> environment.properties
echo GIT_COMMIT_TIME=$(git show -s --format=%ci HEAD) >> environment.properties
echo CHROME_VERSION=$(google-chrome --product-version) >> environment.properties
- name: Checkout (copy) gh-pages repository to GitHub runner
uses: actions/checkout@v2
if: always()
with:
ref: gh-pages
path: ./.github/gh-pages
- name: Debug1
working-directory: ./English-exercises-AQA
run: ls -lah
- name: Debug2
working-directory: ./English-exercises-AQA
run: ls -lah ../
- name: Debug3
working-directory: ./English-exercises-AQA
run: ls -lah ../.github
- name: Debug4
working-directory: ./English-exercises-AQA
run: ls -lah ../.github/gh-pages
- name: Copy history from gh-pages to allure-results
working-directory: ./English-exercises-AQA
if: always()
run: |
sudo mkdir -p allure-results/history
sudo cp -R ../.github/gh-pages/history/* allure-results/history/
- name: Generate Allure report
working-directory: ./English-exercises-AQA
if: always()
run: |
sudo docker-compose run regression /bin/sh -c "allure generate allure-results --clean -o allure-report"
- name: Update Allure history
working-directory: ./English-exercises-AQA
if: always()
run: |
sudo cp -R allure-report/history/* ./.github/gh-pages/history/
- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
if: always()
with:
token: ${{ secrets.CI_TOKEN }}
branch: gh-pages
folder: allure-report
#clean: true