import pytest import allure @pytest.mark.usefixtures("app") class TestSparklinePanel: @allure.title("[Search Params Tracks] - Sparkline - TikTok - Panel behaviour") @allure.description("As user I want to search tracks by Sparkline TikTok parameters") @allure.testcase("https://data-analytics.atlassian.net/browse/DNAD-392") @pytest.mark.regression def test_sparkline_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_sparkline_block() self.discovery_page.sparkline_tiktok.select_option('Views') self.discovery_page.collapse_sparkline_block() self.discovery_page.sparkline_block_title.has_icon('tiktok') expected_text = 'TikTokViews' self.discovery_page.sparkline_block_title.contain_text(expected_text) self.discovery_page.dsp_tiktok_on(False) # DSP - TIKTOK - OFF self.discovery_page.sparkline_block_title.has_no_icon('tiktok') self.discovery_page.sparkline_block_title.not_contain_text(expected_text) self.discovery_page.dsp_tiktok_on(True) # DSP - TIKTOK - ON self.discovery_page.sparkline_block_title.has_icon('tiktok') self.discovery_page.sparkline_block_title.contain_text(expected_text) self.discovery_page.expand_sparkline_block() self.discovery_page.sparkline_tiktok.select_option('Likes') self.discovery_page.collapse_sparkline_block() self.discovery_page.sparkline_block_title.has_no_icon('tiktok') self.discovery_page.sparkline_block_title.not_contain_text(expected_text) @allure.title("[Search Params Tracks] - Sparkline - YouTube - Panel behaviour") @allure.description("As user I want to search tracks by Sparkline YouTube parameters") @allure.testcase("https://data-analytics.atlassian.net/browse/DNAD-764") @pytest.mark.regression def test_sparkline_panel_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) # DSP - YOUTUBE - ON # Panel behaviour self.discovery_page.expand_sparkline_block() self.discovery_page.sparkline_youtube.select_option('Views') self.discovery_page.collapse_sparkline_block() self.discovery_page.sparkline_block_title.has_icon('youtube') expected_text = 'YouTubeViews' self.discovery_page.sparkline_block_title.contain_text(expected_text) self.discovery_page.dsp_youtube_on(False) # DSP - YOUTUBE - OFF self.discovery_page.sparkline_block_title.has_no_icon('youtube') self.discovery_page.sparkline_block_title.not_contain_text(expected_text) self.discovery_page.dsp_youtube_on(True) # DSP - YOUTUBE - ON self.discovery_page.sparkline_block_title.has_icon('youtube') self.discovery_page.sparkline_block_title.contain_text(expected_text) self.discovery_page.expand_sparkline_block() self.discovery_page.sparkline_youtube.select_option('Likes') self.discovery_page.collapse_sparkline_block() self.discovery_page.sparkline_block_title.has_no_icon('youtube') self.discovery_page.sparkline_block_title.not_contain_text(expected_text) @allure.title("[Search Params Tracks] - Sparkline - Spotify - Panel behaviour") @allure.description("As user I want to search tracks by Sparkline Spotify parameters") @allure.testcase("https://data-analytics.atlassian.net/browse/DNAD-768") @pytest.mark.regression def test_sparkline_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_sparkline_block() self.discovery_page.sparkline_spotify.select_option('Artist Listeners/Mth') self.discovery_page.collapse_sparkline_block() self.discovery_page.sparkline_block_title.has_icon('spotify') expected_text = 'SpotifyArtist Listeners/Mth' self.discovery_page.sparkline_block_title.contain_text(expected_text) self.discovery_page.dsp_spotify_on(False) # DSP - SPOTIFY - OFF self.discovery_page.sparkline_block_title.has_no_icon('spotify') self.discovery_page.sparkline_block_title.not_contain_text(expected_text) self.discovery_page.dsp_spotify_on(True) # DSP - SPOTIFY - ON self.discovery_page.sparkline_block_title.has_icon('spotify') self.discovery_page.sparkline_block_title.contain_text(expected_text) self.discovery_page.expand_sparkline_block() self.discovery_page.sparkline_spotify.select_option('Streams') self.discovery_page.collapse_sparkline_block() self.discovery_page.sparkline_block_title.has_no_icon('spotify') self.discovery_page.sparkline_block_title.not_contain_text(expected_text) @allure.title("[Search Params Tracks] - Sparkline - SoundCloud - Panel behaviour") @allure.description("As user I want to search tracks by Sparkline SoundCloud parameters") @allure.testcase("https://data-analytics.atlassian.net/browse/DNAD-765") @pytest.mark.regression def test_sparkline_panel_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) # DSP - SOUNDCLOUD - ON # Panel behaviour self.discovery_page.expand_sparkline_block() self.discovery_page.sparkline_soundcloud.select_option('Likes') self.discovery_page.collapse_sparkline_block() self.discovery_page.sparkline_block_title.has_icon('sndcld') expected_text = 'SoundCloudLikes' self.discovery_page.sparkline_block_title.contain_text(expected_text) self.discovery_page.dsp_soundcloud_on(False) # DSP - SOUNDCLOUD - OFF self.discovery_page.sparkline_block_title.has_no_icon('sndcld') self.discovery_page.sparkline_block_title.not_contain_text(expected_text) self.discovery_page.dsp_soundcloud_on(True) # DSP - SOUNDCLOUD - ON self.discovery_page.sparkline_block_title.has_icon('sndcld') self.discovery_page.sparkline_block_title.contain_text(expected_text) self.discovery_page.expand_sparkline_block() self.discovery_page.sparkline_soundcloud.select_option('Plays') self.discovery_page.collapse_sparkline_block() self.discovery_page.sparkline_block_title.has_no_icon('sndcld') self.discovery_page.sparkline_block_title.not_contain_text(expected_text)