@fansifter
@automated-emails
Feature: Automated Emails - SMF integration

  @FS-7021
  @id_24685c0d03768f22a872fc99e92ebec065ef473a2c8e66ae0d0bf57cea2dcdc0
  Scenario: TRIGGERED Automated Email is delivered when connected SMF form is submitted
    Given an orchard employee fansifter-e2e-7123-34514 for fansifter
    And Stripo V2 is enabled
    And I have the current timestamp in seconds
    When I log in
    And I visit Automated Emails page
    Then I receive automated emails data from backend
    When I create Automated Email with data:
      | account | Test Label    |
      | artist  | Test Artist 1 |
      | type    | TRIGGERED     |
    When I edit Automated Email Details with unique subject
    And I open Edit Design modal for Automated Email
    And I add text block to Automated Email design
    And I edit added text block with test content for Automated Email
    And I save edited Automated Email design
    And I connect form "AQA FS CRM Customer Survey list & WAV - temporary & Artist 1" to Automated Email
    And I submit SMF form for connected campaign with generated subscriber email
    Then I receive test email with correct subject and content
    When I open Unsubscribe link from the received test email
    Then I land on preference center profile with correct name and country
    When I click "subscriptions" tab in preference-center
    And I unsubscribe from all subscriptions in preference center
    Then I see message that my subscriptions were updated
    And I see that I unsubscribed from all subscriptions
    When I open created Automated Email overview
    And I disconnect all forms from Automated Email
    And I visit Automated Emails page
    And I delete created Automated Email
