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