import pytest import allure @pytest.mark.usefixtures("app") class TestEngagementPanel: @allure.title("[Search Params Tracks] - Engagement - TikTok Comments - Panel behaviour") @allure.description("As user I want to search tracks by engagement TikTok parameters") @allure.testcase("https://data-analytics.atlassian.net/browse/DNAD-393") @pytest.mark.regression def test_engagement_panel_tiktok_comments(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_engagement_block() self.discovery_page.engagement_tiktok_comments_min.slide(direction='Right', times=1) self.discovery_page.engagement_tiktok_comments_min.has_value('10') self.discovery_page.collapse_engagement_block() self.discovery_page.engagement_block_title.has_icon('tiktok') expected_text = 'Comments10–10k+' self.discovery_page.engagement_block_title.contain_text(expected_text) self.discovery_page.dsp_tiktok_on(False) # DSP - TIKTOK - OFF self.discovery_page.engagement_block_title.has_no_icon('tiktok') self.discovery_page.engagement_block_title.not_contain_text(expected_text) self.discovery_page.dsp_tiktok_on(True) # DSP - TIKTOK - ON self.discovery_page.engagement_block_title.has_icon('tiktok') self.discovery_page.engagement_block_title.contain_text(expected_text) self.discovery_page.expand_engagement_block() self.discovery_page.engagement_tiktok_comments_min.slide(direction='Left', times=1) self.discovery_page.collapse_engagement_block() self.discovery_page.engagement_block_title.has_no_icon('tiktok') self.discovery_page.engagement_block_title.not_contain_text(expected_text) @allure.title("[Search Params Tracks] - Engagement - TikTok Mentions - Panel behaviour") @allure.description("As user I want to search tracks by engagement TikTok parameters") @allure.testcase("https://data-analytics.atlassian.net/browse/DNAD-373") @pytest.mark.regression def test_engagement_panel_tiktok_mentions(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_engagement_block() self.discovery_page.engagement_tiktok_mentions_min.slide(direction='Right', times=1) self.discovery_page.engagement_tiktok_mentions_min.has_value('5') self.discovery_page.collapse_engagement_block() self.discovery_page.engagement_block_title.has_icon('tiktok') expected_text = 'Mentions5–100+' self.discovery_page.engagement_block_title.contain_text(expected_text) self.discovery_page.dsp_tiktok_on(False) # DSP - TIKTOK - OFF self.discovery_page.engagement_block_title.has_no_icon('tiktok') self.discovery_page.engagement_block_title.not_contain_text(expected_text) self.discovery_page.dsp_tiktok_on(True) # DSP - TIKTOK - ON self.discovery_page.engagement_block_title.has_icon('tiktok') self.discovery_page.engagement_block_title.contain_text(expected_text) self.discovery_page.expand_engagement_block() self.discovery_page.engagement_tiktok_mentions_min.slide(direction='Left', times=1) self.discovery_page.collapse_engagement_block() self.discovery_page.engagement_block_title.has_no_icon('tiktok') self.discovery_page.engagement_block_title.not_contain_text(expected_text) @allure.title("[Search Params Tracks] - Engagement - YouTube Likes - Panel behaviour") @allure.description("As user I want to search tracks by engagement YouTube parameters") @allure.testcase("https://data-analytics.atlassian.net/browse/DNAD-758") @pytest.mark.regression def test_engagement_panel_youtube_likes(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) # DSP - YOUTUBE - ON # Panel behaviour self.discovery_page.expand_engagement_block() self.discovery_page.engagement_youtube_likes_min.slide(direction='Right', times=1) self.discovery_page.engagement_youtube_likes_min.has_value('1k') self.discovery_page.collapse_engagement_block() self.discovery_page.engagement_block_title.has_icon('youtube') expected_text = 'Likes1k–10M+' self.discovery_page.engagement_block_title.contain_text(expected_text) self.discovery_page.dsp_youtube_on(False) # DSP - YOUTUBE - OFF self.discovery_page.engagement_block_title.has_no_icon('tiktok') self.discovery_page.engagement_block_title.not_contain_text(expected_text) self.discovery_page.dsp_youtube_on(True) # DSP - YOUTUBE - ON self.discovery_page.engagement_block_title.has_icon('youtube') self.discovery_page.engagement_block_title.contain_text(expected_text) self.discovery_page.expand_engagement_block() self.discovery_page.engagement_youtube_likes_min.slide(direction='Left', times=1) self.discovery_page.collapse_engagement_block() self.discovery_page.engagement_block_title.has_no_icon('youtube') self.discovery_page.engagement_block_title.not_contain_text(expected_text) @allure.title("[Search Params Tracks] - Engagement - YouTube Comments - Panel behaviour") @allure.description("As user I want to search tracks by engagement YouTube parameters") @allure.testcase("https://data-analytics.atlassian.net/browse/DNAD-757") @pytest.mark.regression def test_engagement_panel_youtube_comments(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) # DSP - YOUTUBE - ON # Panel behaviour self.discovery_page.expand_engagement_block() self.discovery_page.engagement_youtube_comments_min.slide(direction='Right', times=1) self.discovery_page.engagement_youtube_comments_min.has_value('10') self.discovery_page.collapse_engagement_block() self.discovery_page.engagement_block_title.has_icon('youtube') expected_text = 'Comments10–10k+' self.discovery_page.engagement_block_title.contain_text(expected_text) self.discovery_page.dsp_youtube_on(False) # DSP - YOUTUBE - OFF self.discovery_page.engagement_block_title.has_no_icon('tiktok') self.discovery_page.engagement_block_title.not_contain_text(expected_text) self.discovery_page.dsp_youtube_on(True) # DSP - YOUTUBE - ON self.discovery_page.engagement_block_title.has_icon('youtube') self.discovery_page.engagement_block_title.contain_text(expected_text) self.discovery_page.expand_engagement_block() self.discovery_page.engagement_youtube_comments_min.slide(direction='Left', times=1) self.discovery_page.collapse_engagement_block() self.discovery_page.engagement_block_title.has_no_icon('youtube') self.discovery_page.engagement_block_title.not_contain_text(expected_text) @allure.title("[Search Params Tracks] - Engagement - Spotify Popularity - Panel behaviour") @allure.description("As user I want to search tracks by engagement Spotify parameters") @allure.testcase("https://data-analytics.atlassian.net/browse/DNAD-762") @pytest.mark.regression def test_engagement_panel_spotify_popularity(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_engagement_block() self.discovery_page.engagement_spotify_popularity_min.slide(direction='Right', times=1) self.discovery_page.engagement_spotify_popularity_min.has_value('10') self.discovery_page.collapse_engagement_block() self.discovery_page.engagement_block_title.has_icon('spotify') expected_text = 'Popularity10–100' self.discovery_page.engagement_block_title.contain_text(expected_text) self.discovery_page.dsp_spotify_on(False) # DSP - SPOTIFY - OFF self.discovery_page.engagement_block_title.has_no_icon('tiktok') self.discovery_page.engagement_block_title.not_contain_text(expected_text) self.discovery_page.dsp_spotify_on(True) # DSP - SPOTIFY - ON self.discovery_page.engagement_block_title.has_icon('spotify') self.discovery_page.engagement_block_title.contain_text(expected_text) self.discovery_page.expand_engagement_block() self.discovery_page.engagement_spotify_popularity_min.slide(direction='Left', times=1) self.discovery_page.collapse_engagement_block() self.discovery_page.engagement_block_title.has_no_icon('spotify') self.discovery_page.engagement_block_title.not_contain_text(expected_text) @allure.title("[Search Params Tracks] - Engagement - SoundCloud Likes - Panel behaviour") @allure.description("As user I want to search tracks by engagement SoundCloud parameters") @allure.testcase("https://data-analytics.atlassian.net/browse/DNAD-761") @pytest.mark.regression def test_engagement_panel_soundcloud_likes(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_engagement_block() self.discovery_page.engagement_soundcloud_likes_min.slide(direction='Right', times=2) self.discovery_page.engagement_soundcloud_likes_min.has_value('50') self.discovery_page.collapse_engagement_block() self.discovery_page.engagement_block_title.has_icon('sndcld') expected_text = 'Likes50–100k+' self.discovery_page.engagement_block_title.contain_text(expected_text) self.discovery_page.dsp_soundcloud_on(False) # DSP - SOUNDCLOUD - OFF self.discovery_page.engagement_block_title.has_no_icon('sndcld') self.discovery_page.engagement_block_title.not_contain_text(expected_text) self.discovery_page.dsp_soundcloud_on(True) # DSP - SOUNDCLOUD - ON self.discovery_page.engagement_block_title.has_icon('sndcld') self.discovery_page.engagement_block_title.contain_text(expected_text) self.discovery_page.expand_engagement_block() self.discovery_page.engagement_soundcloud_likes_min.slide(direction='Left', times=2) self.discovery_page.collapse_engagement_block() self.discovery_page.engagement_block_title.has_no_icon('sndcld') self.discovery_page.engagement_block_title.not_contain_text(expected_text) @allure.title("[Search Params Tracks] - Engagement - SoundCloud Comments - Panel behaviour") @allure.description("As user I want to search tracks by engagement SoundCloud parameters") @allure.testcase("https://data-analytics.atlassian.net/browse/DNAD-760") @pytest.mark.regression def test_engagement_panel_soundcloud_comments(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_engagement_block() self.discovery_page.engagement_soundcloud_comments_min.slide(direction='Right', times=3) self.discovery_page.engagement_soundcloud_comments_min.has_value('100') self.discovery_page.collapse_engagement_block() self.discovery_page.engagement_block_title.has_icon('sndcld') expected_text = 'Comments100–100k+' self.discovery_page.engagement_block_title.contain_text(expected_text) self.discovery_page.dsp_soundcloud_on(False) # DSP - SOUNDCLOUD - OFF self.discovery_page.engagement_block_title.has_no_icon('sndcld') self.discovery_page.engagement_block_title.not_contain_text(expected_text) self.discovery_page.dsp_soundcloud_on(True) # DSP - SOUNDCLOUD - ON self.discovery_page.engagement_block_title.has_icon('sndcld') self.discovery_page.engagement_block_title.contain_text(expected_text) self.discovery_page.expand_engagement_block() self.discovery_page.engagement_soundcloud_comments_min.slide(direction='Left', times=3) self.discovery_page.collapse_engagement_block() self.discovery_page.engagement_block_title.has_no_icon('sndcld') self.discovery_page.engagement_block_title.not_contain_text(expected_text)