import unittest import allure import pytest from assertpy import assert_that from ui_automation_framework.core import TestStatus from ui_automation_framework.utils import AppConfig, CoreConfig from app.src.pages.login_page import LoginPage from app.src.pages.track_page import TrackPage @pytest.mark.usefixtures("set_up", "one_time_set_up") class DeepLinkingTrackPageTest(unittest.TestCase): spotify_track_id = "7LzouaWGFCy4tkXDOOnEyM" apple_track_id = "1478601842" global_market_name = "Global" us_market_name = "United States" brazil_market_name = "Brazil" austria_market_name = "Austria" argentine_market_name = "Argentina" str_brazil = "br" str_austria = "at" str_gr_view = "str_gr_view" str_gr_country = "str_gr_country" str_gr_source = "str_gr_source" str_gr_dsp = "str_gr_dsp" str_gr_tab = "str_gr_tab" source_playlists = "Playlists" six_month_period = "26 Weeks" one_year_period = "1 Year" dsp_apple = "Apple Music" by_dsp = AppConfig.get("dsp")["by_dsp"] dsp_total_streams = AppConfig.get("dsp")["total_streams"] dsp_spotify = "Spotify" source_all = AppConfig.get("source")["all"] source_search = "Search" othersPlaylist = "othersPlaylist" search = "search" @pytest.fixture(autouse=True) def classSetup(self): self.loginPage = LoginPage(self.driver) self.trackPage = TrackPage(self.driver) self.ts = TestStatus(self.driver) @allure.story("AP-1873") @allure.severity(allure.severity_level.NORMAL) @allure.title("Deep linking: Stream Graph parameters setting up (Streams and sources tab) STEP 1-5 Spotify") @allure.description("TC verifies that a user has an ability to set up stream Graph keys with a valid and invalid market value " "automatically or manually inside a page url") def test_verify_stream_graph_parameter_setting_up_spotify(self): self.loginPage.login_with_worker() self.trackPage.open_spotify_track_page(self.spotify_track_id) self.trackPage.select_market(self.global_market_name) self.trackPage.select_dsp("Spotify") self.trackPage.stream_and_source_choose_country(self.us_market_name) self.trackPage.choose_graph_view_line_graph() first_url_param = int(self.trackPage.parameter_from_url(self.str_gr_view)) self.trackPage.is_graph_period_displayed() self.ts.markFinal(first_url_param == 1, "STEP 1 : " + self.str_gr_view + " is equal to: " + str(1)) self.trackPage.stream_and_source_choose_country(self.brazil_market_name) url_gr_view = int(self.trackPage.parameter_from_url(self.str_gr_view)) url_gr_country = self.trackPage.parameter_from_url(self.str_gr_country) self.trackPage.is_graph_period_displayed() self.ts.markFinal(url_gr_view == 1, "STEP 2 : " + self.str_gr_view + " parameter is equal to: " + str(1)) self.ts.markFinal( url_gr_country == self.str_brazil, "STEP 2 : " + self.str_gr_country + " parameter is equal to: " + self.str_brazil, ) self.trackPage.change_source_value(self.source_playlists) url_gr_view = int(self.trackPage.parameter_from_url(self.str_gr_view)) url_gr_country = self.trackPage.parameter_from_url(self.str_gr_country) url_gr_source = self.trackPage.parameter_from_url(self.str_gr_source) self.trackPage.is_graph_period_displayed() self.ts.markFinal(url_gr_view == 2, "STEP 3 : " + self.str_gr_view + " parameter is equal to: " + str(2)) self.ts.markFinal( url_gr_country == self.str_brazil, "STEP 3 : " + self.str_gr_country + " parameter is equal to: " + self.str_brazil, ) self.ts.markFinal( url_gr_source == self.othersPlaylist, f"STEP 3 : {self.str_gr_source} parameter is equal to: {self.str_gr_source}", ) self.trackPage.choose_graph_view_area_graph_percentage() url_gr_view = int(self.trackPage.parameter_from_url(self.str_gr_view)) url_gr_country = self.trackPage.parameter_from_url(self.str_gr_country) url_gr_source = self.trackPage.parameter_from_url(self.str_gr_source) self.trackPage.is_graph_period_displayed() self.ts.markFinal(url_gr_view == 3, "STEP 4 : " + self.str_gr_view + " parameter is equal to: " + str(3)) self.ts.markFinal( url_gr_country == self.str_brazil, "STEP 4 : " + self.str_gr_country + " parameter is equal to: " + self.str_brazil, ) self.ts.markFinal( url_gr_source == self.othersPlaylist, f"STEP 4 : {self.str_gr_source} parameter is equal to: {self.str_gr_source}", ) self.trackPage.choose_graph_view_area_graph() self.trackPage.change_period_in_date_picker(self.six_month_period) url_gr_view = int(self.trackPage.parameter_from_url(self.str_gr_view)) url_gr_country = self.trackPage.parameter_from_url(self.str_gr_country) url_gr_source = self.trackPage.parameter_from_url(self.str_gr_source) self.trackPage.is_graph_period_displayed() self.ts.markFinal(self.trackPage.are_start_dates_match(), "STEP 5 : Start dates are matching") self.ts.markFinal(self.trackPage.are_end_dates_match(), "STEP 5 : End dates are matching") self.ts.markFinal(url_gr_view == 2, "STEP 5 : " + self.str_gr_view + " parameter is equal to: " + str(2)) self.ts.markFinal( url_gr_country == self.str_brazil, "STEP 5 : " + self.str_gr_country + " parameter is equal to: " + self.str_brazil, ) self.ts.markFinal( url_gr_source == self.othersPlaylist, f"STEP 5 : {self.str_gr_source} parameter is equal to: {self.str_gr_source}", ) @allure.story("AP-1873") @allure.severity(allure.severity_level.NORMAL) @allure.title("Deep linking: Stream Graph parameters setting up (Streams and sources tab) STEP 6-10 Spotify") @allure.description("TC verifies that a user has an ability to set up stream Graph keys with a valid and invalid market value " "automatically or manually inside a page url") def test_verify_stream_graph_parameter_setting_up_spotify_step_6(self): self.loginPage.login_with_worker() self.trackPage.open_spotify_track_page(self.spotify_track_id) self.trackPage.select_market(self.global_market_name) self.trackPage.select_dsp("Spotify") self.trackPage.stream_and_source_choose_country(self.brazil_market_name) self.trackPage.choose_graph_view_area_graph() self.trackPage.change_period_in_date_picker(self.six_month_period) self.trackPage.change_source_value(self.source_playlists) self.trackPage.select_dsp(self.dsp_apple) self.trackPage.is_graph_period_displayed() url_gr_view = int(self.trackPage.parameter_from_url(self.str_gr_view)) url_gr_country = self.trackPage.parameter_from_url(self.str_gr_country) url_gr_dsp = int(self.trackPage.parameter_from_url(self.str_gr_dsp)) current_dsp = self.trackPage.get_current_dsp() current_source = self.trackPage.get_current_source() self.ts.markFinal(self.trackPage.are_start_dates_match(), "STEP 6 : Start dates are matching") self.ts.markFinal(self.trackPage.are_end_dates_match(), "STEP 6 : End dates are matching") self.ts.markFinal(url_gr_view == 2, "STEP 6 : " + self.str_gr_view + " parameter is equal to: " + str(2)) self.ts.markFinal( url_gr_country == self.str_brazil, "STEP 6 : " + self.str_gr_country + " parameter is equal to: " + self.str_brazil, ) self.ts.markFinal(url_gr_dsp == 2, "STEP 6 : " + self.str_gr_source + " parameter is equal to: " + str(2)) self.ts.markFinal(current_dsp == self.dsp_apple, "STEP 6 : " + self.str_gr_dsp + " parameter is equal to: " + self.dsp_apple) self.ts.markFinal( current_source == self.source_all, "STEP 6 : " + self.str_gr_source + " parameter is equal to: " + self.source_all, ) self.trackPage.change_period_in_date_picker(self.one_year_period) start_date_expected = self.trackPage.get_calendar_start_date() end_date_expected = self.trackPage.get_calendar_end_date() self.trackPage.change_source_value(self.source_search) self.trackPage.choose_graph_view_area_graph() self.trackPage.stream_and_source_choose_country(self.austria_market_name) self.trackPage.is_graph_period_displayed() url_gr_view = int(self.trackPage.parameter_from_url(self.str_gr_view)) url_gr_country = self.trackPage.parameter_from_url(self.str_gr_country) url_gr_source = self.trackPage.parameter_from_url(self.str_gr_source) url_gr_dsp = int(self.trackPage.parameter_from_url(self.str_gr_dsp)) current_source = self.trackPage.get_current_source() self.ts.markFinal(self.trackPage.are_start_dates_match(), "STEP 7 : Start dates are matching") self.ts.markFinal(self.trackPage.are_end_dates_match(), "STEP 7 : End dates are matching") self.ts.markFinal(url_gr_view == 2, "STEP 7 : " + self.str_gr_view + " parameter is equal to: " + str(2)) self.ts.markFinal( url_gr_country == self.str_austria, "STEP 7 : " + self.str_gr_country + " parameter is equal to: " + self.str_austria, ) self.ts.markFinal(url_gr_source == self.search, "STEP 7 : " + self.str_gr_source + " parameter is equal to: " + url_gr_source) self.ts.markFinal(url_gr_dsp == 2, "STEP 7 : " + self.str_gr_source + " parameter is equal to: " + str(2)) self.ts.markFinal(current_dsp == self.dsp_apple, "STEP 7 : " + self.str_gr_dsp + " parameter is equal to: " + self.dsp_apple) self.ts.markFinal( current_source == self.source_search, "STEP 7 : " + self.str_gr_source + " parameter is equal to: " + self.source_search, ) self.ts.markFinal( start_date_expected == self.trackPage.get_url_start_date(), "start date in url is correct : " + str(start_date_expected == self.trackPage.get_url_start_date()), ) self.ts.markFinal( end_date_expected == self.trackPage.get_url_end_date(), "end date in url is correct : " + str(end_date_expected == self.trackPage.get_url_end_date()), ) self.trackPage.select_previous_mounth_period() self.trackPage.choose_graph_view_area_graph_percentage() self.trackPage.is_graph_period_displayed() url_gr_view = int(self.trackPage.parameter_from_url(self.str_gr_view)) url_gr_country = self.trackPage.parameter_from_url(self.str_gr_country) url_gr_source = self.trackPage.parameter_from_url(self.str_gr_source) url_gr_dsp = int(self.trackPage.parameter_from_url(self.str_gr_dsp)) current_source = self.trackPage.get_current_source() source_list_inactive = self.trackPage.is_source_list_active() self.ts.markFinal(self.trackPage.are_start_dates_match(), "STEP 8 : Start dates are matching") self.ts.markFinal(self.trackPage.are_end_dates_match(), " : End dates are matching") self.ts.markFinal(url_gr_view == 3, " : " + self.str_gr_view + " parameter is equal to: " + str(3)) self.ts.markFinal( url_gr_country == self.str_austria, " : " + self.str_gr_country + " parameter is equal to: " + self.str_austria, ) self.ts.markFinal(url_gr_source == self.search, " : " + self.str_gr_source + " parameter is equal to: " + url_gr_source) self.ts.markFinal(url_gr_dsp == 2, " : " + self.str_gr_source + " parameter is equal to: " + str(2)) self.ts.markFinal(current_dsp == self.dsp_apple, " : " + self.str_gr_dsp + " parameter is equal to: " + self.dsp_apple) self.ts.markFinal( current_source == self.source_search, " : " + self.str_gr_source + " parameter is equal to: " + self.source_search, ) self.ts.markFinal(source_list_inactive == True, " is source list active: " + str(source_list_inactive)) self.trackPage.select_dsp(self.by_dsp) self.trackPage.is_graph_period_displayed() current_dsp = self.trackPage.get_current_dsp() url_gr_view = int(self.trackPage.parameter_from_url(self.str_gr_view)) url_gr_country = self.trackPage.parameter_from_url(self.str_gr_country) url_gr_dsp = int(self.trackPage.parameter_from_url(self.str_gr_dsp)) source_list_inactive = self.trackPage.is_source_list_active() self.ts.markFinal(self.trackPage.are_start_dates_match(), "STEP 9 : Start dates are matching") self.ts.markFinal(self.trackPage.are_end_dates_match(), " : End dates are matching") self.ts.markFinal(url_gr_view == 1, " : " + self.str_gr_view + " parameter is equal to: " + str(3)) self.ts.markFinal( url_gr_country == self.str_austria, " : " + self.str_gr_country + " parameter is equal to: " + self.str_austria, ) self.ts.markFinal(url_gr_dsp == 5, " : " + self.str_gr_dsp + " parameter is equal to: " + str(4)) self.ts.markFinal(current_dsp == self.by_dsp, " : " + self.str_gr_dsp + " parameter is equal to: " + self.by_dsp) self.ts.markFinal(source_list_inactive == False, " is source list active: " + str(source_list_inactive)) self.trackPage.choose_graph_view_area_graph() self.trackPage.is_graph_period_displayed() current_dsp = self.trackPage.get_current_dsp() url_gr_view = int(self.trackPage.parameter_from_url(self.str_gr_view)) url_gr_country = self.trackPage.parameter_from_url(self.str_gr_country) url_gr_dsp = int(self.trackPage.parameter_from_url(self.str_gr_dsp)) source_list_inactive = self.trackPage.is_source_list_active() self.ts.markFinal(self.trackPage.are_start_dates_match(), "STEP 10 : Start dates are matching") self.ts.markFinal(self.trackPage.are_end_dates_match(), " : End dates are matching") self.ts.markFinal(url_gr_view == 2, " : " + self.str_gr_view + " parameter is equal to: " + str(2)) self.ts.markFinal( url_gr_country == self.str_austria, " : " + self.str_gr_country + " parameter is equal to: " + self.str_austria, ) self.ts.markFinal(url_gr_dsp == 5, " : " + self.str_gr_dsp + " parameter is equal to: " + str(4)) self.ts.markFinal(current_dsp == self.by_dsp, " : " + self.str_gr_dsp + " parameter is equal to: " + self.by_dsp) self.ts.markFinal(source_list_inactive == False, " is source list active: " + str(source_list_inactive)) @allure.story("AP-1873") @allure.severity(allure.severity_level.NORMAL) @allure.title("Deep linking: Stream Graph parameters setting up (Streams and sources tab) STEP 11 Spotify") @allure.description("Change Multiple chart view to Percent.Add 'source' parameter to url according to the test data and refresh " "the page.") def test_verify_stream_graph_parameter_setting_up_spotify_step_11(self): self.loginPage.login_with_worker() self.trackPage.open_spotify_track_page(self.spotify_track_id) self.trackPage.select_market(self.global_market_name) url_before = self.trackPage.get_url() graph_total_before = self.trackPage.get_streams_in_period_total_combined() self.trackPage.choose_graph_view_area_graph() self.trackPage.select_dsp(self.by_dsp) self.trackPage.select_previous_mounth_period() self.trackPage.choose_graph_view_area_graph_percentage() self.trackPage.stream_and_source_choose_country(self.austria_market_name) self.trackPage.is_graph_period_displayed() self.trackPage.open_current_url_with_param("&str_gr_source=1") self.trackPage.is_graph_period_displayed() graph_total_after = self.trackPage.get_streams_in_period_total_combined() current_url = self.trackPage.get_url() assert_that(url_before).is_equal_to(current_url) self.ts.markFinal( graph_total_before == graph_total_after, "Graph totals before and after are equal:" + str(graph_total_before == graph_total_after), ) @allure.story("AP-1873") @allure.severity(allure.severity_level.NORMAL) @allure.title("Deep linking: Stream Graph parameters setting up (Streams and sources tab) STEP 12 Spotify") @allure.description("Change market from 'FR' to 'Argentina' in the top header.Verify page url.") def test_verify_stream_graph_parameter_setting_up_spotify_step_12(self): self.loginPage.login(CoreConfig.USER_EMAIL, CoreConfig.USER_PASSWORD) self.loginPage.is_logged_in() self.trackPage.open_spotify_track_page(self.spotify_track_id) track_page_url = self.trackPage.get_url() self.trackPage.select_market(self.global_market_name) self.trackPage.choose_graph_view_area_graph() self.trackPage.select_dsp(self.by_dsp) self.trackPage.select_previous_mounth_period() self.trackPage.choose_graph_view_area_graph_percentage() self.trackPage.stream_and_source_choose_country(self.austria_market_name) self.trackPage.is_graph_period_displayed() self.trackPage.select_market(self.argentine_market_name) self.trackPage.is_graph_period_displayed() expected_url = track_page_url + "?market=40" current_url = self.trackPage.get_url() self.ts.markFinal(current_url == expected_url, "url is: " + expected_url) @allure.story("AP-1873") @allure.severity(allure.severity_level.NORMAL) @allure.title("Deep linking: Stream Graph parameters setting up (Streams and sources tab) STEP 13 Spotify") @allure.description("Change Multiple chart view to Percent.Add 'source' parameter to url according to the test data and refresh " "the page.") def test_verify_stream_graph_parameter_setting_up_spotify_step_13(self): self.loginPage.login_with_worker() self.trackPage.open_spotify_track_page(self.spotify_track_id) self.trackPage.select_market(self.global_market_name) self.trackPage.select_dsp("Spotify") self.trackPage.choose_graph_view_area_graph() self.trackPage.select_dsp(self.by_dsp) self.trackPage.select_previous_mounth_period() self.trackPage.choose_graph_view_area_graph_percentage() self.trackPage.stream_and_source_choose_country(self.austria_market_name) self.trackPage.is_graph_period_displayed() url_before = self.trackPage.get_url() self.trackPage.refresh() self.trackPage.is_graph_period_displayed() url_after = self.trackPage.get_url() self.ts.markFinal(url_before == url_after, " is url correct: " + str(url_before)) current_dsp = self.trackPage.get_current_dsp() url_gr_view = int(self.trackPage.parameter_from_url(self.str_gr_view)) url_gr_country = self.trackPage.parameter_from_url(self.str_gr_country) url_gr_dsp = int(self.trackPage.parameter_from_url(self.str_gr_dsp)) self.ts.markFinal(self.trackPage.are_start_dates_match(), "STEP 10 : Start dates are matching") self.ts.markFinal(self.trackPage.are_end_dates_match(), " : End dates are matching") self.ts.markFinal(url_gr_view == 3, " : " + self.str_gr_view + " parameter is equal to: " + str(3)) self.ts.markFinal( url_gr_country == self.str_austria, " : " + self.str_gr_country + " parameter is equal to: " + self.str_austria, ) self.ts.markFinal(url_gr_dsp == 5, " : " + self.str_gr_dsp + " parameter is equal to: " + str(4)) self.ts.markFinal(current_dsp == self.by_dsp, " : " + self.str_gr_dsp + " parameter is equal to: " + self.by_dsp) @allure.story("AP-1873") @allure.severity(allure.severity_level.NORMAL) @allure.title("Deep linking: Stream Graph parameters setting up (Streams and sources tab) STEP 14-16 Spotify") @allure.description("Change Multiple chart view to Percent.Add 'source' parameter to url according to the test data and refresh " "the page.") def test_verify_stream_graph_parameter_setting_up_spotify_step_14_16(self): self.loginPage.login(CoreConfig.USER_EMAIL, CoreConfig.USER_PASSWORD) self.loginPage.is_logged_in() self.trackPage.open_spotify_track_page(self.spotify_track_id) self.trackPage.select_market(self.global_market_name) self.trackPage.select_dsp("Spotify") self.trackPage.stream_and_source_choose_country(self.brazil_market_name) self.trackPage.choose_graph_view_area_graph() self.trackPage.change_period_in_date_picker(self.six_month_period) self.trackPage.change_source_value(self.source_playlists) self.trackPage.select_dsp(self.dsp_apple) self.trackPage.is_graph_period_displayed() url_before = self.trackPage.get_url() self.trackPage.choose_graph_view_area_graph_percentage() url_after = self.trackPage.get_url() self.trackPage.is_graph_period_displayed() self.trackPage.go_back() self.trackPage.is_graph_period_displayed() url_gr_view = int(self.trackPage.parameter_from_url(self.str_gr_view)) url_gr_country = self.trackPage.parameter_from_url(self.str_gr_country) url_gr_dsp = int(self.trackPage.parameter_from_url(self.str_gr_dsp)) current_dsp = self.trackPage.get_current_dsp() current_source = self.trackPage.get_current_source() self.ts.markFinal(self.trackPage.are_start_dates_match(), "STEP 14 : Start dates are matching") self.ts.markFinal(self.trackPage.are_end_dates_match(), "STEP : End dates are matching") self.ts.markFinal(url_gr_view == 2, "STEP : " + self.str_gr_view + " parameter is equal to: " + str(2)) self.ts.markFinal( url_gr_country == self.str_brazil, "STEP : " + self.str_gr_country + " parameter is equal to: " + self.str_brazil, ) self.ts.markFinal(url_gr_dsp == 2, "STEP : " + self.str_gr_source + " parameter is equal to: " + str(2)) self.ts.markFinal(current_dsp == self.dsp_apple, "STEP : " + self.str_gr_dsp + " parameter is equal to: " + self.dsp_apple) self.ts.markFinal( current_source == self.source_all, "STEP : " + self.str_gr_source + " parameter is equal to: " + self.source_all, ) self.ts.markFinal(url_before == self.trackPage.get_url(), "url is : " + url_before) self.trackPage.go_forward() self.trackPage.is_graph_period_displayed() self.trackPage.refresh() self.trackPage.is_graph_period_displayed() url_gr_view = int(self.trackPage.parameter_from_url(self.str_gr_view)) url_gr_country = self.trackPage.parameter_from_url(self.str_gr_country) url_gr_dsp = int(self.trackPage.parameter_from_url(self.str_gr_dsp)) current_dsp = self.trackPage.get_current_dsp() current_source = self.trackPage.get_current_source() self.ts.markFinal(self.trackPage.are_start_dates_match(), "STEP 15 : Start dates are matching") self.ts.markFinal(self.trackPage.are_end_dates_match(), "STEP : End dates are matching") self.ts.markFinal(url_gr_view == 3, "STEP : " + self.str_gr_view + " parameter is equal to: " + str(3)) self.ts.markFinal( url_gr_country == self.str_brazil, "STEP : " + self.str_gr_country + " parameter is equal to: " + self.str_brazil, ) self.ts.markFinal(url_gr_dsp == 2, "STEP : " + self.str_gr_source + " parameter is equal to: " + str(2)) self.ts.markFinal(current_dsp == self.dsp_apple, "STEP : " + self.str_gr_dsp + " parameter is equal to: " + self.dsp_apple) self.ts.markFinal( current_source == self.source_all, "STEP : " + self.str_gr_source + " parameter is equal to: " + self.source_all, ) self.ts.markFinal(url_after == self.trackPage.get_url(), "url is : " + url_after) @allure.story("AP-1873") @allure.severity(allure.severity_level.NORMAL) @allure.title("Deep linking: Stream Graph parameters setting up (Streams and sources tab) STEP 1-5 Apple") @allure.description("TC verifies that a user has an ability to set up stream Graph keys with a valid and invalid market value " "automatically or manually inside a page url") def test_verify_stream_graph_parameter_setting_up_apple(self): self.loginPage.login_with_worker() self.trackPage.open_apple_track_page(self.apple_track_id) self.trackPage.select_market(self.global_market_name) self.trackPage.select_dsp("Spotify") self.trackPage.stream_and_source_choose_country(self.us_market_name) self.trackPage.choose_graph_view_line_graph() first_url_param = int(self.trackPage.parameter_from_url(self.str_gr_view)) self.trackPage.is_graph_period_displayed() self.ts.markFinal(first_url_param == 1, "STEP 1 : " + self.str_gr_view + " is equal to: " + str(1)) self.trackPage.stream_and_source_choose_country(self.brazil_market_name) url_gr_view = int(self.trackPage.parameter_from_url(self.str_gr_view)) url_gr_country = self.trackPage.parameter_from_url(self.str_gr_country) self.trackPage.is_graph_period_displayed() self.ts.markFinal(url_gr_view == 1, "STEP 2 : " + self.str_gr_view + " parameter is equal to: " + str(1)) self.ts.markFinal( url_gr_country == self.str_brazil, "STEP 2 : " + self.str_gr_country + " parameter is equal to: " + self.str_brazil, ) self.trackPage.change_source_value(self.source_playlists) url_gr_view = int(self.trackPage.parameter_from_url(self.str_gr_view)) url_gr_country = self.trackPage.parameter_from_url(self.str_gr_country) url_gr_source = self.trackPage.parameter_from_url(self.str_gr_source) self.trackPage.is_graph_period_displayed() self.ts.markFinal(url_gr_view == 2, "STEP 3 : " + self.str_gr_view + " parameter is equal to: " + str(2)) self.ts.markFinal( url_gr_country == self.str_brazil, "STEP 3 : " + self.str_gr_country + " parameter is equal to: " + self.str_brazil, ) self.ts.markFinal( url_gr_source == self.othersPlaylist, f"STEP 3 : {self.str_gr_source} parameter is equal to: {self.str_gr_source}", ) self.trackPage.choose_graph_view_area_graph_percentage() url_gr_view = int(self.trackPage.parameter_from_url(self.str_gr_view)) url_gr_country = self.trackPage.parameter_from_url(self.str_gr_country) url_gr_source = self.trackPage.parameter_from_url(self.str_gr_source) self.trackPage.is_graph_period_displayed() self.ts.markFinal(url_gr_view == 3, "STEP 4 : " + self.str_gr_view + " parameter is equal to: " + str(3)) self.ts.markFinal( url_gr_country == self.str_brazil, "STEP 4 : " + self.str_gr_country + " parameter is equal to: " + self.str_brazil, ) self.ts.markFinal( url_gr_source == self.othersPlaylist, f"STEP 4 : {self.str_gr_source} parameter is equal to: {self.str_gr_source}", ) self.trackPage.choose_graph_view_area_graph() self.trackPage.change_period_in_date_picker(self.six_month_period) url_gr_view = int(self.trackPage.parameter_from_url(self.str_gr_view)) url_gr_country = self.trackPage.parameter_from_url(self.str_gr_country) url_gr_source = self.trackPage.parameter_from_url(self.str_gr_source) self.trackPage.is_graph_period_displayed() self.ts.markFinal(self.trackPage.are_start_dates_match(), "STEP 5 : Start dates are matching") self.ts.markFinal(self.trackPage.are_end_dates_match(), "STEP 5 : End dates are matching") self.ts.markFinal(url_gr_view == 2, "STEP 5 : " + self.str_gr_view + " parameter is equal to: " + str(2)) self.ts.markFinal( url_gr_country == self.str_brazil, "STEP 5 : " + self.str_gr_country + " parameter is equal to: " + self.str_brazil, ) self.ts.markFinal( url_gr_source == self.othersPlaylist, f"STEP 5 : {self.str_gr_source} parameter is equal to: {self.str_gr_source}", ) @allure.story("AP-1873") @allure.severity(allure.severity_level.NORMAL) @allure.title("Deep linking: Stream Graph parameters setting up (Streams and sources tab) STEP 6-10 Apple") @allure.description("TC verifies that a user has an ability to set up stream Graph keys with a valid and invalid market value " "automatically or manually inside a page url") def test_verify_stream_graph_parameter_setting_up_apple_step_6(self): self.loginPage.login_with_worker() self.trackPage.open_apple_track_page(self.apple_track_id) self.trackPage.select_market(self.global_market_name) self.trackPage.select_dsp("Spotify") self.trackPage.stream_and_source_choose_country(self.brazil_market_name) self.trackPage.choose_graph_view_area_graph() self.trackPage.change_period_in_date_picker(self.six_month_period) self.trackPage.change_source_value(self.source_playlists) self.trackPage.select_dsp(self.dsp_apple) self.trackPage.is_graph_period_displayed() url_gr_view = int(self.trackPage.parameter_from_url(self.str_gr_view)) url_gr_country = self.trackPage.parameter_from_url(self.str_gr_country) url_gr_dsp = int(self.trackPage.parameter_from_url(self.str_gr_dsp)) current_dsp = self.trackPage.get_current_dsp() current_source = self.trackPage.get_current_source() self.ts.markFinal(self.trackPage.are_start_dates_match(), "STEP 6 : Start dates are matching") self.ts.markFinal(self.trackPage.are_end_dates_match(), "STEP 6 : End dates are matching") self.ts.markFinal(url_gr_view == 2, "STEP 6 : " + self.str_gr_view + " parameter is equal to: " + str(2)) self.ts.markFinal( url_gr_country == self.str_brazil, "STEP 6 : " + self.str_gr_country + " parameter is equal to: " + self.str_brazil, ) self.ts.markFinal(url_gr_dsp == 2, "STEP 6 : " + self.str_gr_source + " parameter is equal to: " + str(2)) self.ts.markFinal(current_dsp == self.dsp_apple, "STEP 6 : " + self.str_gr_dsp + " parameter is equal to: " + self.dsp_apple) self.ts.markFinal( current_source == self.source_all, "STEP 6 : " + self.str_gr_source + " parameter is equal to: " + self.source_all, ) self.trackPage.change_period_in_date_picker(self.one_year_period) start_date_expected = self.trackPage.get_calendar_start_date() end_date_expected = self.trackPage.get_calendar_end_date() self.trackPage.change_source_value(self.source_search) self.trackPage.choose_graph_view_area_graph() self.trackPage.stream_and_source_choose_country(self.austria_market_name) self.trackPage.is_graph_period_displayed() url_gr_view = int(self.trackPage.parameter_from_url(self.str_gr_view)) url_gr_country = self.trackPage.parameter_from_url(self.str_gr_country) url_gr_source = self.trackPage.parameter_from_url(self.str_gr_source) url_gr_dsp = int(self.trackPage.parameter_from_url(self.str_gr_dsp)) current_source = self.trackPage.get_current_source() self.ts.markFinal(self.trackPage.are_start_dates_match(), "STEP 7 : Start dates are matching") self.ts.markFinal(self.trackPage.are_end_dates_match(), "STEP 7 : End dates are matching") self.ts.markFinal(url_gr_view == 2, "STEP 7 : " + self.str_gr_view + " parameter is equal to: " + str(2)) self.ts.markFinal( url_gr_country == self.str_austria, "STEP 7 : " + self.str_gr_country + " parameter is equal to: " + self.str_austria, ) self.ts.markFinal(url_gr_source == self.search, "STEP 7 : " + self.str_gr_source + " parameter is equal to: " + url_gr_source) self.ts.markFinal(url_gr_dsp == 2, "STEP 7 : " + self.str_gr_source + " parameter is equal to: " + str(2)) self.ts.markFinal(current_dsp == self.dsp_apple, "STEP 7 : " + self.str_gr_dsp + " parameter is equal to: " + self.dsp_apple) self.ts.markFinal( current_source == self.source_search, "STEP 7 : " + self.str_gr_source + " parameter is equal to: " + self.source_search, ) self.ts.markFinal( start_date_expected == self.trackPage.get_url_start_date(), "start date in url is correct : " + str(start_date_expected == self.trackPage.get_url_start_date()), ) self.ts.markFinal( end_date_expected == self.trackPage.get_url_end_date(), "end date in url is correct : " + str(end_date_expected == self.trackPage.get_url_end_date()), ) self.trackPage.select_previous_mounth_period() self.trackPage.choose_graph_view_area_graph_percentage() self.trackPage.is_graph_period_displayed() url_gr_view = int(self.trackPage.parameter_from_url(self.str_gr_view)) url_gr_country = self.trackPage.parameter_from_url(self.str_gr_country) url_gr_source = self.trackPage.parameter_from_url(self.str_gr_source) url_gr_dsp = int(self.trackPage.parameter_from_url(self.str_gr_dsp)) current_source = self.trackPage.get_current_source() source_list_inactive = self.trackPage.is_source_list_active() self.ts.markFinal(self.trackPage.are_start_dates_match(), "STEP 8 : Start dates are matching") self.ts.markFinal(self.trackPage.are_end_dates_match(), " : End dates are matching") self.ts.markFinal(url_gr_view == 3, " : " + self.str_gr_view + " parameter is equal to: " + str(3)) self.ts.markFinal( url_gr_country == self.str_austria, " : " + self.str_gr_country + " parameter is equal to: " + self.str_austria, ) self.ts.markFinal(url_gr_source == self.search, " : " + self.str_gr_source + " parameter is equal to: " + url_gr_source) self.ts.markFinal(url_gr_dsp == 2, " : " + self.str_gr_source + " parameter is equal to: " + str(2)) self.ts.markFinal(current_dsp == self.dsp_apple, " : " + self.str_gr_dsp + " parameter is equal to: " + self.dsp_apple) self.ts.markFinal( current_source == self.source_search, " : " + self.str_gr_source + " parameter is equal to: " + self.source_search, ) self.ts.markFinal(source_list_inactive == True, " is source list active: " + str(source_list_inactive)) self.trackPage.select_dsp(self.by_dsp) self.trackPage.is_graph_period_displayed() current_dsp = self.trackPage.get_current_dsp() url_gr_view = int(self.trackPage.parameter_from_url(self.str_gr_view)) url_gr_country = self.trackPage.parameter_from_url(self.str_gr_country) url_gr_dsp = int(self.trackPage.parameter_from_url(self.str_gr_dsp)) source_list_inactive = self.trackPage.is_source_list_active() self.ts.markFinal(self.trackPage.are_start_dates_match(), "STEP 9 : Start dates are matching") self.ts.markFinal(self.trackPage.are_end_dates_match(), " : End dates are matching") self.ts.markFinal(url_gr_view == 1, " : " + self.str_gr_view + " parameter is equal to: " + str(3)) self.ts.markFinal( url_gr_country == self.str_austria, " : " + self.str_gr_country + " parameter is equal to: " + self.str_austria, ) self.ts.markFinal(url_gr_dsp == 5, " : " + self.str_gr_dsp + " parameter is equal to: " + str(4)) self.ts.markFinal(current_dsp == self.by_dsp, " : " + self.str_gr_dsp + " parameter is equal to: " + self.by_dsp) self.ts.markFinal(source_list_inactive == False, " is source list active: " + str(source_list_inactive)) self.trackPage.choose_graph_view_area_graph() self.trackPage.is_graph_period_displayed() current_dsp = self.trackPage.get_current_dsp() url_gr_view = int(self.trackPage.parameter_from_url(self.str_gr_view)) url_gr_country = self.trackPage.parameter_from_url(self.str_gr_country) url_gr_dsp = int(self.trackPage.parameter_from_url(self.str_gr_dsp)) source_list_inactive = self.trackPage.is_source_list_active() self.ts.markFinal(self.trackPage.are_start_dates_match(), "STEP 10 : Start dates are matching") self.ts.markFinal(self.trackPage.are_end_dates_match(), " : End dates are matching") self.ts.markFinal(url_gr_view == 2, " : " + self.str_gr_view + " parameter is equal to: " + str(2)) self.ts.markFinal( url_gr_country == self.str_austria, " : " + self.str_gr_country + " parameter is equal to: " + self.str_austria, ) self.ts.markFinal(url_gr_dsp == 5, " : " + self.str_gr_dsp + " parameter is equal to: " + str(4)) self.ts.markFinal(current_dsp == self.by_dsp, " : " + self.str_gr_dsp + " parameter is equal to: " + self.by_dsp) self.ts.markFinal(source_list_inactive == False, " is source list active: " + str(source_list_inactive)) @allure.story("AP-1873") @allure.severity(allure.severity_level.NORMAL) @allure.title("Deep linking: Stream Graph parameters setting up (Streams and sources tab) STEP 11 Apple") @allure.description("Change Multiple chart view to Percent.Add 'source' parameter to url according to the test data and refresh " "the page.") def test_verify_stream_graph_parameter_setting_up_apple_step_11(self): self.loginPage.login_with_worker() self.trackPage.open_apple_track_page(self.apple_track_id) self.trackPage.select_market(self.global_market_name) url_before = self.trackPage.get_url() graph_total_before = self.trackPage.get_streams_in_period_total_combined() self.trackPage.choose_graph_view_area_graph() self.trackPage.select_dsp(self.by_dsp) self.trackPage.select_previous_mounth_period() self.trackPage.choose_graph_view_area_graph_percentage() self.trackPage.stream_and_source_choose_country(self.austria_market_name) self.trackPage.is_graph_period_displayed() self.trackPage.open_current_url_with_param("&str_gr_source=1") self.trackPage.is_graph_period_displayed() graph_total_after = self.trackPage.get_streams_in_period_total_combined() current_url = self.trackPage.get_url() assert_that(url_before).is_equal_to(current_url) self.ts.markFinal( graph_total_before == graph_total_after, "Graph totals before and after are equal:" + str(graph_total_before == graph_total_after), ) @allure.story("AP-1873") @allure.severity(allure.severity_level.NORMAL) @allure.title("Deep linking: Stream Graph parameters setting up (Streams and sources tab) STEP 12 Apple") @allure.description("Change market from 'FR' to 'Argentina' in the top header.Verify page url.") def test_verify_stream_graph_parameter_setting_up_apple_step_12(self): self.loginPage.login_with_worker() self.trackPage.open_apple_track_page(self.apple_track_id) track_page_url = self.trackPage.get_url() self.trackPage.select_market(self.global_market_name) self.trackPage.choose_graph_view_area_graph() self.trackPage.select_dsp(self.by_dsp) self.trackPage.select_previous_mounth_period() self.trackPage.choose_graph_view_area_graph_percentage() self.trackPage.stream_and_source_choose_country(self.austria_market_name) self.trackPage.is_graph_period_displayed() self.trackPage.select_market(self.argentine_market_name) self.trackPage.is_graph_period_displayed() expected_url = track_page_url + "?market=40" current_url = self.trackPage.get_url() self.ts.markFinal(current_url == expected_url, "url is: " + expected_url) @allure.story("AP-1873") @allure.severity(allure.severity_level.NORMAL) @allure.title("Deep linking: Stream Graph parameters setting up (Streams and sources tab) STEP 13 Apple") @allure.description("Change Multiple chart view to Percent.Add 'source' parameter to url according to the test data and refresh " "the page.") def test_verify_stream_graph_parameter_setting_up_apple_step_13(self): self.loginPage.login_with_worker() self.trackPage.open_apple_track_page(self.apple_track_id) self.trackPage.select_market(self.global_market_name) self.trackPage.select_dsp("Spotify") self.trackPage.choose_graph_view_area_graph() self.trackPage.select_dsp(self.by_dsp) self.trackPage.select_previous_mounth_period() self.trackPage.choose_graph_view_area_graph_percentage() self.trackPage.stream_and_source_choose_country(self.austria_market_name) self.trackPage.is_graph_period_displayed() url_before = self.trackPage.get_url() self.trackPage.refresh() self.trackPage.is_graph_period_displayed() url_after = self.trackPage.get_url() self.ts.markFinal(url_before == url_after, " is url correct: " + str(url_before)) current_dsp = self.trackPage.get_current_dsp() url_gr_view = int(self.trackPage.parameter_from_url(self.str_gr_view)) url_gr_country = self.trackPage.parameter_from_url(self.str_gr_country) url_gr_dsp = int(self.trackPage.parameter_from_url(self.str_gr_dsp)) self.ts.markFinal(self.trackPage.are_start_dates_match(), "STEP 10 : Start dates are matching") self.ts.markFinal(self.trackPage.are_end_dates_match(), " : End dates are matching") self.ts.markFinal(url_gr_view == 3, " : " + self.str_gr_view + " parameter is equal to: " + str(3)) self.ts.markFinal( url_gr_country == self.str_austria, " : " + self.str_gr_country + " parameter is equal to: " + self.str_austria, ) self.ts.markFinal(url_gr_dsp == 5, " : " + self.str_gr_dsp + " parameter is equal to: " + str(4)) self.ts.markFinal(current_dsp == self.by_dsp, " : " + self.str_gr_dsp + " parameter is equal to: " + self.by_dsp) @allure.story("AP-1873") @allure.severity(allure.severity_level.NORMAL) @allure.title("Deep linking: Stream Graph parameters setting up (Streams and sources tab) STEP 14-16 Apple") @allure.description("Change Multiple chart view to Percent.Add 'source' parameter to url according to the test data and refresh " "the page.") def test_verify_stream_graph_parameter_setting_up_apple_step_14_16(self): self.loginPage.login_with_worker() self.trackPage.open_apple_track_page(self.apple_track_id) self.trackPage.select_market(self.global_market_name) self.trackPage.select_dsp("Spotify") self.trackPage.stream_and_source_choose_country(self.brazil_market_name) self.trackPage.choose_graph_view_area_graph() self.trackPage.change_period_in_date_picker(self.six_month_period) self.trackPage.change_source_value(self.source_playlists) self.trackPage.select_dsp(self.dsp_apple) self.trackPage.is_graph_period_displayed() url_before = self.trackPage.get_url() self.trackPage.choose_graph_view_area_graph_percentage() url_after = self.trackPage.get_url() self.trackPage.is_graph_period_displayed() self.trackPage.go_back() self.trackPage.is_graph_period_displayed() url_gr_view = int(self.trackPage.parameter_from_url(self.str_gr_view)) url_gr_country = self.trackPage.parameter_from_url(self.str_gr_country) url_gr_dsp = int(self.trackPage.parameter_from_url(self.str_gr_dsp)) current_dsp = self.trackPage.get_current_dsp() current_source = self.trackPage.get_current_source() self.ts.markFinal(self.trackPage.are_start_dates_match(), "STEP 14 : Start dates are matching") self.ts.markFinal(self.trackPage.are_end_dates_match(), "STEP : End dates are matching") self.ts.markFinal(url_gr_view == 2, "STEP : " + self.str_gr_view + " parameter is equal to: " + str(2)) self.ts.markFinal( url_gr_country == self.str_brazil, "STEP : " + self.str_gr_country + " parameter is equal to: " + self.str_brazil, ) self.ts.markFinal(url_gr_dsp == 2, "STEP : " + self.str_gr_source + " parameter is equal to: " + str(2)) self.ts.markFinal(current_dsp == self.dsp_apple, "STEP : " + self.str_gr_dsp + " parameter is equal to: " + self.dsp_apple) self.ts.markFinal( current_source == self.source_all, "STEP : " + self.str_gr_source + " parameter is equal to: " + self.source_all, ) self.ts.markFinal(url_before == self.trackPage.get_url(), "url is : " + url_before) self.trackPage.go_forward() self.trackPage.is_graph_period_displayed() self.trackPage.refresh() self.trackPage.is_graph_period_displayed() url_gr_view = int(self.trackPage.parameter_from_url(self.str_gr_view)) url_gr_country = self.trackPage.parameter_from_url(self.str_gr_country) url_gr_dsp = int(self.trackPage.parameter_from_url(self.str_gr_dsp)) current_dsp = self.trackPage.get_current_dsp() current_source = self.trackPage.get_current_source() self.ts.markFinal(self.trackPage.are_start_dates_match(), "STEP 15 : Start dates are matching") self.ts.markFinal(self.trackPage.are_end_dates_match(), "End dates are matching") self.ts.markFinal(url_gr_view == 3, self.str_gr_view + " parameter is equal to: " + str(3)) self.ts.markFinal(url_gr_country == self.str_brazil, self.str_gr_country + " parameter is equal to: " + self.str_brazil) self.ts.markFinal(url_gr_dsp == 2, self.str_gr_source + " parameter is equal to: " + str(2)) self.ts.markFinal(current_dsp == self.dsp_apple, self.str_gr_dsp + " parameter is equal to: " + self.dsp_apple) self.ts.markFinal(current_source == self.source_all, self.str_gr_source + " parameter is equal to: " + self.source_all) self.ts.markFinal(url_after == self.trackPage.get_url(), "url is : " + url_after)