@deprecated
@fansifter
@audience-overview-page
@audience-share
Feature: Audience overview page share tests

  Rule: Extra small Audience (size < 1000)

    Background: Log in and create an audience for sharing
      Given an orchard employee fansifter-set-2-5-taurus for fansifter
      And I log in to fansifter silently
      And I have the audience data:
        | Account      | Test Label              |
        | Audience Use | Advertising             |
        | Artists      | Wolfgang Amadeus Mozart |
        | Fan location | Italy                   |
        | Fan segment  | Include, Casual Fans    |
      When I visit Audiences page
      And I open New audience page
      And I fill new audience data
      When I click on the Save button for new audience
      Then new audience is created
      And audience size is less than 1000
      When I open the Share audience sidebar

    @FS-3264
    @cleanup-created-audience
    @id_50e97b0f3949a88c2a0475815c5df4b73fedff6b04f092809577c81cbde0d3ca
    Scenario: Audience overview page share extra small audience to TikTok and Google
      When I set Ad account to Fansifter Test Business1212
      Then Small audiences can't be shared to TikTok alert message is shown in the Share sidebar
      And Share button in the Share sidebar does not start sharing audience
      And Small audiences can't be shared to TikTok alert message is shown in the Share sidebar
      When I click Cancel button in the Share sidebar
      Then I open the Share audience sidebar
      When I set Ad account to Fansifter ad reporting 2
      Then Small audiences can't be shared to Google alert message is shown in the Share sidebar
      And Share button in the Share sidebar does not start sharing audience
      And Small audiences can't be shared to Google alert message is shown in the Share sidebar

  Rule: Small Audience (size < 10000)

    Background: Log in and create an audience for sharing
      Given an orchard employee fansifter-set-2-5-taurus for fansifter
      And I log in to fansifter silently
      And I have the audience data:
        | Account      | Test Label              |
        | Audience Use | Advertising             |
        | Artists      | Wolfgang Amadeus Mozart |
        | Fan segment  | Include, Engaged Fans   |
      When I visit Audiences page
      And I open New audience page
      And I fill new audience data
      When I click on the Save button for new audience
      Then new audience is created
      And audience size is greater than 1000
      And audience size is less than 10000
      When I open the Share audience sidebar

    @FS-2356
    @cleanup-created-audience
    @id_cdd64a936669bbe823854602f96c4f5c3750afae9ab4f8fd3d5537e456a7dc26
    Scenario: Audience overview page share audience error message
      When I click Share button in the Share sidebar
      Then I see options error message in the Share sidebar

    @FS-2364
    @cleanup-created-audience
    @id_a8c658eb464bcc6acddcb4ce50fdff87d321dc75d1023953cbecc55f443618ac
    Scenario: Audience overview page ShareMetaAudience request error
      Given I block shareMetaAudience request
      When I set Ad account to Demo Ad Account
      And I click Share button in the Share sidebar
      Then toast with the text is shown
        """
        Network error. Please try again.
        """

    @FS-2433
    @cleanup-created-audience
    @id_42c9542a36b3b2c626726f3bd9f6d8a2fab3583aa5c1c1afaf3e4b1b40145b05
    Scenario: Audience overview page No Meta Ad Accounts message
      Then No Meta Ad Accounts message is shown in the Share sidebar

    @FS-2417
    @cleanup-created-audience
    @share-audience-lambda
    @id_6ef5b2202cf5a2fb702bfdeced917ced83333311eb35981fda24208a6d36ef6f
    Scenario: Audience overview page share small audience to Meta
      When I set Ad account to Demo Ad Account
      And I click Share button in the Share sidebar
      Then loading spinner with text is shown in the Share sidebar
      And audience is successfully shared to Meta

    @cleanup-created-audience
    @share-audience-lambda
    @id_726f472bf3bfffc4f0930682bf086fa3c897ee78d60e3778ee37418408003bdf
    Scenario: Audience overview page share small audience to Google
      When I set Ad account to Fansifter ad reporting 2
      And I click Share button in the Share sidebar
      Then loading spinner with text is shown in the Share sidebar
      And audience is successfully shared to Google

  Rule: Large Audience (size > 10000)

    Background: Log in and create an audience for sharing
      Given an orchard employee fansifter-set-2-5-taurus for fansifter
      And I log in to fansifter silently
      And I have the audience data:
        | Account      | Test Label              |
        | Audience Use | Advertising             |
        | Artists      | Wolfgang Amadeus Mozart |
        | Fan location | United Kingdom          |
      When I visit Audiences page
      And I open New audience page
      And I fill new audience data
      When I click on the Save button for new audience
      Then new audience is created
      And audience size is greater than 10000
      When I open the Share audience sidebar

    @FS-2451
    @cleanup-created-audience
    @share-audience-lambda
    @id_123de5816bd8b8fce3f48bc1b6ce6937090ffdb3aeed4cf45b71f20d75c44a73
    Scenario: Audience overview page share large audience to Meta
      When I set Ad account to Demo Ad Account
      And I click Share button in the Share sidebar
      Then progress indicator with text is shown in the Share sidebar
      And audience is successfully shared to Meta

    @FS-4432
    @cleanup-created-audience
    @share-audience-lambda
    @id_3fda181f76094ca72fba2eee87654e50d24c3f4b06922432ec5dfae8f07c69cf
    Scenario: Audience overview page share large audience to Google
      When I set Ad account to Fansifter ad reporting 2
      And I click Share button in the Share sidebar
      Then progress indicator with text is shown in the Share sidebar
      And audience is successfully shared to Google

    @FS-3265
    @share-audience-lambda
    @cleanup-created-audience
    @id_2520803b432f326c7d6cacaa20cfedc816a33aa0c5c7893d4e66898d01356a5c
    Scenario: Audience overview page share large audience to TikTok
      When I set Ad account to Fansifter Test Business1212
      And I click Share button in the Share sidebar
      Then loading spinner with text is shown in the Share sidebar
      And audience is successfully shared to TikTok
