-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
296a5a2
commit a0d9426
Showing
5 changed files
with
1,425 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
Test/End-2-end/cypress/e2e/magento/api/rest-place-order.cy.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* | ||
* Copyright Magmodules.eu. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
import Cookies from "Services/Cookies"; | ||
import MollieHostedPaymentPage from "Pages/mollie/MollieHostedPaymentPage"; | ||
import CheckoutSuccessPage from "Pages/frontend/CheckoutSuccessPage"; | ||
import OrdersPage from "Pages/backend/OrdersPage"; | ||
|
||
const cookies = new Cookies(); | ||
const mollieHostedPaymentPage = new MollieHostedPaymentPage(); | ||
const checkoutSuccessPage = new CheckoutSuccessPage(); | ||
const ordersPage = new OrdersPage(); | ||
|
||
describe('Check that the headless REST endpoints work as expected', () => { | ||
it('C1988313: Validate that an order can be placed through REST', () => { | ||
cy.visit('opt/mollie-pwa-rest.html'); | ||
|
||
cy.get('[data-key="start-checkout-process"]').click(); | ||
|
||
cy.get('[data-key="mollie_methods_ideal"]').click(); | ||
|
||
cy.get('[data-key="place-order-action"]').click(); | ||
|
||
cy.get('[data-key="order-id"]').then((element) => { | ||
cy.wrap(element.text()).as('order-id'); | ||
}); | ||
|
||
cookies.disableSameSiteCookieRestrictions(); | ||
|
||
cy.get('[data-key="redirect-url"]').then((element) => { | ||
cy.visit(element.attr('href')); | ||
}); | ||
|
||
mollieHostedPaymentPage.selectFirstIssuer(); | ||
mollieHostedPaymentPage.selectStatus('paid'); | ||
|
||
checkoutSuccessPage.assertThatOrderSuccessPageIsShown(); | ||
|
||
cy.backendLogin(false); | ||
|
||
cy.get('@order-id').then((orderId) => { | ||
ordersPage.openOrderById(orderId); | ||
}); | ||
|
||
ordersPage.assertOrderStatusIs('Processing'); | ||
}); | ||
}) |
Oops, something went wrong.