-
Notifications
You must be signed in to change notification settings - Fork 1
JD-111 Verify the presence of extended project information on the index.html page #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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() | ||
| ) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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)) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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}" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| pytest>=7.0.0 | ||
| playwright>=1.40.0 | ||
| pytest-playwright>=0.4.0 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| test_id: JD-111 | ||
| type: web | ||
| framework: playwright | ||
| platform: chromium |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 SUGGESTION: Consider centralizing import path setup The # In testing/conftest.py
import sys
import os
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))Then tests can use |
||
|
|
||
|
|
||
| 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() | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 SUGGESTION: Consider centralizing import path setup
The
sys.path.insertin each test file works but can be fragile when adding more tests. Consider moving this totesting/conftest.py:Then tests can use
from components.pages.index_page import IndexPagewithout per-file path manipulation. Alternatively, run pytest withPYTHONPATH=testingfrom the project root.