From 8bc1afee9af68a4310dda1c9dddaaa600216d6e4 Mon Sep 17 00:00:00 2001 From: Michiel Dethmers Date: Sun, 7 Jan 2024 17:07:13 +0000 Subject: [PATCH] behat tests update --- .../newsubscriber.feature | 65 +++++++++++++++---- 1 file changed, 51 insertions(+), 14 deletions(-) diff --git a/tests/features/managing-subscribers/newsubscriber.feature b/tests/features/managing-subscribers/newsubscriber.feature index 08f16eef1..db68bff91 100644 --- a/tests/features/managing-subscribers/newsubscriber.feature +++ b/tests/features/managing-subscribers/newsubscriber.feature @@ -1,17 +1,54 @@ -Feature: Create a new subscriber - In order to create a new subscriber +Feature: Import subscribers + In order to import subscribers As an admin user - I must be able to save a new subscriber's details - - Scenario: Login and create a subscriber + I need to be able to login and import email addresses + //this needs to be extended to search for emails added + + Scenario: Choose import method Given I have logged in as an administrator Given I follow "Subscribers" - Given I follow "Search subscribers" - Given I follow "Add a subscriber" - Then I should see "Email address" - When I fill in "email" with an email address - And I press "change" - Then I should see "subscriber profile" - Then I should see "Add to blacklist" - And I follow "Search subscribers" - Then I should see the email address I entered \ No newline at end of file + Given I follow "Import subscribers" + Then I should see "Please choose one of the import methods below" + And I should see "Copy and paste list of email addresses" + And I should see "Import by uploading a file with email addresses" + And I should see "Import by uploading a CSV file with email addresses and additional data" + When I follow "Copy and paste list of email addresses" + Then I should be on "/lists/admin/?page=importsimple" + Given I go back + When I follow "Import by uploading a file with email addresses" + Then I should be on "/lists/admin/?page=import1" + Given I go back + And I follow "Import by uploading a CSV file with email addresses and additional data" + Then I should be on "/lists/admin/?page=import2" + + Scenario:Import subscribers using copy&paste + Given I have logged in as an administrator + Given I am on "/lists/admin/?page=import" + Given I follow "Copy and paste list of email addresses" + Then I should see "Select the lists to add the emails to" + Given I check "importlists[all]" + And I fill in "importcontent" with "you@domain.com" + When I press "doimport" + Then I should see "Send a campaign" + And I should see "Import some more emails" + + Scenario:Import subscribers by uploading a txt file with emails + Given I have logged in as an administrator + Given I am on "/lists/admin/?page=import" + Given I follow "Import by uploading a file with email addresses" + Then I should see "Select the lists to add the emails to" + Given I check "importlists[all]" + When I attach the file "importFile.txt" to "import_file" + When I press "Import" + Then I should see "There should only be ONE email per line. If the output looks ok, go Back to resubmit for real." + + + Scenario:Import subscribers by uploading a CSV file with emails + Given I have logged in as an administrator + Given I am on "/lists/admin/?page=import" + Given I follow "Import by uploading a CSV file with email addresses and additional data" + Then I should see "Select the lists to add the emails to" + Given I check "lists[all]" + And I attach the file "ImportCSV.csv" to "import_file" + And I press "Import" + Then I should see "Reading emails from file"