Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/mol 439/pict 253 #76

Merged
merged 7 commits into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions application/cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export default defineConfig({
LOGIN_PASSWORD: process.env.CYPRESS_LOGIN_PASSWORD,
PROJECT_KEY: process.env.CYPRESS_PROJECT_KEY,
PACKAGE_NAME: process.env.CYPRESS_PACKAGE_NAME,
LOCALE: process.env.CYPRESS_LOCALE || 'en-GB',
},
};
},
Expand Down
3 changes: 2 additions & 1 deletion application/cypress/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ CYPRESS_LOGIN_USER=<your-user>
CYPRESS_LOGIN_PASSWORD=<your-password>
CYPRESS_PROJECT_KEY=<your-project-key>
CYPRESS_PACKAGE_NAME="application"
CYPRESS_BASE_URL="https://mc.europe-west1.gcp.commercetools.com/"
CYPRESS_BASE_URL="https://mc.europe-west1.gcp.commercetools.com/"
CYPRESS_LOCALE="en-GB"
60 changes: 60 additions & 0 deletions application/cypress/e2e/method-details.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/// <reference types="cypress" />
/// <reference types="@testing-library/cypress" />
/// <reference types="@commercetools-frontend/cypress" />

import {
entryPointUriPath,
APPLICATION_BASE_ROUTE,
} from '../support/constants';
beforeEach(() => {
cy.loginToMerchantCenter({
entryPointUriPath,
initialRoute: APPLICATION_BASE_ROUTE,
});

cy.fixture('forward-to').then((response) => {
cy.intercept('GET', '/proxy/forward-to', {
statusCode: 200,
body: response,
});
});
});

describe('Test welcome.cy.ts', () => {
it('should render method details page', () => {
const LOCALE = Cypress.env('LOCALE');
const paymentMethods = [
'PayPal',
'iDEAL Pay in 3 instalments, 0% interest',
'iDEAL',
'Bancontact',
'Blik',
];

cy.findByText(paymentMethods[0]).click();
cy.url().should('contain', 'general');

cy.findByTestId('status-select').should('exist');

cy.findByTestId(`name-input-${LOCALE}`).should('exist');
cy.findByTestId(`description-input-${LOCALE}`).should('exist');
cy.findByTestId(`display-order-input`).should('exist');
});

it('should update display order successfully', () => {
const paymentMethodIds = ['paypal', 'ideal', 'bancontact'];

cy.findByTestId(`display-order-column-${paymentMethodIds[0]}`).click();
cy.url().should('contain', 'general');

cy.findByTestId(`display-order-input`).should('exist');
cy.findByTestId(`display-order-input`).clear();
cy.findByTestId(`display-order-input`).type('20');
cy.findByTestId(`save-button`).click();
cy.findByLabelText('Go back').click();
cy.findByTestId(`display-order-column-${paymentMethodIds[0]}`).should(
'have.text',
20
);
});
});
Loading