Update acceptance test to new import flow

[MAILPOET-1626]
This commit is contained in:
Pavel Dohnal
2019-02-13 13:00:43 +01:00
committed by M. Shull
parent d531cd8678
commit afd97cf246
6 changed files with 24 additions and 10 deletions

View File

@@ -21,6 +21,7 @@ const PreviousNextStepButtons = ({ canGoNext, onPreviousAction, onNextAction })
  
<button
type="button"
data-automation-id="import-next-step"
className={nextStepClasses}
onClick={() => {
if (canGoNext) {

View File

@@ -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>

View File

@@ -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>

View File

@@ -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');

View File

@@ -74,6 +74,7 @@
class="button-primary wysija button"><%= __('Previous step') %> </a>
&nbsp;&nbsp;
<a href="javascript:;" id="next_step"
data-automation-id="import-next-step"
class="button-primary wysija button-disabled"><%= __('Next step') %> </a>
</th>
</tr>

View File

@@ -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>