@frontend_masters_registry
@ows_masters_registry
Feature: Masters Registry 2

  Background:
    Given an orchard employee cypress_manager_2 visits oa
    And I log in

  @id_7a63a38a57477668184d83a42867aef9bec2031b2206e65446ebb5cce32840fc
  Scenario: Rightsholder Worldwide Territories
    Given I navigate to bulkLockTerritoriesPage oa page
    And I navigate to mastersEditorPage for ISRC USA371130635 oa page
    And every territory is unclaimed & unlocked
    When I add a rightsholder for every territory
    Then every territory is claimed for the rightsholder

  @id_0927fc08a5d960545eac8ab882e690c2d8ed5d08851d70cd4adcb524bcc4ac33
  Scenario: Add a rightsholder for all except some territories
    Given I navigate to mastersEditorPage for ISRC USA371130635 oa page
    And every territory is unclaimed
    When I add a rightsholder for every territory except EE, TT
    Then Estonia, Trinidad and Tobago should be the only unclaimed & unlocked territories

  @id_21e1baac803b4746e1fa79f26d9fb1bd48799d5f77e3d48c5b7e0897e058638a
  Scenario: Bulk lock all except some territories
    Given I navigate to mastersEditorPage for ISRC USA371130635 oa page
    And every territory is unclaimed & unlocked
    And I navigate to bulkLockTerritoriesPage oa page
    When I bulk lock all territories except EE, TT for ISRC: USA371130635
    Then I see a message indicating that the bulk action process started
    And I navigate to bulkActionsStatusesPage oa page
    Then I expect to see a success for the last bulk lock action
    Given I navigate to mastersEditorPage for ISRC USA371130635 oa page
    And Estonia, Trinidad and Tobago should be the only unclaimed & unlocked territories

  @id_3d1dd38aa2f4aadeccc51ff3e6a7c25a6ef166f0397d39557c2546032daa3ecb
  Scenario Outline: Bulk update UPCs
    Given I navigate to bulkUpdateUpcsPage oa page
    When I attempt to update track rights for UPC: <UPC>
    Then I should see an <expected_message> message for upc type <upc_type>

    Examples:
      | upc_type     | UPC            | expected_message                        |
      | invalid      | 20000000050423 | Invalid type of UPC                     |
      | non-existent | 111111111111   | UPC does not exist                      |
      | valid        | 191018751753   | Bulk action has begun in the background |
