@android @smoke
Feature: Android Basic Flow

    @auth0-hosted-pages
    Scenario: User can login
        Given a valid test user
        When I login to the android app
        Then I can see the catalog screen

    Scenario: Songs screen displays data
        When I navigate to the songs tab
        Then The songs tab displays with data

    Scenario: I can search and select an artist
        Given 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
        And Tapping artist Somebody's Child with id cc5f5a63-2bff-4dcb-8c9e-b4a9c6e4f9c4 takes me to the artist page
        And The artist screen for Somebody's Child displays data

    Scenario: I can search and select a song
        Given I am on the search tab
        When I search for "USJMZ0900024"
        Then I can see song Kettering with id USJMZ0900024 in my search results
        When Tapping song Kettering with id USJMZ0900024 takes me to the song page
        Then The sound recording screen displays all data

    Scenario: I can search and select a product
        Given I am on the search tab
        When I search for "Money"
        Then I can see product Money with id 320226 in my search results
        And Tapping product Money with id 320226 takes me to the product page

    Scenario: View all search results
        Given I am on the search tab
        # Artists
        When I search for "John"
            And I tap the "See all" option in the Artists section
        Then The All Artists search results page for "John" should be displayed
            And Each artist result card should display all required elements
        When I tap on the last artist result card
            Then I should be navigated to the selected artist page
        When I navigate back from the artist screen
            Then The All Artists search results page for "John" should be displayed
            And I should be able to scroll through the complete list of artist results
            And I should be able to navigate back
        # Songs
        #TODO: Re-enable once bug GO-4172 is fixed
#        When I search for "Dream"
#            And I tap the "See all" option in the Songs section
#        Then The All Songs search results page for "Dream" should be displayed
#            And Each song result card should display all required elements
#        When I tap on the last song result card
#            Then The track page for the selected track should be displayed
#        When I navigate back from the song screen
#            Then The All Songs search results page for "Dream" should be displayed
#            And I should be able to scroll through the complete list of song results
#            And I should be able to navigate back
        # Products
        When I search for "Love"
            And I tap the "See all" option in the Products section
        Then The All Products search results page for "Love" should be displayed
            And Each product result card should display all required elements
        When I tap on the last product result card
            Then The product page for the selected product should be displayed
        When I navigate back from the product screen
            Then The All Products search results page for "Love" should be displayed
            And I should be able to scroll through the complete list of product results
            And I should be able to navigate back

        #TODO: Re-enable once bug GO-4522
#    Scenario: No results message appears for non-existing search
#        Given I am on the search tab
#        When I search for a non-existing item "Realun IO"
#        Then The search results should display a message indicating no matches were found


#    Scenario: I can see recent searches for songs/artists/products
#        Given I am on the search tab
#        When I clear the search field
#        Then I should see song Kettering with id USJMZ0900024 in the list of recent searches
#        And I should see artist The Antlers with id 7e46ecea-c229-4f33-87be-70f11bfcb805 in the list of recent searches
#        And I should see product Money with id 320040 in the list of recent searches

#    Scenario: Opening a recent search item moves it to the top of the Recent Searches list
#        Given I am on the search tab
#        When Tapping artist The Antlers with id 7e46ecea-c229-4f33-87be-70f11bfcb805 takes me to the artist page
#        Then The artist screen for The Antlers displays data
#        When I navigate back from the artist screen
#        Then The recent search on line 1 is The Antlers
#        And The recent search on line 2 is Money
#        And The recent search on line 3 is Kettering

#    Scenario: I can clear all recent searches
#        Given I am on the search tab
#        When I clear recent search results
#        Then I should see no recent results
#
#    Scenario: Sound recording screen displays data
#        Given I am on the home tab
#        When I select top track 1
#        Then The sound recording screen displays all data

#    Scenario: Playlisting screen displays data
#        When I navigate to the playlisting screen
#        Then Recent playlists are displayed

#    Scenario: Products screen displays data
#        When I navigate to the products screen
#        Then Recent products are displayed

#    Scenario: User can log out
#        When I log out of my account
#        Then I am taken to the login page
