@fansifter
@ad-reporting-page
Feature: Ad Reporting report creation

  Background: Log in and open Ad Reporting page
    Given an orchard employee fansifter-set-2-4-aries for fansifter
    When I log in
    And I open Ad Reporting page
    Then Ad Reporting New Report button is shown in the header

  @FS-2864
  @ows_dmp
  @cleanup-created-ad-report
  @id_877a4c9c806dba3ee46226d8e1e4a6813402df12ca34d634be50e2c007aa8201
  Scenario: Create report with one campaign
    When I click on "New report" button
    Then new ad report modal is opened
    Then I select first campaign in table for new ad report
    And I confirm selected campaigns for new ad report
    Then I fill new ad report random name
    When I confirm creating new ad report
    Then I receive "report" data from backend
    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

  @FS-2889
  @ows_dmp
  @id_94b23aff59a2c6468d648e9f20d1633b109a51f40f8ccccca9ae11f2ed089a6d
  Scenario: Create report with few campaigns with different platforms and objectives but same accounts and artists
    When I click on "New report" button
    Then new ad report modal is opened
    And I receive "campaigns" data from backend
    When I filter new report campaigns by "Beyoncé" artist
    Then I receive "campaigns" data from backend
    When I filter new report campaigns by "Traffic" objective for "Meta" platform
    Then I receive "campaigns" data from backend
    And I select first campaign in table for new ad report
    When I filter new report campaigns by "Video Views" objective for "TikTok" platform
    Then I receive "campaigns" data from backend
    And I select first campaign in table for new ad report
    When I filter new report campaigns by "Video" objective for "Google" platform
    Then I receive "campaigns" data from backend
    And I select first campaign in table for new ad report
    When I confirm selected campaigns for new ad report
    Then I fill new ad report random name
    When I confirm creating new ad report
    Then I receive "report" data from backend
    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

  @FS-3294
  @id_a341bea920fcc9e4cac2c015f6b77da57b06c866004e1435004bafe257b71d94
  Scenario: Ad Reporting > Cancel Ad report creation
    When I click on "New report" button
    Then new ad report modal is opened
    And I receive "campaigns" data from backend
    When I filter new report campaigns by "Beyoncé" artist
    Then I receive "campaigns" data from backend
    When I filter new report campaigns by "Traffic" objective for "Meta" platform
    Then I receive "campaigns" data from backend
    And I select first campaign in table for new ad report
    When I cancel new Ad report creation
    Then create Ad report modal is closed
    When I click on "New report" button
    Then new ad report modal is opened
    And I receive "campaigns" data from backend
    When I select first campaign in table for new ad report
    And I confirm selected campaigns for new ad report
    Then I fill new ad report random name
    When I cancel new Ad report creation
    Then create Ad report modal is closed
    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
