@android
Feature: Android Artist Screen

  Background:
      Given a valid test user
      When I login to the android app

  Scenario: Header
      Given I can see the catalog screen
      And I am on the search tab
      When I search for "Somebody's Child"
        Then I can see artist Somebody's Child with id cc5f5a63-2bff-4dcb-8c9e-b4a9c6e4f9c4 in my search results
      When Tapping artist Somebody's Child with id cc5f5a63-2bff-4dcb-8c9e-b4a9c6e4f9c4 takes me to the artist page
        Then All expected elements in the artist header for Somebody's Child should be present
#      Removed check according to GO-4102
#      When I tap the share button
#        Then The share screen with 'Share Link' and 'Share as Image' options should be displayed


  Scenario: Streaming Trend
      Given The active screen is the artist screen
      When I inspect the Streaming Trend section
        Then All essential elements of the Streaming Trend section should be visible

      # By Stores
      When I inspect the POT section
        Then The POT list should display 6 stores by default
        And The "Show All Items" button should be visible
      When I tap the "Show All Items" button in the POT section
        Then The POT list should display top 10 stores
      When I select a random store from the POT list that has data
        Then The POT graph should be updated to display data only for the selected store
        #TODO: Re-enable once bug IN-16426 is fixed
  #        And The last day value from the POT graph should match the "1D" value in the POT table
#      When I inspect the POT stores list
#      And I select a random store from the POT list that has no data
#        Then I should see a message indicating that streaming data may be delayed

      # By Countries
      When I switch the POT view to "By Countries"
        Then The POT list should display top 10 countries
        And The "Show Less Items" button should be visible
      When I tap the "Show Less Items" button in the POT section
        Then The POT list should display top 6 countries
      When I select a random country from the POT list
        Then The POT graph should be updated to display data only for the selected country
        #TODO: Re-enable once bug IN-16426 is fixed
  #        And The last day value from the POT graph should match the "1D" value in the POT table

      # By Sources
      When I switch the POT view to "By Sources"
      And I select the "Total Streams" row from the POT list
        # TODO: Re-enable once bug IN-16426 is fixed
#        Then The last day value from the POT graph should match the "1D" value in the "Total Streams" row

      # Table totals
      When I inspect the POT table period switcher
          Then The "Recent" period should be selected by default
          # TODO: Re-enable once bug GO-4265 is fixed
#            And The POT recent total value should be the same for all POT tabs

#      When I set the POT table period to "All Time"
#          Then The POT all time total value should be the same for all POT tabs

      When I tap the store status button
            Then The Store Status screen should be displayed with all essential elements

  # TODO: Re-enable once bug GO-4843 is fixed
#  Scenario: Social Followers
#    When I inspect the Social Followers section on the Artist screen
#      Then I should see the 'MANAGE LINKED ACCOUNTS' button below the Social Followers section
#      And All available social networks should be displayed
#      And Social networks should be sorted by number of followers in descending order
#    When I tap on the Social Followers section on the Artist screen
#      Then The Social Followers page should be displayed
#      And All expected metrics should be visible
#      And A graph should be displayed for each connected social network
#    When I tap on the 'Fan Conversion Ratio' metric
#      Then The Fan Conversion Ratio page should be displayed
#    When I navigate back to the artist screen
#    And I tap on the 'MANAGE LINKED ACCOUNTS' button
#      Then The Manage Linked Accounts page should be displayed
#      And The following platforms should be listed
#        | Name       |
#        | Instagram  |
#        | Spotify    |
#        | YouTube    |
#        | Deezer     |
#        | Facebook   |
#        | SoundCloud |
#        | TikTok     |

  Scenario: Top Songs
    When I inspect the Top Songs section on the Artist screen
      Then I should see the "SEE ALL" button below the Top Songs section
      And The total number of displayed songs should be 3
      And All songs are displayed sorted by the 'STREAMS • 7 DAYS' filter
    When I change Top Songs sorting to 'Streams • All Time'
      Then All songs are displayed sorted by the 'STREAMS • ALL TIME' filter
    When I tap on a song card number 2
      Then The track page for the selected track should be displayed
      And I should be able to navigate back
    When I tap the 'SEE ALL' button to open all songs
      Then The total number of displayed songs should exceed 3
      And All songs are displayed sorted by the 'STREAMS • ALL TIME' filter
    When I tap on a song card number 3
      Then The track page for the selected track should be displayed
      And I should be able to navigate back
    When I tap the Filter icon on the Top Songs page
    And I select the country filter option
      Then I should see the full list of available countries with 'Global (Default)' selected by default
    When I select the following countries from the market selector
      | Name        |
      | Canada      |
      | Brazil      |
      | Argentina   |
      | France      |
      | Germany     |
      | Afghanistan |
      Then Songs for the selected countries should be displayed
    When I tap the Filter icon on the Top Songs page
      Then The country filter summary should display 'Canada, + 5' should be displayed
    When I reset the filter
      Then The country filter summary should be empty and not display 'Canada, + 5'
    When I select the country filter option
      Then I should see the full list of available countries with 'Global (Default)' selected by default
      And I should be able to navigate back
      And I should be able to close the filter window
    When I select top track 6
      Then The sound recording screen displays some data
      And I should be able to navigate back
    When I change Top Songs sorting to 'Streams • 1 Days'
    And I navigate back to the artist screen
      Then All songs are displayed sorted by the 'STREAMS • 1 DAYS' filter

  Scenario: Top Playlists
    When I inspect the Top Playlists section on the Artist screen
    And I tap the information icon next to the Top Playlists title
      Then A popup with information about the Top Playlists section should appear
      And The Top Playlists section should display correct and complete information
      And I should see the "See All" button below the playlists section
      And Playlist cards should display correct and complete information
      And The total number of displayed playlists should be 3
      And All playlists are displayed sorted by the '7D STREAMS' filter
     #TODO: Re-enable once bug GO-4354 is fixed
#    When I select 'Most Recent' in the playlists filter
#      Then All playlists are displayed sorted by the 'Most Recent' filter
    When I select 'Followers' in the playlists filter
      Then All playlists are displayed sorted by the 'Followers' filter
    When I tap the bottom part of playlist card number 2
      Then The track page for the selected track should be displayed
      And I should be able to navigate back
    When I tap the 'SEE ALL' button to open all playlists
      Then The total number of displayed playlists should exceed 3
      And Playlist cards should display correct and complete information
      And All playlists are displayed sorted by the 'Followers' filter
     #TODO: Re-enable once bug GO-4354 is fixed
#    When I change the playlists sorting option to 'Most Recent'
#      Then All playlists are displayed sorted by the 'Most Recent' filter
    When I filter playlists with the following criteria
      | Action            | Values                                                 |
      | Deselecting store | Apple Music                                            |
      | Deselecting types | Algorithmic, Editorial, New Music Friday, Personalized |
      | Markets           | United Kingdom                                         |
      Then Playlist cards should display correct and complete information
      And Playlist cards should display the following attributes
        | Property      | Value   |
        | Playlist Type | CURATED |
        | Country Label | GB      |
        | Store Icon    | Spotify |
    When I filter playlists with the following criteria
      | Action            | Values         |
      | Selecting store   | Apple Music    |
      | Deselecting store | Spotify        |
      | Selecting types   | Personalized   |
      | Deselecting types | Curated        |
      | Markets           | Argentina      |
      Then No playlists should be displayed
    When I reset the playlist filters
      Then The total number of displayed playlists should exceed 3
