@android
Feature: Android Product 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 "Hospice"
        Then I can see product Hospice with id 183021 in my search results
      When Tapping product Hospice with id 183021 takes me to the product page
        Then The product header should display correct information for Hospice
      When I tap on artist The Antlers button
        Then I should be navigated to the artist page for The Antlers
        And I navigate back from the artist screen

  Scenario: Streaming Trend
      Given The active screen is the product 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

  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
      And I should see the "See All" button below the playlists section
    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
      And I should be able to navigate back
    When I tap the bottom part of playlist card number 1
      Then The track page for the selected track should be displayed
      And I should be able to navigate back

  Scenario: Tracklist
    When I inspect the Tracklist section on the Product screen
      Then The product tracklist should be displayed
      And Tracklist cards should display correct and complete information
    When I tap on a track from the tracklist by the number 5
      Then The track page for the selected track should be displayed
      And I should be able to navigate back to the product page by tapping the back button
    When I tap the store status button
      Then The Store Status screen should be displayed with all essential elements
