import json import unittest from argparse import Namespace import allure import pytest from ui_automation_framework.core import TestStatus from ui_automation_framework.utils import AppConfig from app.api_client import ApiClient from app.mysql_db_client_custom import MySqlClient from app.src.pages.apple_playlist_page import ApplePlaylistPage from app.src.pages.chart_digest import ChartDigestPage 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 ApplePlaylistPageTest(unittest.TestCase): playlist6 = json.loads(json.dumps(AppConfig.get("playlist6")), object_hook=lambda d: Namespace(**d)) @pytest.fixture(autouse=True) def classSetup(self): self.loginPage = LoginPage(self.driver) self.ap = ApplePlaylistPage(self.driver) self.tp = TrackPage(self.driver) self.chart_digest = ChartDigestPage(self.driver) self.api_client = ApiClient() self.sql_client = MySqlClient() self.ts = TestStatus(self.driver) @allure.story("AP-3849") @allure.severity(allure.severity_level.NORMAL) @allure.title("""Apple Playlist Export option verification""") @allure.description("""TC verifies that the user has the ability to export a list of tracks with the appropriate data to .csv file""") def test_export_option(self): self.loginPage.login_with_worker() self.ap.open_apple_playlist_page_with_market(self.playlist6.apple_id, AppConfig.get("market")["us"]["market"]) # step 1-2 self.ap.verify_export_button_hover() # step 3-7 self.ap.verify_content_of_csv() # step 8-11 self.ap.tl_choose_date("12/06/20") self.ap.verify_content_of_csv(" (1)")