import pytest import allure @pytest.mark.usefixtures("app") class TestAudiencePanel: @allure.title("[Search Params Tracks] - Audience - TikTok - Panel behaviour") @allure.description("As user I want to search tracks by audience TikTok parameters") @allure.testcase("https://data-analytics.atlassian.net/browse/DNAD-370") @pytest.mark.regression def test_audience_panel_tiktok(self): self.app.go_to(self.discovery_page.url) self.discovery_page.is_page_loaded() self.discovery_page.switch_scope_to_tracks() self.discovery_page.dsp_tiktok_on(True) # DSP - TIKTOK - ON # Panel behaviour self.discovery_page.expand_audience_block() self.discovery_page.audience_tiktok_views_min.slide(direction='Right', times=1) self.discovery_page.audience_tiktok_views_min.has_value('1k') self.discovery_page.collapse_audience_block() self.discovery_page.audience_block_title.has_icon('tiktok') expected_text = 'Views1k–50M+' self.discovery_page.audience_block_title.contain_text(expected_text) self.discovery_page.dsp_tiktok_on(False) # DSP - TIKTOK - OFF self.discovery_page.audience_block_title.has_no_icon('tiktok') self.discovery_page.audience_block_title.not_contain_text(expected_text) self.discovery_page.dsp_tiktok_on(True) # DSP - TIKTOK - ON self.discovery_page.audience_block_title.has_icon('tiktok') self.discovery_page.audience_block_title.contain_text(expected_text) self.discovery_page.expand_audience_block() self.discovery_page.audience_tiktok_views_min.slide(direction='Left', times=1) self.discovery_page.collapse_audience_block() self.discovery_page.audience_block_title.has_no_icon('tiktok') self.discovery_page.audience_block_title.not_contain_text(expected_text) @allure.title("[Search Params Tracks] - Audience - Spotify - Panel behaviour") @allure.description("As user I want to search tracks by audience Spotify parameters") @allure.testcase("https://data-analytics.atlassian.net/browse/DNAD-749") @pytest.mark.regression def test_audience_panel_spotify(self): self.app.go_to(self.discovery_page.url) self.discovery_page.is_page_loaded() self.discovery_page.switch_scope_to_tracks() self.discovery_page.dsp_spotify_on(True) # DSP - SPOTIFY - ON # Panel behaviour self.discovery_page.expand_audience_block() self.discovery_page.audience_spotify_listeners_min.slide(direction='Right', times=1) self.discovery_page.audience_spotify_listeners_min.has_value('1k') self.discovery_page.collapse_audience_block() self.discovery_page.audience_block_title.has_icon('spotify') expected_text = 'Listeners/Mth1k–10M+' self.discovery_page.audience_block_title.contain_text(expected_text) self.discovery_page.dsp_spotify_on(False) # DSP - SPOTIFY - OFF self.discovery_page.audience_block_title.has_no_icon('spotify') self.discovery_page.audience_block_title.not_contain_text(expected_text) self.discovery_page.dsp_spotify_on(True) # DSP - SPOTIFY - ON self.discovery_page.audience_block_title.has_icon('spotify') self.discovery_page.audience_block_title.contain_text(expected_text) self.discovery_page.expand_audience_block() self.discovery_page.audience_spotify_listeners_min.slide(direction='Left', times=1) self.discovery_page.collapse_audience_block() self.discovery_page.audience_block_title.has_no_icon('spotify') self.discovery_page.audience_block_title.not_contain_text(expected_text) # @allure.title("[Search Params Tracks] - Audience - SoundCloud Genre - Panel behaviour") # @allure.description("As user I want to search tracks by audience SoundCloud parameters") # @allure.testcase("https://data-analytics.atlassian.net/browse/DNAD-748") # @pytest.mark.regression # def test_audience_panel_soundcloud_genre(self): # self.app.go_to(self.discovery_page.url) # self.discovery_page.is_page_loaded() # self.discovery_page.switch_search_to_tracks() # # self.discovery_page.dsp_soundcloud_on(True) # DSP - SOUNDCLOUD - ON # # Panel behaviour # self.discovery_page.expand_audience_block() # self.discovery_page.audience_soundcloud_genre.select_option('Country') # self.discovery_page.collapse_audience_block() # self.discovery_page.audience_block_title.has_icon('sndcld') # expected_text = 'GenreCountry' # self.discovery_page.audience_block_title.contain_text(expected_text) # self.discovery_page.dsp_soundcloud_on(False) # DSP - SOUNDCLOUD - OFF # self.discovery_page.audience_block_title.has_no_icon('sndcld') # self.discovery_page.audience_block_title.not_contain_text(expected_text) # self.discovery_page.dsp_soundcloud_on(True) # DSP - SOUNDCLOUD - ON # self.discovery_page.audience_block_title.has_icon('sndcld') # self.discovery_page.audience_block_title.contain_text(expected_text) # self.discovery_page.expand_audience_block() # self.discovery_page.audience_soundcloud_genre.select_option('Any') # self.discovery_page.collapse_audience_block() # self.discovery_page.audience_block_title.has_no_icon('sndcld') # self.discovery_page.audience_block_title.not_contain_text(expected_text) @allure.title("[Search Params Tracks] - Audience - SoundCloud Followers - Panel behaviour") @allure.description("As user I want to search tracks by audience SoundCloud parameters") @allure.testcase("https://data-analytics.atlassian.net/browse/DNAD-747") @pytest.mark.regression def test_audience_panel_soundcloud_followers(self): self.app.go_to(self.discovery_page.url) self.discovery_page.is_page_loaded() self.discovery_page.switch_scope_to_tracks() self.discovery_page.dsp_soundcloud_on(True) # DSP - SOUNDCLOUD - ON # Panel behaviour self.discovery_page.expand_audience_block() self.discovery_page.audience_soundcloud_followers_min.slide(direction='Right', times=2) self.discovery_page.audience_soundcloud_followers_min.has_value('5k') self.discovery_page.collapse_audience_block() self.discovery_page.audience_block_title.has_icon('sndcld') expected_text = 'Followers5k–10M+' self.discovery_page.audience_block_title.contain_text(expected_text) self.discovery_page.dsp_soundcloud_on(False) # DSP - SOUNDCLOUD - OFF self.discovery_page.audience_block_title.has_no_icon('sndcld') self.discovery_page.audience_block_title.not_contain_text(expected_text) self.discovery_page.dsp_soundcloud_on(True) # DSP - SOUNDCLOUD - ON self.discovery_page.audience_block_title.has_icon('sndcld') self.discovery_page.audience_block_title.contain_text(expected_text) self.discovery_page.expand_audience_block() self.discovery_page.audience_soundcloud_followers_min.slide(direction='Left', times=2) self.discovery_page.collapse_audience_block() self.discovery_page.audience_block_title.has_no_icon('sndcld') self.discovery_page.audience_block_title.not_contain_text(expected_text)