-
Notifications
You must be signed in to change notification settings - Fork 0
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
96d174a
commit ee27c45
Showing
8 changed files
with
450 additions
and
28 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
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,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 | ||
); | ||
}); | ||
}); |
Oops, something went wrong.