Try with reordering tests

This commit is contained in:
Veljko
2024-03-06 19:09:58 +01:00
committed by Jan Jakeš
parent 8647abe1e4
commit 3a87c7d0c8

View File

@@ -39,6 +39,18 @@ class WooCheckoutAutomateWooSubscriptionsCest {
$i->logout();
}
public function checkoutOptInChecked(\AcceptanceTester $i, $scenario) {
$this->settingsFactory->withWooCommerceCheckoutOptinEnabled();
$this->settingsFactory->withConfirmationEmailEnabled();
$customerEmail = 'woo_guest_check@example.com';
$i->orderProductWithRegistration($this->product, $customerEmail, true);
$i->login();
$i->checkSubscriberStatusAndLists($customerEmail, SubscriberEntity::STATUS_UNCONFIRMED, ['WooCommerce Customers']);
$i->amOnPage('/wp-admin/admin.php?page=automatewoo-opt-ins');
$i->see($customerEmail, '.automatewoo-content');
$i->seeConfirmationEmailWasReceived();
}
public function checkoutOptInDisabled(\AcceptanceTester $i) {
$this->settingsFactory->withWooCommerceCheckoutOptinDisabled();
$i->addProductToCart($this->product);
@@ -47,14 +59,6 @@ class WooCheckoutAutomateWooSubscriptionsCest {
$i->dontSee(self::MAILPOET_OPTIN_TEXT);
}
public function checkoutOptInEnabled(\AcceptanceTester $i, $scenario) {
$this->settingsFactory->withWooCommerceCheckoutOptinEnabled();
$i->addProductToCart($this->product);
$i->goToCheckout();
$i->waitForText(self::MAILPOET_OPTIN_TEXT, 10);
$i->dontSee(self::AUTOMATE_WOO_OPTIN_TEXT);
}
public function checkoutOptInUnchecked(\AcceptanceTester $i) {
$this->settingsFactory->withWooCommerceCheckoutOptinEnabled();
$this->settingsFactory->withConfirmationEmailEnabled();
@@ -67,16 +71,11 @@ class WooCheckoutAutomateWooSubscriptionsCest {
$i->seeConfirmationEmailWasNotReceived();
}
public function checkoutOptInChecked(\AcceptanceTester $i, $scenario) {
public function checkoutOptInEnabled(\AcceptanceTester $i, $scenario) {
$this->settingsFactory->withWooCommerceCheckoutOptinEnabled();
$this->settingsFactory->withConfirmationEmailEnabled();
$customerEmail = 'woo_guest_check@example.com';
$i->addProductToCart($this->product); // to avoid flaky adding to cart from below
$i->orderProductWithRegistration($this->product, $customerEmail, true);
$i->login();
$i->checkSubscriberStatusAndLists($customerEmail, SubscriberEntity::STATUS_UNCONFIRMED, ['WooCommerce Customers']);
$i->amOnPage('/wp-admin/admin.php?page=automatewoo-opt-ins');
$i->see($customerEmail, '.automatewoo-content');
$i->seeConfirmationEmailWasReceived();
$i->addProductToCart($this->product);
$i->goToCheckout();
$i->waitForText(self::MAILPOET_OPTIN_TEXT, 10);
$i->dontSee(self::AUTOMATE_WOO_OPTIN_TEXT);
}
}