Fix createOrder in tests to work with disabled opt-in checkbox

[MAILPOET-3657]
This commit is contained in:
Rostislav Wolny
2021-08-02 17:53:43 +02:00
committed by Veljko V
parent 3cedca311d
commit 7b773e2acb

View File

@@ -436,7 +436,7 @@ class AcceptanceTester extends \Codeception\Actor {
*/
public function optOutOfSubscription() {
$i = $this;
$checked = $i->executeJS('return document.getElementById("mailpoet_woocommerce_checkout_optin").checked');
$checked = $i->executeJS('return document.getElementById("mailpoet_woocommerce_checkout_optin")?.checked');
if ($checked) {
$i->scrollTo(['css' => '[data-automation-id="woo-commerce-subscription-opt-in"]'], 0, -40);
$i->waitForElementClickable('[data-automation-id="woo-commerce-subscription-opt-in"]');