import allure import pytest @pytest.mark.usefixtures("app") class TestTopChartsAppleStates: step_8_endpoint = "**/dsp-api/delphi/apple-music/charts/tracks**" @pytest.mark.parametrize("endpoint", ["**/gate-api/charts/date-range/**", "**/dsp-api/delphi/apple-music/charts**"] ) @allure.title("[AP-10300][AM Top Charts] States verification.STEPS 4, 7 - {endpoint}") @allure.description("TC Verifies: States on the → AM Top Charts tab. STEPS 4, 7") @allure.testcase("https://data-analytics.atlassian.net/browse/AP-10532") @pytest.mark.regression def test_top_charts_apple_states_verification_steps_4_7(self, endpoint): self.login_page.login() self.app.go_to(self.top_charts_apple_tab.url) self.top_charts_page.apple_tab.is_selected() # step 4 self.top_charts_apple_tab.period_dd.exists() self.top_charts_apple_tab.filter_input.exists() self.top_charts_apple_tab.market_dd.exists() self.top_charts_apple_tab.info_icon.exists() self.top_charts_apple_tab.column_position_values.exists_multiple() # step 7 self.top_charts_apple_tab.page.reload() self.app.page.route(endpoint, lambda route: route.abort()) self.apollo_header.data_failed_to_load.exists() self.top_charts_apple_tab.filter_input.not_exists() self.top_charts_apple_tab.export_button.not_exists() # self.app.page.route(endpoint, lambda route: route.continue_()) @allure.title("[AP-10300][AM Top Charts] States verification.STEPS 8") @allure.description("TC Verifies: States on the → AM Top Charts tab. STEPS 8") @allure.testcase("https://data-analytics.atlassian.net/browse/AP-10532") @pytest.mark.regression def test_top_charts_apple_states_verification_step_8(self): self.login_page.login() self.app.go_to(self.top_charts_apple_tab.url) self.top_charts_page.apple_tab.is_selected() # step 8 self.app.page.route(self.step_8_endpoint, lambda route: route.abort()) self.apollo_header.data_failed_to_load.exists() self.top_charts_apple_tab.export_button.exists() self.top_charts_apple_tab.filter_input.exists() # self.app.page.route(self.step_8_endpoint, lambda route: route.continue_()) @allure.title("[AP-10300][AM Top Charts] States verification.STEPS 9") @allure.description("TC Verifies: States on the → AM Top Charts tab. STEPS 9") @allure.testcase("https://data-analytics.atlassian.net/browse/AP-10532") @pytest.mark.regression def test_top_charts_apple_states_verification_step_9(self): self.login_page.login() self.app.go_to(self.top_charts_apple_tab.url) self.top_charts_page.apple_tab.is_selected() # step 9 self.top_charts_apple_tab.select_market("Global") self.top_charts_apple_tab.select_date("01/01/17") self.apollo_header.no_results_to_show.exists() @allure.title("[AP-10300][AM Top Charts] States verification.STEPS 10") @allure.description("TC Verifies: States on the → AM Top Charts tab. STEPS 10") @allure.testcase("https://data-analytics.atlassian.net/browse/AP-10532") @pytest.mark.regression def test_top_charts_apple_states_verification_step_10(self): self.login_page.login() self.app.go_to(self.top_charts_apple_tab.url) self.top_charts_page.apple_tab.is_selected() # step 10 self.top_charts_apple_tab.filter_input.input_text("111111111111111") self.apollo_header.no_results_to_show.exists() # not automated - steps 1-3, 5-6