@frontend_royalties
Feature: Abacus Account Payment History

  @wip
  @id_20d9e1d251c259737b5a566a00156ade22cef1ab153e2b6501b50400ddf5a7b0
  Scenario: Contract dropdown filters properly and entries are not grouped
    Given an orchard employee label_7123_admin_3 for abacus
    When I log in
    And I open the Abacus Account Payment History page for account "73142"
    Then the Payment History tab should be active
    And the account payment history table should have rows
    And the account payment history entries should not be grouped by contract
    When I verify the contract dropdown contains "Test UK VAT Registered - 1" and "Test UK VAT Registered - 2"
    And I select contract "Test UK VAT Registered - 1" in the account payment history filter
    Then all account payment history rows should have contract "Test UK VAT Registered - 1"
    When I clear the contract filter in account payment history
    And I select contract "Test UK VAT Registered - 2" in the account payment history filter
    Then all account payment history rows should have contract "Test UK VAT Registered - 2"

  @wip
  @id_7a900c594529b8c1b55be1006d27f910f9e25e48041fef6b5d549c619a7a3d9a
  Scenario: Payment Status and Date filters work properly
    Given an orchard employee label_7123_admin_3 for abacus
    When I log in
    And I open the Abacus Account Payment History page for account "73142"
    And I select all Payment Statuses in account payment history and apply
    Then the account payment history table should have rows
    When I clear all Payment Statuses in account payment history and select "Cancelled"
    Then all account payment history rows should have payment status "Cancelled"
    When I select all Payment Statuses in account payment history and apply
    And I save the Payment Created Date from the first account payment history row
    And I apply the saved Payment Created Date as a filter in account payment history
    Then all account payment history rows should have the saved Payment Created Date

  @id_f32cdac9fccb740105a6089d41407785ac358336154236a50148a8faf3dae1ef
  Scenario: Pagination works properly
    Given an orchard employee label_7123_admin_3 for abacus
    When I log in
    And I open the Abacus Account Payment History page for account "61359"
    And I select all Payment Statuses in account payment history and apply
    Then the account payment history table should have more than 20 rows total
    And the account payment history table should have 20 rows
    And the account payment history pagination should show "1 - 20"
    When I click the account payment history next page button
    Then the account payment history table should have at least 1 row
    And the account payment history pagination should not show "1 - 20"
    When I click the account payment history previous page button
    Then the account payment history pagination should show "1 - 20"
    When I open the account payment history pagination popover
    Then the account payment history pagination popover should be visible
    And the account payment history rows per page "20" should be active
    When I change account payment history page size to "50"
    Then the account payment history table should show all rows on one page
    When I open the account payment history pagination popover
    And I change account payment history page size to "10"
    Then the account payment history table should have 10 rows
    And the account payment history pagination should show "1 - 10"
    When I open the account payment history pagination popover
    And I click the account payment history popover "Last page" button
    When I open the account payment history pagination popover
    Then the account payment history popover "Last page" button should be disabled
    And the account payment history popover "First page" button should be enabled
    When I click the account payment history popover "First page" button
    Then the account payment history pagination should show "1 - 10"
