Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions tests/consumer/smoke/test_con_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def test_con_002_access_all_data_page(home):
assert ds_page.list_cards(), "Con_002: Dataset cards failed to load"

@pytest.mark.functional
@pytest.mark.smoke
def test_con_003_verify_dataset_download(home):
ds_page = home.go_to_all_data_page()
assert ds_page.is_loaded(), "Con_003: Datasets page failed to load"
Expand All @@ -51,6 +52,7 @@ def test_con_004_access_sectors_page(home):
assert sec_page.has_cards(), "Con_004: Sector cards missing"

@pytest.mark.functional
@pytest.mark.smoke
@pytest.mark.parametrize("sector_index,dataset_index", [(0, 0)])
def test_con_005_sector_download(home, sector_index, dataset_index):
sec_page = home.go_to_sectors()
Expand All @@ -68,6 +70,7 @@ def test_con_006_access_use_case_page(home):
assert uc_page.has_cards(), "Con_006: Use-Case cards missing"

@pytest.mark.functional
@pytest.mark.smoke
@pytest.mark.parametrize("usecase_index,dataset_index", [(0, 0)])
def test_con_007_use_case_download(home, usecase_index, dataset_index):
uc_page = home.go_to_usecases()
Expand All @@ -90,6 +93,7 @@ def test_con_008_access_publishers_page(home):
)

@pytest.mark.functional
@pytest.mark.smoke
@pytest.mark.timeout(30)
def test_publishers_flow(tc_id, view, home, driver):
pub = home.go_to_publishers()
Expand Down
105 changes: 105 additions & 0 deletions tests/provider/smoke/test_prv_002_dashboard_components.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# tests/provider/smoke/test_prv_002_dashboard_components.py

import pytest
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC

from pages.home_page import HomePage
from pages.provider.provider_home_page import ProviderHomePage
from pages.provider.my_dashboard_page import MyDashboardPage
from pages.provider.organizations_page import OrganizationsPage
from locators.provider.provider_homepage_locators import ProviderHomepageLocators
from locators.provider.my_dashboard_locators import MyDashboardLocators
from locators.provider.org_locators import OrgLocators


def _login_as_provider(driver, base_url, test_credentials) -> ProviderHomePage:
driver.delete_all_cookies()
email, password = test_credentials
home = HomePage(driver, base_url)
try:
if not home.is_loaded():
home.load()
except Exception:
pass
return home.go_to_login(flow="provider", email=email, password=password)


@pytest.mark.smoke
def test_prv_002_01_user_dashboard_header_visible(driver, base_url, test_credentials):
"""User Dashboard heading is visible after login."""
prov_home = _login_as_provider(driver, base_url, test_credentials)
assert isinstance(prov_home, ProviderHomePage), (
f"Expected ProviderHomePage after login, got {type(prov_home)}"
)
WebDriverWait(driver, 10).until(
EC.visibility_of_element_located(ProviderHomepageLocators.HEADER)
)


@pytest.mark.smoke
def test_prv_002_02_dashboard_cards_visible(driver, base_url, test_credentials):
"""'My Dashboard' and 'Organizations' cards are both visible on the landing page."""
prov_home = _login_as_provider(driver, base_url, test_credentials)
assert isinstance(prov_home, ProviderHomePage), (
f"Expected ProviderHomePage after login, got {type(prov_home)}"
)
WebDriverWait(driver, 10).until(
EC.visibility_of_element_located(ProviderHomepageLocators.CARD_MY_DASH)
)
WebDriverWait(driver, 10).until(
EC.visibility_of_element_located(ProviderHomepageLocators.CARD_ORGANIZATIONS)
)


@pytest.mark.smoke
def test_prv_002_03_ind_sidebar_nav_visible(driver, base_url, test_credentials):
"""All sidebar nav items are visible on the Individual (My Dashboard) view."""
prov_home = _login_as_provider(driver, base_url, test_credentials)
assert isinstance(prov_home, ProviderHomePage), (
f"Expected ProviderHomePage after login, got {type(prov_home)}"
)
my_dash = prov_home.goto_my_dashboard()
assert isinstance(my_dash, MyDashboardPage), (
f"Expected MyDashboardPage, got {type(my_dash)}"
)

sidebar_items = [
("Datasets", MyDashboardLocators.SIDEBAR_DATASETS),
("UseCases", MyDashboardLocators.USECASES_NAV_LINK),
("Collaboratives", MyDashboardLocators.COLLABORATIVES_NAV_LINK),
("AI Models", MyDashboardLocators.AI_MODELS_NAV_LINK),
("Profile", MyDashboardLocators.PROFILE_NAV_LINK),
]
for label, locator in sidebar_items:
WebDriverWait(driver, 10).until(
EC.visibility_of_element_located(locator),
f"Individual dashboard sidebar item not visible: {label}"
)


@pytest.mark.smoke
def test_prv_002_04_org_sidebar_nav_visible(driver, base_url, test_credentials):
"""All sidebar nav items are visible on the Org dashboard after selecting an org."""
prov_home = _login_as_provider(driver, base_url, test_credentials)
assert isinstance(prov_home, ProviderHomePage), (
f"Expected ProviderHomePage after login, got {type(prov_home)}"
)
org_page = prov_home.goto_organizations()
assert isinstance(org_page, OrganizationsPage), (
f"Expected OrganizationsPage, got {type(org_page)}"
)
org_page.select_org()

sidebar_items = [
("Datasets", OrgLocators.SIDEBAR_DATASETS),
("UseCases", OrgLocators.USECASES_NAV_LINK),
("Collaboratives", OrgLocators.COLLABORATIVES_NAV_LINK),
("AI Models", OrgLocators.AI_MODELS_NAV_LINK),
("Profile", OrgLocators.PROFILE_NAV_LINK),
]
for label, locator in sidebar_items:
WebDriverWait(driver, 10).until(
EC.visibility_of_element_located(locator),
f"Org dashboard sidebar item not visible: {label}"
)
1 change: 1 addition & 0 deletions tests/provider/smoke/test_prv_006_org_create_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from pages.provider.organizations_page import OrganizationsPage

@pytest.mark.functional
@pytest.mark.smoke
def test_prv_006_org_create_dataset(driver, sample_csv_path, base_url, test_credentials, org_add_permission):

"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@


@pytest.mark.functional
@pytest.mark.smoke
def test_prv_006b_org_create_prompt_dataset(driver, sample_csv_path, base_url, test_credentials, org_add_permission):
"""
Test Case ID: test_prv_006b_org_create_prompt_dataset
Expand Down
1 change: 1 addition & 0 deletions tests/provider/smoke/test_prv_007_org_create_usecase.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from pages.provider.organizations_page import OrganizationsPage

@pytest.mark.functional
@pytest.mark.smoke
def test_prv_007_org_create_usecase(driver, sample_logo_path, base_url, test_credentials, org_add_permission):
"""
Test Case ID: test_prv_007_org_create_usecase
Expand Down
1 change: 1 addition & 0 deletions tests/provider/smoke/test_prv_009_org_edit_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@


@pytest.mark.functional
@pytest.mark.smoke
def test_prv_009_org_edit_profile(driver, sample_profile_image_path, base_url, test_credentials):
"""
Test Case ID: test_prv_009_org_edit_profile
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from tests.data.test_data import CollaborativeTestData

@pytest.mark.functional
@pytest.mark.smoke
@pytest.mark.timeout(360)
def test_prv_011_org_create_collaborative(driver, sample_logo_path, sample_cover_image_path, base_url, test_credentials, org_add_permission):
"""
Expand Down
1 change: 1 addition & 0 deletions tests/provider/smoke/test_prv_012_ind_create_ai_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@


@pytest.mark.functional
@pytest.mark.smoke
def test_prv_012_ind_create_ai_model(driver, base_url, test_credentials):
"""
Test Case ID: test_prv_012_ind_create_ai_model
Expand Down
Loading