From f2cb06d8627144d2a3fec7567f7921cad93c7c7e Mon Sep 17 00:00:00 2001 From: AI Teammate Date: Fri, 27 Feb 2026 11:49:47 +0300 Subject: [PATCH] JD-111 test: automate Verify the presence of extended project information on the index.html page --- testing/components/__init__.py | 0 testing/components/pages/__init__.py | 0 testing/components/pages/index_page.py | 51 ++++++++++++++++++++++++++ testing/conftest.py | 7 ++++ testing/core/__init__.py | 0 testing/core/config/__init__.py | 0 testing/core/config/env.py | 11 ++++++ testing/requirements.txt | 3 ++ testing/tests/JD-111/config.yaml | 4 ++ testing/tests/JD-111/test_jd_111.py | 36 ++++++++++++++++++ 10 files changed, 112 insertions(+) create mode 100644 testing/components/__init__.py create mode 100644 testing/components/pages/__init__.py create mode 100644 testing/components/pages/index_page.py create mode 100644 testing/conftest.py create mode 100644 testing/core/__init__.py create mode 100644 testing/core/config/__init__.py create mode 100644 testing/core/config/env.py create mode 100644 testing/requirements.txt create mode 100644 testing/tests/JD-111/config.yaml create mode 100644 testing/tests/JD-111/test_jd_111.py diff --git a/testing/components/__init__.py b/testing/components/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/testing/components/pages/__init__.py b/testing/components/pages/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/testing/components/pages/index_page.py b/testing/components/pages/index_page.py new file mode 100644 index 0000000..fbb91d8 --- /dev/null +++ b/testing/components/pages/index_page.py @@ -0,0 +1,51 @@ +"""Page Object for the Jira Diff landing page (index.html).""" +from playwright.sync_api import Page + + +class IndexPage: + """Page Object for web/index.html.""" + + def __init__(self, page: Page, base_url: str): + self.page = page + self.base_url = base_url + + def navigate(self) -> None: + """Navigate to the index page.""" + self.page.goto(self.base_url) + + def get_title(self) -> str: + """Return the page title.""" + return self.page.title() + + def is_loaded(self) -> bool: + """Check if the main container is visible.""" + return self.page.locator(".container").is_visible() + + def has_hero_section(self) -> bool: + """Check if hero section with h1 is present.""" + return self.page.locator(".hero h1").is_visible() + + def has_browser_extensions_section(self) -> bool: + """Check if Browser Extensions section is present.""" + return self.page.locator("h2:has-text('Browser Extensions')").is_visible() + + def has_key_features_section(self) -> bool: + """Check if Key Features section is present.""" + return self.page.locator("h2:has-text('Key Features')").is_visible() + + def has_workflow_section(self) -> bool: + """Check if AI Automation Workflow section is present.""" + return self.page.locator("h2:has-text('AI Automation Workflow')").is_visible() + + def has_tech_stack_section(self) -> bool: + """Check if Tech Stack section is present.""" + return self.page.locator("h2:has-text('Tech Stack')").is_visible() + + def has_extended_project_info(self) -> bool: + """Verify extended project information sections are displayed.""" + return ( + self.has_browser_extensions_section() + and self.has_key_features_section() + and self.has_workflow_section() + and self.has_tech_stack_section() + ) diff --git a/testing/conftest.py b/testing/conftest.py new file mode 100644 index 0000000..54da793 --- /dev/null +++ b/testing/conftest.py @@ -0,0 +1,7 @@ +"""Pytest configuration and shared fixtures.""" +import sys +from pathlib import Path + +testing_root = Path(__file__).resolve().parent +if str(testing_root) not in sys.path: + sys.path.insert(0, str(testing_root)) diff --git a/testing/core/__init__.py b/testing/core/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/testing/core/config/__init__.py b/testing/core/config/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/testing/core/config/env.py b/testing/core/config/env.py new file mode 100644 index 0000000..fe71962 --- /dev/null +++ b/testing/core/config/env.py @@ -0,0 +1,11 @@ +"""Environment configuration for tests.""" +import os +from pathlib import Path + +REPO_ROOT = Path(__file__).resolve().parents[3] +WEB_INDEX_PATH = REPO_ROOT / "web" / "index.html" + + +def get_index_url() -> str: + """Return file URL for the index.html page.""" + return f"file://{WEB_INDEX_PATH}" diff --git a/testing/requirements.txt b/testing/requirements.txt new file mode 100644 index 0000000..68ec0a5 --- /dev/null +++ b/testing/requirements.txt @@ -0,0 +1,3 @@ +pytest>=7.0.0 +playwright>=1.40.0 +pytest-playwright>=0.4.0 diff --git a/testing/tests/JD-111/config.yaml b/testing/tests/JD-111/config.yaml new file mode 100644 index 0000000..f02a7de --- /dev/null +++ b/testing/tests/JD-111/config.yaml @@ -0,0 +1,4 @@ +test_id: JD-111 +type: web +framework: playwright +platform: chromium diff --git a/testing/tests/JD-111/test_jd_111.py b/testing/tests/JD-111/test_jd_111.py new file mode 100644 index 0000000..93cb4a1 --- /dev/null +++ b/testing/tests/JD-111/test_jd_111.py @@ -0,0 +1,36 @@ +""" +JD-111: Verify the presence of extended project information on the index.html page. + +Steps: +1. Navigate to the index.html page of the project +2. Identify the section containing project information +3. Verify that additional details about the project are displayed as intended + +Expected: The index page should load successfully and contain the extended +information about the project. +""" +import pytest +from playwright.sync_api import sync_playwright + +from core.config.env import get_index_url +from components.pages.index_page import IndexPage + + +def test_jd_111_extended_project_info_on_index_page(): + """Verify index page loads and displays extended project information.""" + with sync_playwright() as p: + browser = p.chromium.launch(headless=True) + page = browser.new_page() + index_url = get_index_url() + index_page = IndexPage(page, index_url) + + index_page.navigate() + + assert index_page.is_loaded(), "Index page should load successfully" + assert index_page.has_hero_section(), "Hero section with project title should be visible" + assert index_page.has_extended_project_info(), ( + "Extended project information should be displayed: " + "Browser Extensions, Key Features, AI Automation Workflow, Tech Stack" + ) + + browser.close()