@accounting_sub
Feature: Accounting Subaccount

  # ACC-594
  @ows_accounting
  @frontend_accounting
  Scenario: Subaccount user is able to cancel the report
    Given I am on the AccountingSub::StatementsPage
    When I click 'Request Report' button for last period with positive revenue
    Then I should see report form with all required elements
    When I cancel the report request
    Then I should be redirected to the statements page

  # ACC-624, ACC-860, ACC-861
  @ows_accounting
  @frontend_accounting
  Scenario Outline: Subaccount user is able to download just generated report
    Given I am on the AccountingSub::StatementsPage
    And I use Sub accounting user
    When I click 'Request Report' button for last period with positive revenue
    And I select <file_type> file type
    And I select <number_format> number format
    And I clean up previous downloads history for <report_type> report
    And I attempt to generate <report_type> report
    Then I should be redirected to the view requested page
    And the last report should be displayed correctly on the requested reports history page
    And I wait until the report has Download link
    And I try to download file from the last generated report
    Then I should have downloaded file in the system with corresponding name
    And the report file should have required fields

    Examples:
      | report_type | file_type | number_format |
      | full        | xls       | US            |
      | custom      | txt       | US            |
      | physical    | xls       | EU            |
