@frontend_royalties
@ows_royalties
@ows_abacus_contract
Feature: Abacus Contracts 3

  Background: Clear browser
    Given I have a clear browser

  @ows_abacus_account
  @id_f760547e585eaf12600d311b71b34d3ba83ac05cfaeac16681b8a6c306543fab
  Scenario: Search for contract
    Given an orchard employee label_7123_admin_1 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 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 search for a contract by contract_name and contract_id
    And I should be able to search for a contract by account_name and account_id
    And recent searches should be present
    And I should be able to search for a contract by contract type: Distribution
    And I should be able to search for a contract by contract type: Performer Neighbouring Rights
    And I should be able to search for a contract by accounting run status: Excluded
    And I should be able to search for a contract by accounting run status: Included
    And I should be able to search for a contract by contract status: Terminated
    And I should be able to search for a contract by contract status: Active
    And I should be able to search for a contract by contract status: To Be Terminated
    And I should be able to search for a contract by runcontroller

  @id_2ff9097d3c61ce93ae86a32f76f5855c71da95f6e3ca681e0e58bc76303cecf1
  Scenario: Contract History Reports modal and links
    Given an orchard employee label_7123_admin_3 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 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 view History Reports modal and links
