import unittest import allure import pytest from ui_automation_framework.core import TestStatus from app.src.pages.chart_digest import ChartDigestPage from app.src.pages.login_page import LoginPage from app.src.pages.top_charts_page import TopChartsPage from app.src.pages.track_page import TrackPage @pytest.mark.usefixtures("set_up", "one_time_set_up") class TopChartsPageTest(unittest.TestCase): @pytest.fixture(autouse=True) def classSetup(self): self.loginPage = LoginPage(self.driver) self.topChartsPage = TopChartsPage(self.driver) self.chart_digest = ChartDigestPage(self.driver) self.tp = TrackPage(self.driver) self.ts = TestStatus(self.driver) @allure.story("AP-9959") @allure.severity(allure.severity_level.NORMAL) @allure.title("[Top Charts] Page is crashed after clicking Back in browser from any tab to Shazam.") @allure.description("[Top Charts] Page is crashed after clicking Back in browser from any tab to Shazam.") def test_top_charts_issue_ap_9959(self): self.loginPage.login_with_worker() # step 1 self.topChartsPage.open_top_chart_page() self.topChartsPage.top_chart_page_is_opened() # step 2 self.topChartsPage.switch_tab(self.topChartsPage.SHAZAM_TYPE) self.topChartsPage.verify_chosen_switch(self.topChartsPage.SHAZAM_TYPE) # step 3 self.topChartsPage.switch_tab(self.topChartsPage.YOUTUBE_TYPE) self.topChartsPage.verify_chosen_switch(self.topChartsPage.YOUTUBE_TYPE) # step 4 self.tp.go_back() self.topChartsPage.verify_chosen_switch(self.topChartsPage.SHAZAM_TYPE) self.topChartsPage.shazam_verify_columns() @allure.story("AP-9958") @allure.severity(allure.severity_level.NORMAL) @allure.title("[Top Charts] Page is crashed if navigate Back to Apple chart from Track page") @allure.description("[Top Charts] Page is crashed if navigate Back to Apple chart from Track page") def test_top_charts_issue_ap_9958(self): self.loginPage.login_with_worker() # step 1 self.topChartsPage.open_top_chart_page() self.topChartsPage.top_chart_page_is_opened() # step 2 self.topChartsPage.switch_tab(self.topChartsPage.APPLE_TYPE) self.topChartsPage.verify_chosen_switch(self.topChartsPage.APPLE_TYPE) # step 3 self.topChartsPage.click_on_track_and_verify() # step 4 self.tp.go_back() self.topChartsPage.verify_chosen_switch(self.topChartsPage.APPLE_TYPE)