Files
piratepoet/tests/acceptance/WooCommerceCustomerListCest.php
Jan Jakeš e8c1ccb918 Remove unnecessary cleanups in tests
[MAILPOET-2276]
2019-08-20 09:18:23 +01:00

36 lines
1.2 KiB
PHP

<?php
namespace MailPoet\Test\Acceptance;
use MailPoet\Test\DataFactories\Settings;
use MailPoet\Test\DataFactories\WooCommerceCustomer;
use MailPoet\Test\DataFactories\WooCommerceProduct;
class WooCommerceCustomerListCest {
/** @var WooCommerceProduct */
private $product_factory;
function _before(\AcceptanceTester $I) {
$I->activateWooCommerce();
$this->product_factory = new WooCommerceProduct($I);
$settings_factory = new Settings();
$settings_factory->withWooCommerceListImportPageDisplayed(true);
$settings_factory->withWooCommerceCheckoutOptinEnabled();
$settings_factory->withCookieRevenueTrackingDisabled();
}
function newCustomerIsAddedToListTest(\AcceptanceTester $I) {
$customer_email = 'wc_customer@example.com';
$product = $this->product_factory->create();
$I->orderProduct($product, $customer_email);
$I->login();
$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->waitForText($customer_email);
}
}