wantTo('Confirm anonymous data settings can be toggled on Advanced Settings Page'); $noAnonymousData = '[data-automation-id="analytics-no"]'; $yesAnonymousData = '[data-automation-id="analytics-yes"]'; $submitButton = '[data-automation-id="settings-submit-button"]'; $successMessage = "Settings saved"; $I->login(); $I->amOnMailPoetPage('Settings'); $I->click('[data-automation-id="settings-advanced-tab"]'); $I->waitForText('Bounce email address'); $I->selectOption($noAnonymousData, 'No'); //save + refresh $I->click($submitButton); $I->waitForText($successMessage); $I->seeOptionIsSelected($noAnonymousData, 'No'); //repeat for Yes $I->selectOption($yesAnonymousData, 'Yes'); $I->click($submitButton); $I->waitForText($successMessage); $I->seeOptionIsSelected($yesAnonymousData, 'Yes'); } function addBounceEmailAddress(\AcceptanceTester $I) { $I->wantTo('Add a bounce email address on Advanced Settings page'); $bounceAddressField = '[data-automation-id="bounce-address-field"]'; $bounceAddressText = 'bounce@bounce.bounce'; $submitButton = '[data-automation-id="settings-submit-button"]'; $successMessage = "Settings saved"; $I->login(); $I->amOnMailPoetPage('Settings'); $I->click('[data-automation-id="settings-advanced-tab"]'); $I->waitForElement($bounceAddressField); $I->fillField($bounceAddressField, $bounceAddressText); $I->click($submitButton); $I->waitForText($successMessage); $I->waitForElement($bounceAddressField); //check System Info to make sure the value changed in db $I->amOnMailPoetPage('Help'); $I->waitForText('Knowledge Base'); $I->click('System Info'); $I->waitForText('The information below is useful'); $I->waitForText($bounceAddressText); } function toggleTaskScheduler(\AcceptanceTester $I) { $I->wantTo('Toggle the newsletter task schedule between cron options'); $chooseWordPressCron = '[data-automation-id="wordress_cron_radio"]'; $chooseMailPoetCron = '[data-automation-id="mailpoet_cron_radio"]'; $chooseLinuxCron = '[data-automation-id="linux_cron_radio"]'; $systemInfoWordPressCron = "Task Scheduler method: WordPress"; $systemInfoMailPoetCron = "Task Scheduler method: MailPoet"; $systemInfoLinuxCron = "Task Scheduler method: Linux Cron"; $bounceAddressField = '[data-automation-id="bounce-address-field"]'; $submitButton = '[data-automation-id="settings-submit-button"]'; $successMessage = "Settings saved"; //switch to MailPoet cron $I->login(); $I->amOnMailPoetPage('Settings'); $I->click('[data-automation-id="settings-advanced-tab"]'); $I->waitForElement($bounceAddressField); $I->click($chooseMailPoetCron); $I->click($submitButton); $I->waitForText($successMessage); $I->waitForElement($bounceAddressField); //check System Info to make sure the value changed $I->amOnMailPoetPage('Help'); $I->waitForText('Knowledge Base'); $I->click('System Info'); $I->waitForText('The information below is useful'); $I->waitForText($systemInfoMailPoetCron); //switch to linux cron $I->amOnMailPoetPage('Settings'); $I->click('[data-automation-id="settings-advanced-tab"]'); $I->waitForElement($bounceAddressField); $I->click($chooseLinuxCron); $I->click($submitButton); $I->waitForText($successMessage); $I->waitForElement($bounceAddressField); //check System Info to make sure the value changed $I->amOnMailPoetPage('Help'); $I->waitForText('Knowledge Base'); $I->click('System Info'); $I->waitForText('The information below is useful'); $I->waitForText($systemInfoLinuxCron); //switch to default cron $I->amOnMailPoetPage('Settings'); $I->click('[data-automation-id="settings-advanced-tab"]'); $I->waitForElement($bounceAddressField); $I->click($chooseWordPressCron); $I->click($submitButton); $I->waitForText($successMessage); $I->waitForElement($bounceAddressField); //check System Info to make sure the value changed $I->amOnMailPoetPage('Help'); $I->waitForText('Knowledge Base'); $I->click('System Info'); $I->waitForText('The information below is useful'); $I->waitForText($systemInfoWordPressCron); } }