import random import unittest import allure import pytest from ui_automation_framework.core import TestStatus from ui_automation_framework.utils import AppConfig 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): us = AppConfig.get("market")["us"] @pytest.fixture(autouse=True) def classSetup(self): self.loginPage = LoginPage(self.driver) self.topChartsPage = TopChartsPage(self.driver) self.trackPage = TrackPage(self.driver) self.ts = TestStatus(self.driver) @allure.story("AP-6202") @allure.severity(allure.severity_level.NORMAL) @allure.title("[AP-5842] [Charts] Trending Details pop-up. Export") @allure.description("""TC verifies that users can export the data from Trending Details pop-up on Charts page into a .csv file.""") def test_top_trending_tab_popup_export_verification(self): self.loginPage.login_with_worker() self.topChartsPage.open_top_chart_page() self.topChartsPage.switch_tab(self.topChartsPage.YOUTUBE_TYPE) self.topChartsPage.select_trending_market(AppConfig.get("market")["us"]["name"]) popup_index = random.choice([1, 2, 3, 4, 5]) self.topChartsPage.open_trending_popup(popup_index) # step 2-3 self.topChartsPage.verify_export_button("trending_popup") # step 4-8 self.topChartsPage.trending_tab_popup_verify_export(AppConfig.get("market")["us"]["name"], popup_index) # step 10 self.trackPage.select_month_period("August 2018") self.topChartsPage.verify_export_button_inactive() # NOT AUTOMATED STEPS - 1, 9, 11