From 5f34f2fce01ca17ca98030bad47bbd20c55566e4 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 22 Oct 2024 17:47:38 +0100 Subject: [PATCH] publish to gibhun-dev --- .github/workflows/tests_dev.yml | 17 +++++++---------- .gitignore | 1 + init_helpers.py | 10 ---------- tests/test_find_a_patient_steps.py | 13 +++++++++++-- 4 files changed, 19 insertions(+), 22 deletions(-) diff --git a/.github/workflows/tests_dev.yml b/.github/workflows/tests_dev.yml index 5b6ae23e1..22f6ecc93 100644 --- a/.github/workflows/tests_dev.yml +++ b/.github/workflows/tests_dev.yml @@ -163,21 +163,18 @@ jobs: with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: . - destination_branch: ${{ env.DESTINATION_BRANCH }} + destination_branch: gh-pages-dev - name: Check contents of gh-pages - run: ls -la + run: | + git fetch origin gh-pages-dev + git checkout gh-pages-dev + ls -la # List the contents to verify the deployment - name: Get GitHub Pages URL id: pages-url - uses: actions/github-script@v7 - with: - script: | - const repo = context.repo.repo; - const owner = context.repo.owner; - const branchName = context.ref.split('/').pop(); // Use the branch name you want to reference - const pagesUrl = `https://${owner}.github.io/${repo}/gh-pages-${branchName}`; // Use backticks for template literals - core.setOutput('pages_url', pagesUrl); + run: | + echo "GitHub Pages URL: https://${{ github.repository_owner }}.github.io/${{github.event.repository.name }}/gh-pages-dev/" - name: Output GitHub Pages URL run: | diff --git a/.gitignore b/.gitignore index 2e3373a6b..a83be9926 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,7 @@ __pycache__/ screenshots/ .env +*.png venv/ .venv/ allure-results/ diff --git a/init_helpers.py b/init_helpers.py index 403049adb..c9ee0c899 100644 --- a/init_helpers.py +++ b/init_helpers.py @@ -90,10 +90,6 @@ def attach_screenshot(filename): directory = os.path.join(working_dir, 'data', 'attachments') full_path = os.path.join(directory, filename) - logging.debug(f"Saving screenshot to: {full_path}") - logging.debug(f"Working directory is: {working_dir}") - logging.debug(f"directory is: {directory}") - # Ensure the directory exists try: # Check if directory exists, create it if not @@ -110,18 +106,12 @@ def attach_screenshot(filename): # Capture the screenshot logging.debug(f"Saving screenshot to: {full_path}") - logging.debug(f"Working directory is: {working_dir}") screenshot = capture_screenshot(full_path) # Check if screenshot was captured and file exists if screenshot and os.path.exists(full_path): - logging.debug(f"Screenshot saved successfully at: {full_path}") - logging.debug(f"Saving screenshot to: {full_path}") - logging.debug(f"Working directory is: {working_dir}") allure.attach.file(full_path, name=filename, attachment_type=allure.attachment_type.PNG) logging.debug(f"Screenshot attached at: {full_path}") - logging.debug(f"Saving attachment to: {full_path}") - logging.debug(f"Working directory is: {working_dir}") else: logging.error(f"Screenshot capture failed or file not found at: {full_path}") except Exception as e: diff --git a/tests/test_find_a_patient_steps.py b/tests/test_find_a_patient_steps.py index 2a5cc6788..477da1872 100644 --- a/tests/test_find_a_patient_steps.py +++ b/tests/test_find_a_patient_steps.py @@ -1,3 +1,4 @@ +import warnings from pytest_bdd import given, when, then, scenario, scenarios from pytest_bdd.parsers import parse from pages.vaccinator_location_page import * @@ -10,13 +11,21 @@ from faker import Faker import random -fake = Faker('en_GB') +warnings.filterwarnings("ignore", category=UserWarning, module='faker') + + features_directory = get_working_directory() + "features" -logging.basicConfig(level=logging.INFO) +logging.basicConfig(level=logging.CRITICAL) logger = logging.getLogger(__name__) +logging.getLogger('faker').setLevel(logging.CRITICAL) +logging.getLogger('faker.factory').setLevel(logging.CRITICAL) +logging.getLogger('faker.providers').setLevel(logging.CRITICAL) + +fake = Faker('en_GB') + @pytest.fixture(scope='function') def shared_data(): return {}