import allure import pytest from src.data.amplitude_data import TOP_CHARTS_PAGE @pytest.mark.usefixtures("app") class TestTopChartsEventsAppleSpotifyView: @allure.title("[AP-9687][Amplitude] Events for Spotify and Apple Top Charts tabs view") @allure.description("""TC Verifies: that the event is tracked in Amplitude when user opens Apple or Spotify Top Charts tab""") @allure.testcase("https://data-analytics.atlassian.net/browse/AP-9690") @pytest.mark.regression def test_top_charts_events_apple_spotify_views(self): items_step1 = self.app.get_amplitude_requests() self.login_page.login() # step 1 self.app.go_to(self.top_charts_spotify_tab.url) self.top_charts_spotify_tab.is_loaded() self.app.verify_amplitude_events(payloads=items_step1, event_type=TOP_CHARTS_PAGE["event_type"], count=2) self.app.verify_amplitude_events(items_step1, TOP_CHARTS_PAGE["spotify_event_type"]) # step 2 items_step2 = self.app.get_amplitude_requests() self.top_charts_page.apple_tab.click() self.top_charts_apple_tab.is_loaded() self.app.verify_amplitude_events(items_step2, TOP_CHARTS_PAGE["apple_event_type"]) # step 3 items_step3 = self.app.get_amplitude_requests() self.top_charts_page.spotify_tab.click() self.top_charts_spotify_tab.is_loaded() self.app.verify_amplitude_events(items_step3, TOP_CHARTS_PAGE["spotify_event_type"]) # step 4 self.app.go_to(self.apollo_header.url) items_step4 = self.app.get_amplitude_requests() self.cd_top_10_section.view_chart_button.click() self.top_charts_spotify_tab.is_loaded() self.app.verify_amplitude_events(payloads=items_step4, event_type=TOP_CHARTS_PAGE["event_type"], count=2) self.app.verify_amplitude_events(items_step4, TOP_CHARTS_PAGE["spotify_event_type"]) # step 5 self.app.go_to(self.apollo_header.url) items_step5 = self.app.get_amplitude_requests() self.cd_top_10_section.apple_tab.click() self.cd_top_10_section.view_chart_button.click() self.top_charts_apple_tab.is_loaded() self.app.verify_amplitude_events(payloads=items_step5, event_type=TOP_CHARTS_PAGE["event_type"], count=2) self.app.verify_amplitude_events(items_step5, TOP_CHARTS_PAGE["apple_event_type"]) # step 6 self.app.go_to(self.apollo_header.url) items_step6 = self.app.get_amplitude_requests() self.cd_major_moves.view_chart_button.click() self.top_charts_spotify_tab.is_loaded() self.app.verify_amplitude_events(payloads=items_step6, event_type=TOP_CHARTS_PAGE["event_type"], count=2) self.app.verify_amplitude_events(items_step6, TOP_CHARTS_PAGE["spotify_event_type"]) # step 7 self.app.go_to(self.apollo_header.url) items_step7 = self.app.get_amplitude_requests() self.cd_bubbling_under.view_chart_button.click() self.top_charts_spotify_tab.is_loaded() self.app.verify_amplitude_events(payloads=items_step7, event_type=TOP_CHARTS_PAGE["event_type"], count=2) self.app.verify_amplitude_events(items_step7, TOP_CHARTS_PAGE["spotify_event_type"]) # step 8 self.app.go_to(self.apollo_header.url) items_step8 = self.app.get_amplitude_requests() self.cd_major_moves.apple_tab.click() self.cd_major_moves.view_chart_button.click() self.top_charts_apple_tab.is_loaded() self.app.verify_amplitude_events(payloads=items_step8, event_type=TOP_CHARTS_PAGE["event_type"], count=2) self.app.verify_amplitude_events(items_step8, TOP_CHARTS_PAGE["apple_event_type"]) # step 9 self.app.go_to(self.apollo_header.url) items_step9 = self.app.get_amplitude_requests() self.cd_major_moves.apple_tab.click() self.cd_bubbling_under.view_chart_button.click() self.top_charts_apple_tab.is_loaded() self.app.verify_amplitude_events(payloads=items_step9, event_type=TOP_CHARTS_PAGE["event_type"], count=2) self.app.verify_amplitude_events(items_step9, TOP_CHARTS_PAGE["apple_event_type"])