diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index bdb15e5..63504fa 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -16,7 +16,8 @@ jobs: steps: - uses: actions/checkout@v2 - + - run: | + mkdir -p saved_screenshots - uses: actions/cache@v2 with: path: | @@ -65,8 +66,22 @@ jobs: - name: Test with pytest + id: test run: | pytest -vs + continue-on-error: true + + - name: Attach screenshots + uses: actions/upload-artifact@v2 + if: steps.test.outcome != 'success' + with: + name: Saved_screenshots + path: saved_screenshots + - name: Docker stop run: docker-compose -f ./selenium-grid/docker-compose.yml down + + - name: Check on failures + if: steps.test.outcome != 'success' + run: exit 1 \ No newline at end of file diff --git a/conftest.py b/conftest.py index b1ed75c..014fc68 100644 --- a/conftest.py +++ b/conftest.py @@ -66,6 +66,7 @@ def init_driver(request): raise Exception('driver is not found') driver.get(TD.BASE_URL) + driver.save_screenshot("saved_screenshots/screenshot_1.png") if driver.title == "Sign in [Jenkins]": WebDriverWait(driver, 90).until(EC.presence_of_element_located((By.ID, 'j_username'))).send_keys(TD.LOGIN) driver.find_element(By.CSS_SELECTOR, 'input[name="j_password"]').send_keys(TD.PASSWORD)