import json import unittest from argparse import Namespace import allure import pytest from ui_automation_framework.core import TestStatus from ui_automation_framework.utils import AppConfig from app.api_client import ApiClient from app.mysql_db_client_custom import MySqlClient from app.src.pages.amazon_playlist_page import AmazonPlaylistPage from app.src.pages.login_page import LoginPage from app.src.pages.position_playlist_popup import PositionPlaylistPopup from app.src.pages.top_charts_page import TopChartsPage from app.src.pages.track_page import TrackPage from app.src.pages.tt_dashboard_pot_popup import TTDashboardPOTPopup @pytest.mark.usefixtures("set_up", "one_time_set_up") class DeepLinkingTrackPageTest(unittest.TestCase): playlist35 = json.loads(json.dumps(AppConfig.get("playlist35")), object_hook=lambda d: Namespace(**d)) @pytest.fixture(autouse=True) def classSetup(self): self.loginPage = LoginPage(self.driver) self.tp = TrackPage(self.driver) self.pip = PositionPlaylistPopup(self.driver) self.topChartsPage = TopChartsPage(self.driver) self.tt_dashboard_potp = TTDashboardPOTPopup(self.driver) self.amazon_playlist = AmazonPlaylistPage(self.driver) self.api_client = ApiClient() self.sql_client = MySqlClient() self.ts = TestStatus(self.driver) @allure.story("AP-8355") @allure.severity(allure.severity_level.NORMAL) @allure.title("[AP-8024][Amazon Playlists] [Track page] Sticky headers verification.") @allure.description("TC verifies a sticky header for the tables in the Details section.") def test_td_amazon_sticky_headers_verification(self): self.loginPage.login_with_worker() self.tp.select_market(AppConfig.get("market")["global"]["name"]) self.tp.open_spotify_track_page(AppConfig.get("track57")["id"]) # step 1 self.tp.td_scroll_down() self.tp.td_cps_verify_columns() # step 2 self.tp.scroll_to_track_details() # step 3 self.tp.td_change_dsp(AppConfig.get("dsp")["all_dsps"]) self.tp.td_scroll_down() # step 4 self.tp.td_cps_verify_columns() # step 5 self.tp.td_verify_latest_date_column_hover() # step 6 self.tp.td_switch_to_past_playlists_tab() self.tp.td_scroll_down() self.tp.td_switch_to_past_playlists_tab() self.tp.td_pp_verify_columns() # step 7 self.tp.scroll_to_track_details() self.tp.td_pp_verify_columns()