import allure import pytest from playwright.sync_api import expect @pytest.mark.usefixtures("app") class TestArtistPagePerformanceStates: @allure.title("[AP-10536][Artist Page][Graph> S&S> By DSP] States verification.") @allure.description("""TC Verifies: States on Artist page → Streams and Sources graph → By DSP selection.""") @allure.testcase("https://data-analytics.atlassian.net/browse/AP-10633") def test_artist_page_performance_states_verification(self): self.login_page.login() self.app.go_to(self.artist_header.url.format("5YGY8feqx7naU7z4HrwZM6", "14")) # step 1 self.apollo_header.skeletons.exists_multiple() expect(self.apollo_header.skeletons._element).to_have_count(2) # steps 2-3 self.artist_header.artist_streams_title.exists() self.artist_header.day_picker.exists() self.artist_header.sas_tab.exists() self.artist_header.by_markets_tab.exists() expect(self.artists_sas_tab.info_block._element)\ .to_have_text("Data from The Orchard and AWAL are not included on the graph yet.") self.artists_sas_tab.clock_icon.exists() self.artists_sas_tab.dsp_dd.verify_chosen("By DSP") self.artists_sas_tab.market_dd.verify_chosen("All Markets") self.artists_sas_tab.export_button.exists() self.artists_sas_tab.showing_n_days.exists() self.artists_sas_tab.legend_values.exists_multiple() # step 4 dates_api = self.app.api.get_dsp_dates() self.artists_sas_tab.verify_clock_icon_tooltip(dates_api) # step 6, 8 self.artists_sas_tab.market_dd.select_region("Middle East") self.artist_header.day_picker.select_days_month_year("December 2014") expect(self.apollo_header.skeletons._element).to_have_count(1) self.artists_sas_tab.no_data_available.exists() # step 7 endpoint = "**/artists/streams/?spotify_artist_id=**" self.app.page.route(endpoint, lambda route: route.abort()) self.app.go_to(self.artist_header.url.format("5YGY8feqx7naU7z4HrwZM6", "14")) self.apollo_header.data_failed_to_load.exists() self.app.page.route(endpoint, lambda route: route.continue_()) # step 9 self.app.go_to(self.artist_header.url.format("5YGY8feqx7naU7z4HrwZM6", "14")) self.artists_sas_tab.page.set_viewport_size({"width": 1920, "height": 1080}) self.artists_sas_tab.clock_icon.exists() self.artists_sas_tab.dsp_dd.verify_chosen("By DSP") self.artists_sas_tab.market_dd.verify_chosen("All Markets") self.artists_sas_tab.export_button.exists() self.artists_sas_tab.showing_n_days.exists() self.artists_sas_tab.legend_values.exists_multiple() # not automated steps - 3, 5