@deprecated
@fansifter
@ad-reporting-page
Feature: Ad Reporting report edit/delete

  Background: Log in and open Ad Reporting page
    Given an orchard employee fansifter-set-1-4-ad-reporting for fansifter
    And I log in to fansifter silently
    And I have newly created ad report with one campaign

  @FS-2080
  @id_85f6914171dd0eae531b268bed569672347e8c206587504a2259b91eb091a709
  Scenario: Reports tab - Delete report
    Then I open Ad Reporting page
    When I try to delete created ad report from ad reports table
    Then delete report confirmation modal is shown
    And I cancel deletion of ad report
    When I search created ad report by name
    Then I receive reports data from backend
    And created ad report name should be present in reports table
    When I try to delete created ad report from ad reports table
    Then delete report confirmation modal is shown
    And I confirm deletion of ad report
    Then created ad report name should not be present in reports table
    When I search created ad report by name
    Then I receive reports data from backend
    And created ad report name should not be present in reports table

  @FS-3291
  @ows_dmp
  @cleanup-created-ad-report
  @id_d639085ee200d8cc449ba4cf131f6b2ab3e359c29e05d4e778bf63de6ad830c5
  Scenario: Ad reporting > Rename Ad Report
    When I try to rename Ad report but cancel
    Then correct ad report name present in report page header
    When I refresh the page
    Then correct ad report name present in report page header
    When I change Ad report name
    Then edited Ad report name is present in report page header
    When I refresh the page
    Then edited Ad report name is present in report page header

  @cleanup-created-ad-report
  @FS-3320
  @id_4e8aad52f4dcb2373f06fc45c8ecaf398a0a74c2d75ed51f0baae1126dce2d6c
  Scenario: Ad Reporting > Add campaign to existing report on Campaigns tab
    When I open Ad Reporting page
    And I click Campaigns tab
    And I receive campaigns data from backend
    Then Default campaigns data is correctly shown in the table
    When I click on Add campaign to report table button for first campaign in created Ad Report
    Then Campaign's Add to report modal should be present
    And Created Ad Report should be checked in Add to report modal
    When I cancel adding campaign to Ad report
    Then Campaign's Add to report modal should not exist
    When I click on Add campaign to report table button for campaign not in created Ad Report
    Then Campaign's Add to report modal should be present
    And Created Ad Report should not be checked in Add to report modal
    And I select created Ad Report in Add to report modal and confirm
    When I open Ad Reporting page
    And I open created Ad report
    And correct ad report name present in report page header
    And report data is correctly shown in the page
    And topline table data is correctly shown on ad report page
    And by Country table data is correctly shown on ad report page

  @cleanup-created-ad-report
  @FS-3321
  @ows_dmp
  @id_9abb114551df88b658c719e453cb211cb0225afdce296beee03f1233f1ba1fdd
  Scenario: Ad Reporting > Add campaign to existing report on Campaign overview page
    When I open Ad Reporting page
    And I click Campaigns tab
    And I receive campaigns data from backend
    Then Default campaigns data is correctly shown in the table
    When I click on campaign that not in created Ad Report
    Then I receive "campaign" data from backend
    And campaign data is correctly shown in the page
    When I click on campaign's "Add to report" button
    Then Campaign's Add to report modal should be present
    And Created Ad Report should not be checked in Add to report modal
    And I select created Ad Report in Add to report modal and confirm
    When I open Ad Reporting page
    And I open created Ad report
    Then correct ad report name present in report page header
    And report data is correctly shown in the page
    And topline table data is correctly shown on ad report page
    And by Country table data is correctly shown on ad report page

  @cleanup-created-ad-report
  @FS-3321
  @ows_dmp
  @id_2f84861cfdf8bc15080ac61539bfaacb4dabbce3809baeef679e3c1fe3d9fe2c
  Scenario: Ad Reporting > Add campaign to existing report on Report > Campaign tab
    When I click on report's "Campaigns" tab
    Then Report's "Campaigns" filters are shown
    And I receive report's campaigns data from backend
    And All campaigns should be shown in report's campaigns tab table
    When I click add "Add Campaigns" button on report campaigns tab
    Then Add campaigns to report modal should be present
    And Already added campaigns should be checked in Add Campaigns modal
    When I add new campaign to Ad Report in Add Campaigns modal
    Then Add campaigns to report modal should not exist
    When I refresh the page
    And I receive report's campaigns data from backend
    Then All campaigns should be shown in report's campaigns tab table
