On the Frontend, we use the Cypress framework for E2E testing. This tool lets developers write various tests, including E2E, component, integration, and unit tests. With Cypress, we can see each action taken by our tests in the console and use developer tools to debug more effectively. It also allows us to test across multiple browsers like Electron, Chrome, Firefox, and Edge, as well as check and manage functions, server responses, timers, and more.
Installation: npm install --save-dev cypress
Example:
describe('Todos Tests', () => {
it('adds todos', () => {
cy.visit('https://example.cypress.io/')
cy.get('[data-testid="new-todo"]')
.type('write code{enter}')
.type('write tests{enter}')
cy.get('[data-testid="todos"]').should('have.length', 2)
})
})
Running the cypress interface: npx cypress open
The platform currently features 101 tests covering filters, lists, links, modals, notifications, and entity processes such as creation, blocking, unlocking, and deletion. It also includes invoice processes like decline, rejection, and approval, along with configuration forms. These tests are organized as follows:
Lender console:
Invoice section: 10 tests
Configuration section: 3 tests
Buyers section: 7 tests
Commissions section: 7 tests
Providers section: 4 tests
Transactions section: 12 tests
Provider console:
Buyers section: 1 test
Invoice section: 13 tests
Transactions section: 4 tests
Buyer console:
Invoice section: 10 tests
Transactions section: 4 tests
Lend2b console
Invoice section: 7 tests
Transactions section: 11 tests
Commissions section: 5 tests
Configuration section: 3 tests