import unittest import allure import pytest from ui_automation_framework.core import TestStatus from ui_automation_framework.utils import AppConfig from app.src.pages.login_page import LoginPage from app.src.pages.track_page import TrackPage @pytest.mark.usefixtures("set_up", "one_time_set_up") class DeepLinkingTrackPageTest(unittest.TestCase): spotify_track_id = "14wf185UxfNbSy8dwt4r4q" united_states = "United States" type_personalized = "Personalized" owner_market_turkey = "Turkey" search_request1 = "pop" toggle_worldwide = "Worldwide" market = "market" all = "All" @pytest.fixture(autouse=True) def classSetup(self): self.loginPage = LoginPage(self.driver) self.tp = TrackPage(self.driver) self.ts = TestStatus(self.driver) # @allure.story("AP-3523") # @allure.severity(allure.severity_level.NORMAL) # @allure.title( # "[Deep Linking] Parameters in Track Details are removed from URL but default values are not applied " # "on UI upon opening previous tab" # ) # @allure.description( # "Only parameters indicated in URL should be applied on UI, all others should be set to default: " # "Owner Category=All, Owner Market = All, US Streams toggle should be selected." # ) # def test_issue_1(self): # self.loginPage.login(CoreConfig.USER_EMAIL, CoreConfig.USER_PASSWORD) # self.loginPage.is_logged_in() # self.tp.open_spotify_track_page(self.spotify_track_id) # self.tp.select_market(self.united_states) # self.tp.td_change_type(self.type_personalized) # self.tp.td_change_owner_market_to(self.owner_market_turkey) # self.tp.td_search_filter(self.search_request1) # self.tp.track_details_switch_to_streams(self.toggle_worldwide) # # self.tp.td_switch_to_charts_tab() # self.tp.td_switch_to_playlist(self.tp.TD_CURRENT_PLAYLIST_TAB) # current_type = self.tp.td_get_current_type() # current_owner_market = self.tp.td_get_owner_market() # # self.tp.track_details_is_table_view_active() # self.tp.track_details_is_streams_tab_active(self.market) # self.ts.markFinal(current_type == self.all, "is current type: {} equal to: {}".format(current_type, self.all)) # self.ts.markFinal( # current_owner_market == self.all, "is current owner market: {} equal to: {}".format(current_type, self.all) # ) # # @allure.story("AP-5682") # @allure.severity(allure.severity_level.NORMAL) # @allure.title("[Deep-linking][Track Page -> Details] Parameters are not dropped when switching the tab") # @allure.description("[Deep-linking][Track Page -> Details] Parameters are not dropped when switching the tab") # def test_ap_5682_issue_1(self): # self.loginPage.login_with_worker() # self.tp.open_spotify_track_page_with_market_id( # track_id=AppConfig.get("track40")["id"], market_id=AppConfig.get("market")["global"]["url"] # ) # self.tp.td_switch_to_playlist(self.tp.TD_CURRENT_PLAYLIST_TAB) # self.tp.track_details_choose_graph_view() # self.tp.td_switch_to_playlist(self.tp.TD_PREVIOUS_PLAYLIST_TAB) # self.tp.verify_params_not_in_url({self.tp.tr_det_view}) # # @allure.story("AP-5682") # @allure.severity(allure.severity_level.NORMAL) # @allure.title("[Deep-linking][Track Page -> Details] Parameters are not dropped when switching the tab") # @allure.description("[Deep-linking][Track Page -> Details] Parameters are not dropped when switching the tab") # def test_ap_5682_issue_2(self): # self.loginPage.login_with_worker() # self.tp.open_spotify_track_page_with_market_id( # track_id=AppConfig.get("track40")["id"], market_id=AppConfig.get("market")["global"]["url"] # ) # self.tp.td_switch_to_playlist(self.tp.TD_CURRENT_PLAYLIST_TAB) # self.tp.td_change_owner_category_to(AppConfig.get("owner_category")["sony"]) # self.tp.td_switch_to_playlist(self.tp.TD_PREVIOUS_PLAYLIST_TAB) # self.tp.verify_params_not_in_url({self.tp.tr_det_owner_ctg}) # # @allure.story("AP-5682") # @allure.severity(allure.severity_level.NORMAL) # @allure.title("[Deep-linking][Track Page -> Details] Parameters are not dropped when switching the tab") # @allure.description("[Deep-linking][Track Page -> Details] Parameters are not dropped when switching the tab") # def test_ap_5682_issue_3(self): # self.loginPage.login_with_worker() # self.tp.open_spotify_track_page_with_market_id( # track_id=AppConfig.get("track40")["id"], market_id=AppConfig.get("market")["global"]["url"] # ) # self.tp.td_switch_to_playlist(self.tp.TD_CURRENT_PLAYLIST_TAB) # self.tp.td_change_owner_market_to(AppConfig.get("market")["argentina"]["name"]) # self.tp.td_switch_to_playlist(self.tp.TD_PREVIOUS_PLAYLIST_TAB) # self.tp.verify_params_not_in_url({self.tp.tr_det_owner_market}) # # @allure.story("AP-5682") # @allure.severity(allure.severity_level.NORMAL) # @allure.title("[Deep-linking][Track Page -> Details] Parameters are not dropped when switching the tab") # @allure.description("[Deep-linking][Track Page -> Details] Parameters are not dropped when switching the tab") # def test_ap_5682_issue_4(self): # self.loginPage.login_with_worker() # self.tp.open_spotify_track_page_with_market_id( # track_id=AppConfig.get("track40")["id"], market_id=AppConfig.get("market")["global"]["url"] # ) # self.tp.td_switch_to_playlist(self.tp.TD_CURRENT_PLAYLIST_TAB) # self.tp.td_search_filter("top") # self.tp.td_switch_to_charts_tab() # self.tp.verify_params_not_in_url({self.tp.tr_det_filter}) # # @allure.story("AP-5682") # @allure.severity(allure.severity_level.NORMAL) # @allure.title("[Deep-linking][Track Page -> Details] Parameters are not dropped when switching the tab") # @allure.description("[Deep-linking][Track Page -> Details] Parameters are not dropped when switching the tab") # def test_ap_5682_issue_5(self): # self.loginPage.login_with_worker() # self.tp.open_spotify_track_page_with_market_id( # track_id=AppConfig.get("track40")["id"], market_id=AppConfig.get("market")["global"]["url"] # ) # self.tp.td_switch_to_playlist(self.tp.TD_PREVIOUS_PLAYLIST_TAB) # self.tp.td_change_owner_category_to("Sony") # self.tp.td_switch_to_charts_tab() # self.tp.verify_params_not_in_url({self.tp.tr_det_owner_ctg_prev}) # # @allure.story("AP-5682") # @allure.severity(allure.severity_level.NORMAL) # @allure.title("[Deep-linking][Track Page -> Details] Parameters are not dropped when switching the tab") # @allure.description("[Deep-linking][Track Page -> Details] Parameters are not dropped when switching the tab") # def test_ap_5682_issue_6(self): # self.loginPage.login_with_worker() # self.tp.open_spotify_track_page_with_market_id( # track_id=AppConfig.get("track40")["id"], market_id=AppConfig.get("market")["global"]["url"] # ) # self.tp.td_switch_to_playlist(self.tp.TD_PREVIOUS_PLAYLIST_TAB) # self.tp.td_change_owner_market_to("Denmark") # self.tp.td_switch_to_charts_tab() # self.tp.verify_params_not_in_url({self.tp.tr_det_owner_market_prev}) # # @allure.story("AP-5682") # @allure.severity(allure.severity_level.NORMAL) # @allure.title("[Deep-linking][Track Page -> Details] Parameters are not dropped when switching the tab") # @allure.description("[Deep-linking][Track Page -> Details] Parameters are not dropped when switching the tab") # def test_ap_5682_issue_7(self): # self.loginPage.login_with_worker() # self.tp.open_spotify_track_page_with_market_id( # track_id=AppConfig.get("track40")["id"], market_id=AppConfig.get("market")["global"]["url"] # ) # self.tp.td_switch_to_playlist(self.tp.TD_PREVIOUS_PLAYLIST_TAB) # self.tp.td_search_filter("rap") # self.tp.td_switch_to_charts_tab() # self.tp.verify_params_not_in_url({self.tp.tr_det_filter}) # # @allure.story("AP-5682") # @allure.severity(allure.severity_level.NORMAL) # @allure.title("[Deep-linking][Track Page -> Details] Parameters are not dropped when switching the tab") # @allure.description("[Deep-linking][Track Page -> Details] Parameters are not dropped when switching the tab") # def test_ap_5682_issue_8(self): # self.loginPage.login_with_worker() # self.tp.open_spotify_track_page_with_market_id( # track_id=AppConfig.get("track40")["id"], market_id=AppConfig.get("market")["global"]["url"] # ) # self.tp.td_switch_to_charts_tab() # self.tp.td_switch_to_charts_beta_sub_tab() # self.tp.td_switch_to_stations_tab() # self.tp.verify_params_not_in_url({self.tp.tr_det_charts}) # # @allure.story("AP-5682") # @allure.severity(allure.severity_level.NORMAL) # @allure.title("[Deep-linking][Track Page -> Details] Parameters are not dropped when switching the tab") # @allure.description("[Deep-linking][Track Page -> Details] Parameters are not dropped when switching the tab") # def test_ap_5682_issue_9(self): # self.loginPage.login_with_worker() # self.tp.open_spotify_track_page_with_market_id( # track_id=AppConfig.get("track40")["id"], market_id=AppConfig.get("market")["global"]["url"] # ) # self.tp.td_switch_to_stations_tab() # self.tp.td_stations_change_market(AppConfig.get("market")["germany"]["name"]) # self.tp.td_switch_to_charts_tab() # self.tp.verify_params_not_in_url({self.tp.tr_det_st_market}) # # @allure.story("AP-5682") # @allure.severity(allure.severity_level.NORMAL) # @allure.title("[Deep-linking][Track Page -> Details] Parameters are not dropped when switching the tab") # @allure.description("[Deep-linking][Track Page -> Details] Parameters are not dropped when switching the tab") # def test_ap_5682_issue_10(self): # self.loginPage.login_with_worker() # self.tp.open_spotify_track_page_with_market_id( # track_id=AppConfig.get("track40")["id"], market_id=AppConfig.get("market")["global"]["url"] # ) # self.tp.td_switch_to_stations_tab() # self.tp.td_search_filter("pop") # self.tp.td_switch_to_charts_tab() # self.tp.verify_params_not_in_url({self.tp.tr_det_st_filter}) # # @allure.story("AP-5682") # @allure.severity(allure.severity_level.NORMAL) # @allure.title("[Deep-linking][Track Page -> Details] Parameters are not dropped when switching the tab") # @allure.description("[Deep-linking][Track Page -> Details] Parameters are not dropped when switching the tab") # def test_ap_5682_issue_11(self): # self.loginPage.login_with_worker() # self.tp.open_spotify_track_page_with_market_id( # track_id=AppConfig.get("track40")["id"], market_id=AppConfig.get("market")["global"]["url"] # ) # self.tp.td_switch_to_youtube_tab() # self.tp.td_youtube_select_type("Vevo") # self.tp.td_switch_to_charts_tab() # self.tp.verify_params_not_in_url({self.tp.tr_det_video}) # # @allure.story("AP-5682") # @allure.severity(allure.severity_level.NORMAL) # @allure.title("[Deep-linking][Track Page -> Details] Parameters are not dropped when switching the tab") # @allure.description("[Deep-linking][Track Page -> Details] Parameters are not dropped when switching the tab") # def test_ap_5682_issue_12(self): # self.loginPage.login_with_worker() # self.tp.open_spotify_track_page_with_market_id( # track_id=AppConfig.get("track40")["id"], market_id=AppConfig.get("market")["global"]["url"] # ) # self.tp.td_switch_to_youtube_tab() # self.tp.youtube_change_sources(["Browse Features"]) # self.tp.td_switch_to_charts_tab() # self.tp.verify_params_not_in_url({self.tp.tr_det_source}) # # @allure.story("AP-5682") # @allure.severity(allure.severity_level.NORMAL) # @allure.title("[Deep-linking][Track Page -> Details] Parameters are not dropped when switching the tab") # @allure.description("[Deep-linking][Track Page -> Details] Parameters are not dropped when switching the tab") # def test_ap_5682_issue_13(self): # self.loginPage.login_with_worker() # self.tp.open_spotify_track_page_with_market_id( # track_id=AppConfig.get("track40")["id"], market_id=AppConfig.get("market")["global"]["url"] # ) # self.tp.td_switch_to_youtube_tab() # self.tp.market_dd_choose_few_countries(tab="td_youtube", param=AppConfig.get("market")["us"]["name"]) # self.tp.td_switch_to_charts_tab() # self.tp.verify_params_not_in_url({self.tp.tr_det_country}) # # @allure.story("AP-5682") # @allure.severity(allure.severity_level.NORMAL) # @allure.title("[Deep-linking][Track Page -> Details] Parameters are not dropped when switching the tab") # @allure.description("[Deep-linking][Track Page -> Details] Parameters are not dropped when switching the tab") # def test_ap_5682_issue_14(self): # self.loginPage.login_with_worker() # self.tp.open_spotify_track_page_with_market_id( # track_id=AppConfig.get("track40")["id"], market_id=AppConfig.get("market")["global"]["url"] # ) # self.tp.td_switch_to_youtube_tab() # self.tp.td_search_filter("mood") # self.tp.td_switch_to_charts_tab() # self.tp.verify_params_not_in_url({self.tp.tr_det_yt_filter}) @allure.story("AP-6897") @allure.severity(allure.severity_level.NORMAL) @allure.title("[Track Page] Incorrect graph type for 'All Streams' when switch from By Markets to Streams tab") @allure.description("[Track Page] Incorrect graph type for 'All Streams' when switch from By Markets to Streams tab") def test_tp_issue_ap_6897(self): self.loginPage.login_with_worker() self.tp.open_spotify_track_page_with_market_id(track_id=AppConfig.get("track40")["id"], market_id=AppConfig.get("market")["global"]["url"]) self.tp.switch_to_streams_by_markets_tab() self.tp.select_dsp(AppConfig.get("dsp")["total_streams"]) self.tp.switch_to_streams_and_sources_tab() self.tp.verify_graph_view(self.tp.graph_line_graph)