Add WooCommerce customers import execution test
[MAILPOET-1732]
This commit is contained in:
committed by
M. Shull
parent
c17da567e4
commit
efbe0b02c7
@@ -193,7 +193,9 @@ const itemActions = [
|
||||
name: 'view_subscribers',
|
||||
link: function link(item) {
|
||||
return (
|
||||
<a href={item.subscribers_url}>{MailPoet.I18n.t('viewSubscribers')}</a>
|
||||
<a href={item.subscribers_url} data-automation-id={`view_subscribers_${item.name}`}>
|
||||
{MailPoet.I18n.t('viewSubscribers')}
|
||||
</a>
|
||||
);
|
||||
},
|
||||
},
|
||||
@@ -240,7 +242,7 @@ class SegmentList extends React.Component {
|
||||
|
||||
return (
|
||||
<div>
|
||||
<td className={rowClasses}>
|
||||
<td className={rowClasses} data-automation-id={`segment_name_${segment.name}`}>
|
||||
<strong>
|
||||
{ segmentName }
|
||||
</strong>
|
||||
|
@@ -50,6 +50,7 @@ class WooCommerceListImportPageCest {
|
||||
$I->seeNoJSErrors();
|
||||
$I->click($submit_button);
|
||||
$I->seeNoJSErrors();
|
||||
$I->waitForElement('[data-automation-id="newsletters_listing_tabs"]');
|
||||
$I->seeInCurrentUrl('wp-admin/admin.php?page=mailpoet-newsletters');
|
||||
}
|
||||
|
||||
@@ -64,4 +65,45 @@ class WooCommerceListImportPageCest {
|
||||
$I->seeInCurrentUrl('wp-admin/admin.php?page=mailpoet-woocommerce-list-import');
|
||||
$this->order_factory->delete($order['id']);
|
||||
}
|
||||
|
||||
function importListPageImportTest(\AcceptanceTester $I) {
|
||||
$settings_factory = new Settings();
|
||||
$settings_factory->withWooCommerceListImportPageDisplayed(false);
|
||||
$order = $this->order_factory->create();
|
||||
$guest_user_data = $order['billing'];
|
||||
$registered_customer = $this->customer_factory->withEmail('customer1@email.com')->create();
|
||||
$I->login();
|
||||
$I->amOnPage('wp-admin/admin.php?page=mailpoet-woocommerce-list-import');
|
||||
$subscribed_radio = '[data-automation-id="import_as_subscribed"]';
|
||||
$submit_button = '[data-automation-id="submit_woo_commerce_list_import"]';
|
||||
$I->selectOption($subscribed_radio, 'subscribed');
|
||||
$I->click($submit_button);
|
||||
$I->seeNoJSErrors();
|
||||
$I->waitForElement('[data-automation-id="newsletters_listing_tabs"]');
|
||||
$I->seeInCurrentUrl('wp-admin/admin.php?page=mailpoet-newsletters');
|
||||
$I->amOnMailpoetPage('Lists');
|
||||
$I->waitForText('WooCommerce Customers');
|
||||
$I->moveMouseOver('[data-automation-id="segment_name_WooCommerce Customers"]');
|
||||
$I->click('[data-automation-id="view_subscribers_WooCommerce Customers"]');
|
||||
$I->waitForListingItemsToLoad();
|
||||
$I->canSee($registered_customer['email']);
|
||||
$I->reloadPage();
|
||||
// It takes more time to sync guest user
|
||||
// So we reload page several times and check for guest customer email
|
||||
for ($i = 0; $i < 15; $i++) {
|
||||
try {
|
||||
$I->wait(1);
|
||||
$I->reloadPage();
|
||||
$I->see($guest_user_data['email']);
|
||||
return;
|
||||
} catch (\PHPUnit_Framework_Exception $e) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
$I->see($guest_user_data['email']);
|
||||
}
|
||||
|
||||
function _after(\AcceptanceTester $I) {
|
||||
$I->deactivateWooCommerce();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user