import allure import pytest from assertpy import assert_that from src.helpers.test_data_loader import DataLoader @pytest.mark.usefixtures("one_time_set_up") class TestAlbums: artist_name = DataLoader.get_artist() @allure.title("View All Albums") @allure.description("User should be able to view All Albums") @allure.testcase("https://data-analytics.atlassian.net/browse/AMA-1898") @pytest.mark.smoke @pytest.mark.artist def test_view_all_albums(self): self.login_page.login_as_super_user() self.welcome_page.click_skip_btn() self.artist_selector_page.select_an_artist_by_name(self.artist_name) self.library_page.view_all_albums() assert_that(self.albums_page.all_albums_page_visible(), "All albums aren't shown").is_true() # Check Album BETA label self.albums_page.view_albums_beta_label() assert_that(self.albums_page.lb_albums_beta.is_visible, "BETA label should be present").is_true() self.navigation_page.click_dismiss() # Go to album screen and back self.albums_page.select_album_by_position(2) self.navigation_page.click_back() self.navigation_page.click_back() assert_that(self.library_page.bn_switch_artist.is_visible, "User are not on Library page").is_true() @allure.title("Newest Releases Albums") @allure.description("User should be able to view Newest Releases Albums") @allure.testcase("https://data-analytics.atlassian.net/browse/AMA-1899") @pytest.mark.smoke def test_newest_releases_albums(self): self.login_page.login_as_super_user() self.welcome_page.click_skip_btn() self.artist_selector_page.select_an_artist_by_name(self.artist_name) self.library_page.view_newest_releases_albums() assert_that(self.albums_page.newest_releases_albums_page_visible(), "Newest Albums should be shown").is_true() assert_that(len(self.albums_page.list_albums.elements)).is_greater_than(1).described_as("No Albums found") # Check Album BETA label self.albums_page.view_albums_beta_label() assert_that(self.albums_page.lb_albums_beta.is_visible, "BETA label should be present").is_true() self.navigation_page.click_dismiss() # Go to album screen and back self.albums_page.select_album_by_position(2) self.navigation_page.click_back() self.navigation_page.click_back() assert_that(self.library_page.bn_switch_artist.is_visible, "User are not on Library page").is_true()