import pytest import allure @allure.description("As user I want to search Track and see discovery summary") @allure.testcase("https://data-analytics.atlassian.net/browse/DNAD-383") @pytest.mark.usefixtures("app") class TestDiscoverySummaryTrack: @allure.title("[Discovery Summary Track]–All DSP with default values") @pytest.mark.smoke def test_discovery_summary_all_dsp(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) self.discovery_page.dsp_youtube_on(True) self.discovery_page.dsp_spotify_on(True) self.discovery_page.dsp_soundcloud_on(True) self.discovery_page.bn_discovery.click() self.discovery_results_page.bn_see_discovery_summary.click() test_data = [ {'panel': 'Audience', 'dsp': 'tiktok', 'position': 1, 'expected': 'Views0–50M+'}, {'panel': 'Audience', 'dsp': 'spotify', 'position': 1, 'expected': 'Listeners/Mth0–10M+'}, {'panel': 'Audience', 'dsp': 'soundcloud', 'position': 1, 'expected': 'Followers0–10M+'}, {'panel': 'Releases', 'dsp': 'tiktok', 'position': 1, 'expected': 'Min. Creations0'}, {'panel': 'Releases', 'dsp': 'youtube', 'position': 1, 'expected': 'Min. Videos0'}, {'panel': 'Performance', 'dsp': 'tiktok', 'position': 1, 'expected': 'Likes0–10M+'}, {'panel': 'Performance', 'dsp': 'youtube', 'position': 1, 'expected': 'Views0–10M+'}, {'panel': 'Performance', 'dsp': 'spotify', 'position': 1, 'expected': 'Streams0–100M+'}, {'panel': 'Performance', 'dsp': 'spotify', 'position': 2, 'expected': 'Playlists0–1k+'}, {'panel': 'Performance', 'dsp': 'soundcloud', 'position': 1, 'expected': 'Plays0–100M+'}, {'panel': 'Engagement', 'dsp': 'tiktok', 'position': 1, 'expected': 'Comments0–10k+'}, {'panel': 'Engagement', 'dsp': 'tiktok', 'position': 2, 'expected': 'Mentions0–100+'}, {'panel': 'Engagement', 'dsp': 'youtube', 'position': 1, 'expected': 'Likes0–10M+'}, {'panel': 'Engagement', 'dsp': 'youtube', 'position': 2, 'expected': 'Comments0–10k+'}, {'panel': 'Engagement', 'dsp': 'spotify', 'position': 1, 'expected': 'Popularity0–100'}, {'panel': 'Engagement', 'dsp': 'soundcloud', 'position': 1, 'expected': 'Likes0–100k+'}, {'panel': 'Engagement', 'dsp': 'soundcloud', 'position': 2, 'expected': 'Comments0–100k+'}, {'panel': 'Freshest Release', 'dsp': 'youtube', 'position': 1, 'expected': 'Latest Release12+ Weeks'}, {'panel': 'Freshest Release', 'dsp': 'soundcloud', 'position': 1, 'expected': 'Latest Release12+ Weeks'}, {'panel': 'Sparkline', 'dsp': 'tiktok', 'position': 1, 'expected': 'TikTokLikes'}, {'panel': 'Sparkline', 'dsp': 'youtube', 'position': 1, 'expected': 'YouTubeLikes'}, {'panel': 'Sparkline', 'dsp': 'spotify', 'position': 1, 'expected': 'SpotifyStreams'}, {'panel': 'Sparkline', 'dsp': 'soundcloud', 'position': 1, 'expected': 'SoundCloudPlays'}, ] for item in test_data: print("Testing: {}".format(item)) self.discovery_results_page.discovery_summary_item.get_by( item['panel'], item['dsp'], item['position']).contain_text(item['expected']) @allure.title("[Discovery Summary Track]–TikTok") @pytest.mark.regression def test_discovery_summary_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) self.discovery_page.bn_discovery.click() self.discovery_results_page.bn_see_discovery_summary.click() test_data = [ {'panel': 'Audience', 'dsp': 'tiktok', 'position': 1, 'expected': 'Views0–50M+'}, {'panel': 'Releases', 'dsp': 'tiktok', 'position': 1, 'expected': 'Min. Creations0'}, {'panel': 'Performance', 'dsp': 'tiktok', 'position': 1, 'expected': 'Likes0–10M+'}, {'panel': 'Engagement', 'dsp': 'tiktok', 'position': 1, 'expected': 'Comments0–10k+'}, {'panel': 'Engagement', 'dsp': 'tiktok', 'position': 2, 'expected': 'Mentions0–100+'}, {'panel': 'Sparkline', 'dsp': 'tiktok', 'position': 1, 'expected': 'TikTokLikes'}, ] for item in test_data: print("Testing: {}".format(item)) self.discovery_results_page.discovery_summary_item.get_by( item['panel'], item['dsp'], item['position']).contain_text(item['expected']) self.discovery_results_page.bn_edit_discovery.click() # Update TikTok params self.discovery_page.audience_tiktok_views_min.slide(direction='Right', times=1) self.discovery_page.audience_tiktok_views_max.slide(direction='Left', times=1) self.discovery_page.releases_tiktok_min_creations.slide(direction='Right', times=1) self.discovery_page.performance_tiktok_likes_min.slide(direction='Right', times=1) self.discovery_page.performance_tiktok_likes_max.slide(direction='Left', times=1) self.discovery_page.engagement_tiktok_comments_min.slide(direction='Right', times=1) self.discovery_page.engagement_tiktok_comments_max.slide(direction='Left', times=1) self.discovery_page.engagement_tiktok_mentions_min.slide(direction='Right', times=1) self.discovery_page.engagement_tiktok_mentions_max.slide(direction='Left', times=1) self.discovery_page.expand_sparkline_block().sparkline_tiktok.select_option('Views') self.discovery_page.bn_discovery.click() self.discovery_results_page.bn_see_discovery_summary.click() test_data = [ {'panel': 'Audience', 'dsp': 'tiktok', 'position': 1, 'expected': 'Views1k–10M'}, {'panel': 'Releases', 'dsp': 'tiktok', 'position': 1, 'expected': 'Min. Creations10'}, {'panel': 'Performance', 'dsp': 'tiktok', 'position': 1, 'expected': 'Likes1k–5M'}, {'panel': 'Engagement', 'dsp': 'tiktok', 'position': 1, 'expected': 'Comments10–1k'}, {'panel': 'Engagement', 'dsp': 'tiktok', 'position': 2, 'expected': 'Mentions5–75'}, {'panel': 'Sparkline', 'dsp': 'tiktok', 'position': 1, 'expected': 'TikTokViews'}, ] for item in test_data: print("Testing: {}".format(item)) self.discovery_results_page.discovery_summary_item.get_by( item['panel'], item['dsp'], item['position']).contain_text(item['expected']) @allure.title("[Discovery Summary Track]–YouTube") @pytest.mark.regression def test_discovery_summary_youtube(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_youtube_on(True) self.discovery_page.bn_discovery.click() self.discovery_results_page.bn_see_discovery_summary.click() test_data = [ {'panel': 'Releases', 'dsp': 'youtube', 'position': 1, 'expected': 'Min. Videos0'}, {'panel': 'Performance', 'dsp': 'youtube', 'position': 1, 'expected': 'Views0–10M+'}, {'panel': 'Engagement', 'dsp': 'youtube', 'position': 1, 'expected': 'Likes0–10M+'}, {'panel': 'Engagement', 'dsp': 'youtube', 'position': 2, 'expected': 'Comments0–10k+'}, {'panel': 'Freshest Release', 'dsp': 'youtube', 'position': 1, 'expected': 'Latest Release12+ Weeks'}, {'panel': 'Sparkline', 'dsp': 'youtube', 'position': 1, 'expected': 'YouTubeLikes'}, ] for item in test_data: print("Testing: {}".format(item)) self.discovery_results_page.discovery_summary_item.get_by( item['panel'], item['dsp'], item['position']).contain_text(item['expected']) self.discovery_results_page.bn_edit_discovery.click() # Update YouTube params self.discovery_page.releases_youtube_min_videos.slide(direction='Right', times=2) self.discovery_page.performance_youtube_views_min.slide(direction='Right', times=1) self.discovery_page.performance_youtube_views_max.slide(direction='Left', times=1) self.discovery_page.engagement_youtube_likes_min.slide(direction='Right', times=1) self.discovery_page.engagement_youtube_likes_max.slide(direction='Left', times=1) self.discovery_page.engagement_youtube_comments_min.slide(direction='Right', times=1) self.discovery_page.engagement_youtube_comments_max.slide(direction='Left', times=1) self.discovery_page.expand_freshest_release_block().freshest_release_youtube.select_option('12 Weeks') self.discovery_page.expand_sparkline_block().sparkline_youtube.select_option('Views') self.discovery_page.bn_discovery.click() self.discovery_results_page.bn_see_discovery_summary.click() test_data = [ {'panel': 'Releases', 'dsp': 'youtube', 'position': 1, 'expected': 'Min. Videos2'}, {'panel': 'Performance', 'dsp': 'youtube', 'position': 1, 'expected': 'Views1k–1M'}, {'panel': 'Engagement', 'dsp': 'youtube', 'position': 1, 'expected': 'Likes1k–1M'}, {'panel': 'Engagement', 'dsp': 'youtube', 'position': 2, 'expected': 'Comments10–5k'}, {'panel': 'Freshest Release', 'dsp': 'youtube', 'position': 1, 'expected': 'Latest Release12 Weeks'}, {'panel': 'Sparkline', 'dsp': 'youtube', 'position': 1, 'expected': 'YouTubeViews'}, ] for item in test_data: print("Testing: {}".format(item)) self.discovery_results_page.discovery_summary_item.get_by( item['panel'], item['dsp'], item['position']).contain_text(item['expected']) @allure.title("[Discovery Summary Track]–Spotify") @pytest.mark.regression def test_discovery_summary_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) self.discovery_page.bn_discovery.click() self.discovery_results_page.bn_see_discovery_summary.click() test_data = [ {'panel': 'Audience', 'dsp': 'spotify', 'position': 1, 'expected': 'Listeners/Mth0–10M+'}, {'panel': 'Performance', 'dsp': 'spotify', 'position': 1, 'expected': 'Streams0–100M+'}, {'panel': 'Performance', 'dsp': 'spotify', 'position': 2, 'expected': 'Playlists0–1k+'}, {'panel': 'Engagement', 'dsp': 'spotify', 'position': 1, 'expected': 'Popularity0–100'}, {'panel': 'Sparkline', 'dsp': 'spotify', 'position': 1, 'expected': 'SpotifyStreams'}, ] for item in test_data: print("Testing: {}".format(item)) self.discovery_results_page.discovery_summary_item.get_by( item['panel'], item['dsp'], item['position']).contain_text(item['expected']) self.discovery_results_page.bn_edit_discovery.click() # Update Spotify params self.discovery_page.audience_spotify_listeners_min.slide(direction='Right', times=1) self.discovery_page.audience_spotify_listeners_max.slide(direction='Left', times=1) self.discovery_page.performance_spotify_streams_min.slide(direction='Right', times=1) self.discovery_page.performance_spotify_streams_max.slide(direction='Left', times=1) self.discovery_page.performance_spotify_playlists_min.slide(direction='Right', times=1) self.discovery_page.performance_spotify_playlists_max.slide(direction='Left', times=1) self.discovery_page.engagement_spotify_popularity_min.slide(direction='Right', times=1) self.discovery_page.engagement_spotify_popularity_max.slide(direction='Left', times=1) self.discovery_page.expand_sparkline_block().sparkline_spotify.select_option('Artist Listeners/Mth') self.discovery_page.bn_discovery.click() self.discovery_results_page.bn_see_discovery_summary.click() test_data = [ {'panel': 'Audience', 'dsp': 'spotify', 'position': 1, 'expected': 'Listeners/Mth1k–5M'}, {'panel': 'Performance', 'dsp': 'spotify', 'position': 1, 'expected': 'Streams1k–50M'}, {'panel': 'Performance', 'dsp': 'spotify', 'position': 2, 'expected': 'Playlists10–500'}, {'panel': 'Engagement', 'dsp': 'spotify', 'position': 1, 'expected': 'Popularity10–90'}, {'panel': 'Sparkline', 'dsp': 'spotify', 'position': 1, 'expected': 'SpotifyArtist Listeners/Mth'}, ] for item in test_data: print("Testing: {}".format(item)) self.discovery_results_page.discovery_summary_item.get_by( item['panel'], item['dsp'], item['position']).contain_text(item['expected']) @allure.title("[Discovery Summary Track]–SoundCloud") @pytest.mark.regression def test_discovery_summary_soundcloud(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) self.discovery_page.bn_discovery.click() self.discovery_results_page.bn_see_discovery_summary.click() test_data = [ {'panel': 'Audience', 'dsp': 'soundcloud', 'position': 1, 'expected': 'Followers0–10M+'}, {'panel': 'Performance', 'dsp': 'soundcloud', 'position': 1, 'expected': 'Plays0–100M+'}, {'panel': 'Engagement', 'dsp': 'soundcloud', 'position': 1, 'expected': 'Likes0–100k+'}, {'panel': 'Engagement', 'dsp': 'soundcloud', 'position': 2, 'expected': 'Comments0–100k+'}, {'panel': 'Freshest Release', 'dsp': 'soundcloud', 'position': 1, 'expected': 'Latest Release12+ Weeks'}, {'panel': 'Sparkline', 'dsp': 'soundcloud', 'position': 1, 'expected': 'SoundCloudPlays'}, ] for item in test_data: print("Testing: {}".format(item)) self.discovery_results_page.discovery_summary_item.get_by( item['panel'], item['dsp'], item['position']).contain_text(item['expected']) self.discovery_results_page.bn_edit_discovery.click() # Update SoundCloud params self.discovery_page.audience_soundcloud_followers_min.slide(direction='Right', times=1) self.discovery_page.audience_soundcloud_followers_max.slide(direction='Left', times=1) self.discovery_page.performance_soundcloud_plays_min.slide(direction='Right', times=1) self.discovery_page.performance_soundcloud_plays_max.slide(direction='Left', times=1) self.discovery_page.engagement_soundcloud_likes_min.slide(direction='Right', times=1) self.discovery_page.engagement_soundcloud_likes_max.slide(direction='Left', times=1) self.discovery_page.engagement_soundcloud_comments_min.slide(direction='Right', times=1) self.discovery_page.engagement_soundcloud_comments_max.slide(direction='Left', times=1) self.discovery_page.expand_freshest_release_block().freshest_release_soundcloud.select_option('12 Weeks') self.discovery_page.expand_sparkline_block().sparkline_soundcloud.select_option('Likes') self.discovery_page.bn_discovery.click() self.discovery_results_page.bn_see_discovery_summary.click() test_data = [ {'panel': 'Audience', 'dsp': 'soundcloud', 'position': 1, 'expected': 'Followers1k–5M'}, {'panel': 'Performance', 'dsp': 'soundcloud', 'position': 1, 'expected': 'Plays1k–50M'}, {'panel': 'Engagement', 'dsp': 'soundcloud', 'position': 1, 'expected': 'Likes10–50k'}, {'panel': 'Engagement', 'dsp': 'soundcloud', 'position': 2, 'expected': 'Comments10–50k'}, {'panel': 'Freshest Release', 'dsp': 'soundcloud', 'position': 1, 'expected': 'Latest Release12 Weeks'}, {'panel': 'Sparkline', 'dsp': 'soundcloud', 'position': 1, 'expected': 'SoundCloudLikes'}, ] for item in test_data: print("Testing: {}".format(item)) self.discovery_results_page.discovery_summary_item.get_by( item['panel'], item['dsp'], item['position']).contain_text(item['expected'])