Feature: Track Builder Upload
  In order to ensure I can submit a track
  As a vendor
  I need to verify Track Builder upload feature

  # QA-999990 Locally works OK, for some reason unable to find files to upload while running on grid
  @ows_track
  @ows_assets
  @frontend_distribution
  Scenario: Upload 5 tracks
    Given a standalone Workstation label_7123 user
    And I am on the Project::DigitalProductTracksPage for a product with no tracks
    When I upload 5 tracks via track builder bulk upload field
    Then I can see the tracks in the tracklist table

  @ows_track
  @ows_assets
  @frontend_distribution
  Scenario: Upload and reupload
    Given a standalone Workstation label_7123 user
    And I am on the Project::DigitalProductTracksPage for a product with no tracks
    When I import a valid track via "upload from computer" dialog box
    Then I can see the track in the tracklist table
    When I replace not a blank track's audio file
    And I can see uploading progress
    Then I can see the track is replaced

  @ows_track
  @ows_assets
  @frontend_distribution
  Scenario: Import track - upload error
    Given a standalone Workstation label_7123 user
    And I am on the Project::DigitalProductTracksPage for a product with no tracks
    When I import an invalid track via "upload from computer" dialog box
    Then I can see when there was an error during the track upload

  # we have to find a better way for drag and drop
  @ows_track
  @ows_assets
  @frontend_distribution
  Scenario: Drag tracks
    Given a standalone Workstation label_7123 user
    And I am on the Project::DigitalProductTracksPage for a product with no tracks
    And I add 2 blank tracks
    And there are no volume dividers present
    When I drag the last track to the top position
    Then the track order should persist after a page refresh
  
  # we have to find a better way for drag and drop
  @ows_track
  @ows_assets
  @frontend_distribution
  Scenario: Add, move, and delete volume dividers
    Given a standalone Workstation label_7123 user
    And I am on the Project::DigitalProductTracksPage for a product with no tracks
    And I add 2 blank tracks
    And there are no volume dividers present
    When I add a volume divider
    And I move the volume divider between the tracks
    # todo : fix move divider and refresh page
    # Then the tracks are still separated by volumes after a page refresh
    Then the tracks are separated by volumes

  @ows_track
  @ows_assets
  @frontend_distribution
  Scenario: Cancel delete track
    Given a standalone Workstation label_7123 user
    And I am on the Project::DigitalProductTracksPage for a product with 1 track
    When I initiate track deletion
    And I cancel track deletion
    Then I can see that the track has not been deleted

