@accounting_d3
Feature: Accounting D3

  # ACC-594, ACC-625
  @ows_accounting
  @frontend_accounting
  Scenario: D3 user is able to cancel the report
    Given I am on the AccountingD3::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-621
  @ows_accounting
  @frontend_accounting
  Scenario: D3 user should be able to see the requested reports history
    Given I am on the AccountingD3::StatementsPage
    When I click 'View Requested' link for last period with positive revenue
    Then I should be redirected to the view requested page
    And the ViewRequestedReports page title should be displayed correctly
    And I should see all available reports that currently queued or ready for download

  # ACC-858, ACC-616, ACC-859
  @ows_accounting
  @frontend_accounting
  Scenario Outline: D3 user is able to download just generated report
    Given I am on the AccountingD3::StatementsPage
    And I use D3 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            |
