import unittest import allure import pytest from assertpy import assert_that from parameterized import parameterized from ui_automation_framework.core import TestStatus from app.api_client import ApiClient from app.src.pages.global_track_priorities_page import GlobalTrackPrioritiesPage from app.src.pages.login_page import LoginPage from app.src.pages.track_page import TrackPage from app.src.pages.tt_dashboard_page import TTDashboardPage from app.src.pages.tt_dashboard_pot_popup import TTDashboardPOTPopup @pytest.mark.usefixtures("set_up", "one_time_set_up") class TTDashboardPageTest(unittest.TestCase): @pytest.fixture(autouse=True) def classSetup(self): self.loginPage = LoginPage(self.driver) self.tt_dashboard = TTDashboardPage(self.driver) self.trackPage = TrackPage(self.driver) self.tt_dashboard_potp = TTDashboardPOTPopup(self.driver) self.gtp = GlobalTrackPrioritiesPage(self.driver) self.api_client = ApiClient() self.ts = TestStatus(self.driver) @parameterized.expand( [ ("daily", "by-creations-change", "Daily", "Creations Change"), ("daily", "by-creations", "Daily", "Creations"), ("7days", "by-creations-change", "7 Days", "Creations Change"), ("7days", "by-creations", "7 Days", "Creations"), ] ) @allure.story("AP-7322") @allure.severity(allure.severity_level.NORMAL) @allure.title("[AP-6912] TikTok Dashboard. Popup - Position over Time") @allure.description("TC verifies general states and elements of the popup - Position overtime on the TikTok Dashboard.") def test_tt_dashboard_potp_verification(self, view, tab, view_name, tab_name): self.loginPage.login_with_worker() self.tt_dashboard.open() self.tt_dashboard.select_tab(tab) self.tt_dashboard.select_view(view) self.tt_dashboard.click_on_column(self.tt_dashboard.column_days_on_list) # steps 1, 13 self.tt_dashboard_potp.verify_icon_hover() # step 2 self.tt_dashboard_potp.open() # step 3 self.tt_dashboard_potp.verify_elements() # step 4, 7 self.tt_dashboard_potp.verify_track_name_link_hover() # step 6 list_name_ui = self.tt_dashboard_potp.get_list_name() assert_that(f"{tab_name} Global ({view_name})").is_equal_to(list_name_ui) # step 8 self.tt_dashboard_potp.verify_artist_link() # step 9 self.tt_dashboard_potp.close() # NOT AUTOMATED STEPS - 5, 10-12