diff --git a/tests/E2E/Checkout/TpayCreditCardCheckoutTest.php b/tests/E2E/Checkout/TpayCreditCardCheckoutTest.php index 85b66e8a..dc8b97b5 100644 --- a/tests/E2E/Checkout/TpayCreditCardCheckoutTest.php +++ b/tests/E2E/Checkout/TpayCreditCardCheckoutTest.php @@ -26,38 +26,26 @@ protected function setUp(): void $this->loadFixtures(['addressed_cart.yaml']); - // the cart is already addressed, so we go straight to selecting a shipping method + $this->loginShopUser('tony@nonexisting.cw', 'sylius'); $this->showSelectingShippingMethodStep(); $this->processWithDefaultShippingMethod(); } public function test_it_completes_the_checkout_using_credit_card(): void { - $this->loginShopUser('tony@nonexisting.cw', 'sylius'); - $this->processWithPaymentMethod('tpay_card'); $this->fillCardData(self::FORM_ID, self::CARD_NUMBER, '123', '01', '2029'); $this->placeOrder(); - $this->assertPageTitleContains('Thank you!'); + $this->assertPageTitleContains('Waiting for payment'); } public function test_it_completes_the_checkout_using_credit_card_and_saves_the_card(): void { - $this->loginShopUser('tony@nonexisting.cw', 'sylius'); - $this->processWithPaymentMethod('tpay_card'); $this->fillCardData(self::FORM_ID, self::CARD_NUMBER, '123', '01', '2029', true); $this->placeOrder(); - $this->assertPageTitleContains('Thank you!'); - } - - public function test_it_forbids_card_saving_for_not_logged_in_users(): void - { - $this->expectException(NoSuchElementException::class); - - $this->processWithPaymentMethod('tpay_card'); - $this->fillCardData(self::FORM_ID, self::CARD_NUMBER, '123', '01', '2029', true); + $this->assertPageTitleContains('Waiting for payment'); } } diff --git a/tests/E2E/Helper/Order/TpayTrait.php b/tests/E2E/Helper/Order/TpayTrait.php index 443ece71..a06e1dde 100644 --- a/tests/E2E/Helper/Order/TpayTrait.php +++ b/tests/E2E/Helper/Order/TpayTrait.php @@ -21,7 +21,7 @@ public function fillCardData(string $formId, string $cardNumber, string $cvv, st $this->client->findElement(WebDriverBy::id(sprintf('%s_tpay_card_expiration_date_year', $formId)))->sendKeys($year); if ($saveCardForLater) { - $this->client->findElement(WebDriverBy::id(sprintf('%s_tpay_saveCreditCardForLater', $formId)))->click(); + $this->client->findElement(WebDriverBy::id(sprintf('%s_tpay_save_credit_card_for_later', $formId)))->sendKeys(true); } }