Update acceptance test to new import flow
[MAILPOET-1626]
This commit is contained in:
@@ -21,6 +21,7 @@ const PreviousNextStepButtons = ({ canGoNext, onPreviousAction, onNextAction })
|
||||
|
||||
<button
|
||||
type="button"
|
||||
data-automation-id="import-next-step"
|
||||
className={nextStepClasses}
|
||||
onClick={() => {
|
||||
if (canGoNext) {
|
||||
|
@@ -64,6 +64,7 @@ class StepInputValidation extends Component {
|
||||
onChange={e => this.setState({ subscribersAgreed: e.target.checked })}
|
||||
name="subscribers_agreed"
|
||||
id="subscribers_agreed"
|
||||
data-automation-id="subscribers_agreed"
|
||||
/>
|
||||
{MailPoet.I18n.t('subscribersAgreed')}
|
||||
</label>
|
||||
@@ -85,6 +86,7 @@ class StepInputValidation extends Component {
|
||||
onChange={e => this.setState({ sentOnceLastYear: e.target.checked })}
|
||||
name="sent_once_last_year"
|
||||
id="sent_once_last_year"
|
||||
data-automation-id="sent_once_last_year"
|
||||
/>
|
||||
{MailPoet.I18n.t('sentOnceYear')}
|
||||
</label>
|
||||
@@ -101,6 +103,7 @@ class StepInputValidation extends Component {
|
||||
onChange={e => this.setState({ understand: e.target.checked })}
|
||||
name="understand"
|
||||
id="understand"
|
||||
data-automation-id="input_understand"
|
||||
/>
|
||||
{MailPoet.I18n.t('youUnderstand')}
|
||||
</label>
|
||||
|
@@ -356,6 +356,7 @@ class SubscriberList extends React.Component {
|
||||
<a
|
||||
className="page-title-action"
|
||||
href="?page=mailpoet-import"
|
||||
data-automation-id="import-subscribers-button"
|
||||
>
|
||||
{MailPoet.I18n.t('import')}
|
||||
</a>
|
||||
|
@@ -10,18 +10,25 @@ class SubscriberManageImportExportCest {
|
||||
$I->login();
|
||||
$I->amOnMailPoetPage ('Subscribers');
|
||||
//click import
|
||||
$I->click(['xpath'=>'//*[@id="subscribers_container"]/div/h1/a[2]']);
|
||||
$I->click('[data-automation-id="import-subscribers-button"]');
|
||||
$I->waitForText('Back to Subscribers');
|
||||
//select upload file as import method, import CSV
|
||||
$I->click(['css'=>'#select_method > label:nth-of-type(2)']);
|
||||
$I->attachFile(['css'=>'#file_local'], 'MailPoetImportList.csv');
|
||||
$I->click(['xpath'=>'//*[@id="method_file"]/div/table/tbody/tr[2]/th/a']);
|
||||
$I->click('[data-automation-id="import-csv-method"]');
|
||||
$I->attachFile('[data-automation-id="import-file-upload-input"]', 'MailPoetImportList.csv');
|
||||
$I->click('#method_file [data-automation-id="import-next-step"]');
|
||||
|
||||
// input validation step
|
||||
$I->click('[data-automation-id="subscribers_agreed"]');
|
||||
$I->click('[data-automation-id="sent_once_last_year"]');
|
||||
$I->click('[data-automation-id="input_understand"]');
|
||||
$I->click('#step_input_validation [data-automation-id="import-next-step"]');
|
||||
|
||||
//click is to trigger dropdown to display selections
|
||||
$I->click('input.select2-search__field');
|
||||
//choose My First List
|
||||
$I->click(['xpath'=>'//*[@id="select2-mailpoet_segments_select-results"]/li[2]']);
|
||||
//click next step
|
||||
$I->click(['xpath'=>'//*[@id="step2_process"]']);
|
||||
$I->click('#step_data_manipulation [data-automation-id="import-next-step"]');
|
||||
|
||||
$I->waitForText('Import again');
|
||||
//confirm subscribers from import list were added
|
||||
$I->amOnMailPoetPage ('Subscribers');
|
||||
|
@@ -74,6 +74,7 @@
|
||||
class="button-primary wysija button"><%= __('Previous step') %> </a>
|
||||
|
||||
<a href="javascript:;" id="next_step"
|
||||
data-automation-id="import-next-step"
|
||||
class="button-primary wysija button-disabled"><%= __('Next step') %> </a>
|
||||
</th>
|
||||
</tr>
|
||||
|
@@ -10,11 +10,11 @@
|
||||
<td>
|
||||
<div id="select_method">
|
||||
<label>
|
||||
<input type="radio" name="select_method"><span><%= __('Paste the data into a text box') %></span>
|
||||
<input type="radio" name="select_method" data-automation-id="import-paste-method"><span><%= __('Paste the data into a text box') %></span>
|
||||
</label> <label>
|
||||
<input type="radio" name="select_method"><span><%= __('Upload a file') %></span>
|
||||
<input type="radio" name="select_method" data-automation-id="import-csv-method"><span><%= __('Upload a file') %></span>
|
||||
</label> <label>
|
||||
<input type="radio" name="select_method"><span><%= __('Import from MailChimp') %></php></span>
|
||||
<input type="radio" name="select_method" data-automation-id="import-mailchimp-method"><span><%= __('Import from MailChimp') %></php></span>
|
||||
</label>
|
||||
</div>
|
||||
</td>
|
||||
@@ -64,7 +64,7 @@
|
||||
</label>
|
||||
</th>
|
||||
<td>
|
||||
<input type="file" id="file_local" accept=".csv" />
|
||||
<input type="file" id="file_local" accept=".csv" data-automation-id="import-file-upload-input" />
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@@ -114,6 +114,7 @@
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<a href="javascript:;"
|
||||
data-automation-id="import-next-step"
|
||||
class="button-primary button-disabled wysija mailpoet_process"><%= __('Next step') %> </a>
|
||||
</th>
|
||||
</tr>
|
||||
|
Reference in New Issue
Block a user