import allure import pytest @pytest.mark.usefixtures("app") class TestTopChartsSpotifyTabLoadersAndStates: step_2_endpoint = "**/gate-api/charts/top/**" step_3_endpoint = "**/gate-api/charts/date-range/**" @pytest.mark.parametrize("tab", ["daily", "weekly" ] ) @allure.title("[AP-8103][Top Charts] Spotify. Loaders and states verification STEP 2, 6") @allure.description("TC verifies skeletons and other states on Top Charts → Spotify tab STEP 2, 6") @allure.testcase("https://data-analytics.atlassian.net/browse/AP-9913") @pytest.mark.regression def test_top_charts_spotify_loaders_and_states_step2(self, tab): self.login_page.login() self.app.go_to(self.top_charts_spotify_tab.url) self.top_charts_page.spotify_tab.is_selected() # step 2 self.top_charts_spotify_tab.switch_sub_tab(tab) self.top_charts_spotify_tab.page.reload() self.app.page.route(self.step_2_endpoint, lambda route: route.abort()) self.apollo_header.data_failed_to_load.exists() # self.app.page.route(self.step_2_endpoint, lambda route: route.continue_()) @pytest.mark.parametrize("tab", ["daily", "weekly" ] ) @allure.title("[AP-8103][Top Charts] Spotify. Loaders and states verification STEP 3, 6") @allure.description("TC verifies skeletons and other states on Top Charts → Spotify tab STEP 3, 6") @allure.testcase("https://data-analytics.atlassian.net/browse/AP-9913") @pytest.mark.regression def test_top_charts_spotify_loaders_and_states_step3(self, tab): self.login_page.login() self.app.go_to(self.top_charts_spotify_tab.url) self.top_charts_page.spotify_tab.is_selected() # step 3 self.top_charts_spotify_tab.switch_sub_tab(tab) self.top_charts_spotify_tab.page.reload() self.app.page.route(self.step_3_endpoint, lambda route: route.abort()) self.apollo_header.data_failed_to_load.exists() # self.app.page.route(self.step_3_endpoint, lambda route: route.continue_()) @pytest.mark.parametrize("tab", ["Daily", "Weekly" ] ) @allure.title("[AP-8103][Top Charts] Spotify. Loaders and states verification STEP 4, 6") @allure.description("TC verifies skeletons and other states on Top Charts → Spotify tab STEP 4, 6") @allure.testcase("https://data-analytics.atlassian.net/browse/AP-9913") @pytest.mark.regression def test_top_charts_spotify_loaders_and_states_step4(self, tab): self.login_page.login() self.app.go_to(self.top_charts_spotify_tab.url) self.top_charts_page.spotify_tab.is_selected() # step 4 self.top_charts_spotify_tab.switch_sub_tab(tab) algeria = 'Algeria' self.top_charts_spotify_tab.select_market(algeria) self.top_charts_spotify_tab.spotify_no_results_for_market.get_by(tab).exists() self.top_charts_spotify_tab.spotify_no_results_for_market.get_by(tab) \ .contain_text(f"for {algeria} doesn't exist.") @pytest.mark.parametrize("tab", [ "daily", "weekly" ] ) @allure.title("[AP-8103][Top Charts] Spotify. Loaders and states verification STEP 5, 6") @allure.description("TC verifies skeletons and other states on Top Charts → Spotify tab STEP 5, 6") @allure.testcase("https://data-analytics.atlassian.net/browse/AP-9913") @pytest.mark.regression def test_top_charts_spotify_loaders_and_states_step5(self, tab): self.login_page.login() self.app.go_to(self.top_charts_spotify_tab.url) self.top_charts_page.spotify_tab.is_selected() # step 5 self.top_charts_spotify_tab.switch_sub_tab(tab) self.top_charts_spotify_tab.select_market("Ukraine") self.top_charts_spotify_tab.select_date("11/07/19", tab) self.top_charts_spotify_tab.no_data_available.exists() # # not automated step 1