@fansifter
@email-campaigns
Feature: Email Campaigns

  @FS-4061
  @id_a1df06211b950c83945f1b45834d9e31da0c7b5faab74080ef5d583e6dc76b4a
  Scenario: Email Campaign
    Given an orchard employee fansifter-set-2-12-ophiuchus for fansifter
    Given I have Email Campaigns permissions:
      | Test Label             | create |
      | Columbia Records Group | create |
    When I log in
    And I visit Email Campaigns page
    Then I receive email campaigns data from backend
    And I see valid Email Campaigns page with create access
    When I show "Account" column for Email Campaigns table
    Then I see only "Test Label, Columbia Records Group" accounts in Email Campaigns table
    And I check correct permissions for Sent Email Campaigns
    And I check correct permissions for Draft Email Campaigns
    And I check correct permissions for Scheduled Email Campaigns

  @FS-4062
  @ows_dmp
  @cleanup-created-email-campaign
  @id_d7cce9b3d7510d8acb6c8b39dc460cc54c68c2538090c1b8a1783194300a0627
  Scenario: Create Email Campaign for Artist
    Given an orchard employee fansifter-set-2-12-ophiuchus for fansifter
    Given I have email campaign data:
      | Account | Test Label (7123)       |
      | Artist  | Wolfgang Amadeus Mozart |
    When I log in
    And I visit Email Campaigns page
    Then I receive email campaigns data from backend
    And I see valid Email Campaigns page with create access
    And I see correct data table on Email Campaigns page
    When I create Email Campaign with data
    Then I see correct email campaign data on Email Overview page

  @FS-4098
  @ows_dmp
  @cleanup-created-email-campaign
  @id_d06cb020a5414020c47efac7ecea00b70164fcb9df90ac57cdc26afb8fceb5c6
  Scenario: Create Email Campaign for Artist List
    Given an orchard employee fansifter-set-2-12-ophiuchus for fansifter
    Given I have email campaign data:
      | Account | Test Label (7123) |
      | List    | Warped Tour       |
    When I log in
    And I visit Email Campaigns page
    Then I see valid Email Campaigns page with create access
    When I create Email Campaign with data
    Then I see correct email campaign data on Email Overview page

  @FS-4820
  @ows_dmp
  @cleanup-created-email-campaign
  @cleanup-duplicated-email-campaign
  @id_ea57eb94457265cccb6d858ad20b9a3326212218a6ae62d83a5a330d259dbedd
  Scenario: Duplicate Email Campaign
    Given an orchard employee fansifter-set-2-12-ophiuchus for fansifter
    Given I have email campaign data:
      | Account | Test Label (7123)       |
      | Artist  | Wolfgang Amadeus Mozart |
    When I log in
    And I visit Email Campaigns page
    Then I see valid Email Campaigns page with create access
    When I create Email Campaign with data
    Then I see correct email campaign data on Email Overview page
    When I edit Email Campaign Details with data:
      | Subject      | Original Subject      |
      | Preview Text | Original Preview Text |
      | Sender Name  | Original Sender Name  |
    Then I see correct email campaign data on Email Overview page
    When I duplicate opened Email Campaign
    Then I see duplicated Email Campaign overview page
    Then I see correct email campaign data on Email Overview page

  @FS-5026
  @cleanup-created-email-campaign
  @id_461a47e66822864062c4987f10d350bc4507adc5227b2cf21997859ce3ce632f
  Scenario: [Email Campaigns] Privacy footer block should be required to send email campaign
    Given an orchard employee fansifter-set-2-12-ophiuchus for fansifter
    Given I have email campaign data:
      | Account | Test Label (7123)       |
      | Artist  | Wolfgang Amadeus Mozart |
    When I log in
    And I visit Email Campaigns page
    Then I receive email campaigns data from backend
    And I see valid Email Campaigns page with create access
    And I see correct data table on Email Campaigns page
    When I create Email Campaign with data
    Then I see correct email campaign data on Email Overview page
    When I open Edit Design modal
    And I delete Email Campaign privacy block
    Then I see alert about missing privacy block in edit design modal
    When I try to send test email from edit design modal
    Then I see error toast about missing privacy block
    When I save edited email design
    Then I see alert about missing privacy block
    When I try to schedule or send email campaign
    Then I see error toast about missing privacy block
    When I open Edit Design modal
    And I add privacy block to email design
    Then I don't see alert about missing privacy block in edit design modal
    And I save edited email design
    Then I don't see alert about missing privacy block

  @cleanup-created-email-campaign
  @FS-5069
  @id_1cc6074d1ce59eafa02394efa0c40e5f7d3f56156bc88dde7ed9fce571ed4b17
  Scenario: [Email Campaigns] Edit email campaign design
    Given an orchard employee fansifter-set-2-12-ophiuchus for fansifter
    Given I have email campaign data:
      | Account | Test Label (7123)       |
      | Artist  | Wolfgang Amadeus Mozart |
    When I log in
    And I visit Email Campaigns page
    Then I receive email campaigns data from backend
    And I see valid Email Campaigns page with create access
    And I see correct data table on Email Campaigns page
    When I create Email Campaign with data
    Then I see correct email campaign data on Email Overview page
    When I open Edit Design modal
    And I add button to email design
    And I edit button in email design
    And I add text block to email design
    And I edit added text block and make it visible only on mobile device
    And I save edited email design
    Then I can see edited button in Email Campaign preview
    And I can see text block visible only in mobile preview

  @cleanup-created-email-campaign
  @FS-5069
  @id_6aa5fc18f9fca550d4795a3909dbb6cb9f3b5057ba6bef2907cd1bf73294edc6
  Scenario: [Email Campaigns] Edit email campaign design (Stripo v2)
    Given an orchard employee fansifter-e2e-7123-34514 for fansifter
    Given Stripo V2 is enabled
    Given I have email campaign data:
      | Account | Test Label (7123)       |
      | Artist  | Wolfgang Amadeus Mozart |
    When I log in
    And I visit Email Campaigns page
    Then I receive email campaigns data from backend
    And I see valid Email Campaigns page with create access
    And I see correct data table on Email Campaigns page
    When I create Email Campaign with data
    Then I see correct email campaign data on Email Overview page
    When I open Edit Design modal
    And I add button to email design
    And I edit button in email design
    And I add text block to email design
    And I edit added text block and make it visible only on mobile device
    And I save edited email design
    Then I can see edited button in Email Campaign preview
    And I can see text block visible only in mobile preview

  @FS-5149
  @no-silent-login
  @id_2a985b1bcbb0a915c40b1ed7bbbe0c9265c58b9f0736410fb1f66e1463d47abe
  Scenario: [Email Campaigns] Analytics page verification
    Given an orchard employee fansifter-set-2-12-ophiuchus for fansifter
    And I log in
    When I visit Email Campaign Analytics page for campaign "8a4cfe46-f3ba-4d8e-81ae-582d0fa375a8"
    And I receive email campaign analytics data from backend
    Then all elements on email campaign analytics page are present
    And I see correct data on email campaign analytics page

  @cleanup-created-email-campaign
  @id_1a1c2bb5f7efb123714d1e51764e8bd404d55746041d070fdfa0db64924c6f01
  Scenario: Email preview with browser link
    Given an orchard employee fansifter-set-2-12-ophiuchus for fansifter
    Given I have email campaign data:
      | Account | Test Label (7123)       |
      | Artist  | Wolfgang Amadeus Mozart |
    And I have the current timestamp in seconds
    When I log in
    And I visit Email Campaigns page
    Then I receive email campaigns data from backend
    And I see valid Email Campaigns page with create access
    When I create Email Campaign with data
    Then I see correct email campaign data on Email Overview page
    When I open Edit Design modal
    And I add text block to email design
    And I edit added text block with test content
    And I save edited email design
    When I select "View in Browser" test option on email campaign page
    Then I see email preview with correct content
    When I open Edit Design modal
    And I add text block to email design
    And I edit added text block with test content
    And I save edited email design
    When I select "View in Browser" test option on email campaign page
    Then I see email preview with correct content

  @cleanup-created-email-campaign
  @id_e0680908baffcceb7b61b79d881822de89eab50b18feaf1c9531d0f4ea146369
  Scenario: Email preview with browser link (Stripo v2)
    Given an orchard employee fansifter-e2e-7123-34514 for fansifter
    Given Stripo V2 is enabled
    Given I have email campaign data:
      | Account | Test Label (7123)       |
      | Artist  | Wolfgang Amadeus Mozart |
    And I have the current timestamp in seconds
    When I log in
    And I visit Email Campaigns page
    Then I receive email campaigns data from backend
    And I see valid Email Campaigns page with create access
    When I create Email Campaign with data
    Then I see correct email campaign data on Email Overview page
    When I open Edit Design modal
    And I add text block to email design
    And I edit added text block with test content
    And I save edited email design
    When I select "View in Browser" test option on email campaign page
    Then I see email preview with correct content
    When I open Edit Design modal
    And I add text block to email design
    And I edit added text block with test content
    And I save edited email design
    When I select "View in Browser" test option on email campaign page
    Then I see email preview with correct content
