@frontend_royalties
@ows_royalties
@ows_abacus_contract
Feature: Abacus Contracts 1

  Background: Clear browser
    Given I have a clear browser

  @ows_abacus_account
  @id_1deb7f3fd7f3b8779237f07921e3203a9a3dac7ab2d5ad5ca0c31e403082625a
  Scenario Outline: Add Contract
    Given an orchard employee label_7123_admin_1 for Abacus
    When I log in to Abacus silently
    Then I am successfully logged in to Abacus
    And I prepare an abacus account data:
      | Key              | Value                   |
      | companyBrandName | awal                    |
      | paidBy           | AWAL-US                 |
      | agreementType    | AWAL Core               |
      | currency         | USD                     |
      | owner            | awal                    |
      | paymentMinimum   | 123                     |
      | paymentSchedule  | 45 days after month end |
    And I create 1 new account via API
    And I have a <type> runcontroller created
    And I have a new <type> contract lifecycle created with accounts created for AWAL Recordings America, Inc.

    Examples:
      | type                          |
      | Distribution                  |
      | Performer Neighbouring Rights |

  @delete_schedule
  @id_93d2682b2ac9b8b1fc9d107fb4f5ea9d008c2bf0410cedde2ee39f266ea9208f
  Scenario: Neighbouring Rights contract -> copy terms from contract_a to contract_b of the same account
    Given an orchard employee label_7123_admin_1 for Abacus
    When I log in to Abacus silently
    And I am successfully logged in to Abacus
    And I prepare an abacus account data:
      | Key              | Value                   |
      | companyBrandName | awal                    |
      | paidBy           | AWAL-US                 |
      | agreementType    | AWAL Core               |
      | currency         | USD                     |
      | owner            | awal                    |
      | paymentMinimum   | 123                     |
      | paymentSchedule  | 45 days after month end |
    And I create 1 new account via API
    And I have a Performer Neighbouring Rights runcontroller created
    And I have a new Performer Neighbouring Rights contract lifecycle created with accounts created for AWAL Recordings America, Inc.
    Then I should be able to add Neighbouring Rights contract contributors
    And I should be able to add schedule for this contributor
    Then I should be able to add NR Contributor Only contract term
    And I have another Performer Neighbouring Rights contract lifecycle created with this account
    Then I should be able to copy NR contract terms from one contract to another

  @delete_schedule
  @id_7bb5263124ed78dcd51b449695ff9cf4de272cb55e2ff93cc7c07426116178e9
  Scenario: Neighbouring Rights contract -> copy terms from contract_a to contract_b of the different accounts
    Given an orchard employee label_7123_admin_1 for Abacus
    When I log in to Abacus silently
    And I am successfully logged in to Abacus
    And I prepare an abacus account data:
      | Key              | Value                   |
      | companyBrandName | awal                    |
      | paidBy           | AWAL-US                 |
      | agreementType    | AWAL Core               |
      | currency         | USD                     |
      | owner            | awal                    |
      | paymentMinimum   | 123                     |
      | paymentSchedule  | 45 days after month end |
    And I create 1 new account via API
    And I have a Performer Neighbouring Rights runcontroller created
    And I have a new Performer Neighbouring Rights contract lifecycle created with accounts created for AWAL Recordings America, Inc.
    Then I should be able to add Neighbouring Rights contract contributors
    And I should be able to add schedule for this contributor
    Then I should be able to add NR Contributor Only contract term
    And I prepare an abacus account data:
      | Key              | Value                   |
      | companyBrandName | awal                    |
      | paidBy           | AWAL-US                 |
      | agreementType    | AWAL Core               |
      | currency         | USD                     |
      | owner            | awal                    |
      | paymentMinimum   | 123                     |
      | paymentSchedule  | 45 days after month end |
    And I create 1 new account via API
    And I have a new Performer Neighbouring Rights contract lifecycle created with accounts created for AWAL Recordings America, Inc.
    Then I should be able to add Neighbouring Rights contract contributors
    Then I should be able to copy NR contract terms from one contract to another

  @id_64bbd37438ed0491ebf5391f5bfdfd916e2106d7c0f212383c68eff15035e7c4
  Scenario: Distribution contract -> copy terms from contract_a to contract_b
    Given an orchard employee label_7123_admin_2 for Abacus
    And I log in to Abacus silently
    And I am successfully logged in to Abacus
    And I prepare an abacus account data:
      | Key              | Value                   |
      | companyBrandName | awal                    |
      | paidBy           | AWAL-US                 |
      | agreementType    | AWAL Core               |
      | currency         | USD                     |
      | owner            | awal                    |
      | paymentMinimum   | 123                     |
      | paymentSchedule  | 45 days after month end |
    And I create 1 new active account via API
    And I have a Distribution runcontroller created
    And I have a new Distribution contract lifecycle created with accounts created for AWAL Recordings America, Inc.
    Then I should be able to fill Label contract term details
    And I have a new Distribution contract lifecycle created with accounts created for AWAL Recordings America, Inc.
    Then I should be able to copy Distribution contract terms from one contract to another

  @id_f6a43d827f93cb9aa414e65bc342eea82135c90f04c70e1b8c040e08f7a9d757
  Scenario Outline: Add Distribution contract terms
    Given an orchard employee label_7123_admin_2 for Abacus
    And I log in to Abacus silently
    And I am successfully logged in to Abacus
    And I prepare an abacus account data:
      | Key              | Value                   |
      | companyBrandName | awal                    |
      | paidBy           | AWAL-US                 |
      | agreementType    | AWAL Core               |
      | currency         | USD                     |
      | owner            | awal                    |
      | paymentMinimum   | 123                     |
      | paymentSchedule  | 45 days after month end |
    And I create 1 new active account via API
    And I have a Distribution runcontroller created
    And I have a new Distribution contract lifecycle created with accounts created for AWAL Recordings America, Inc.
    Then I should be able to fill <type> contract term details

    Examples:
      | type    |
      | Label   |
      | Product |
      | Track   |

  @id_bab4d421a28f587f43cfef719db550d8f7cca2cee7a7c71ae58dfc4769103a38
  Scenario: Distribution contract terms order grouping
    Given an orchard employee label_7123_admin_2 for Abacus
    And I log in to Abacus silently
    And I am successfully logged in to Abacus
    And I navigate to the contract with multiple terms
    Then I should see contract terms in correct order
