salix-front/test/cypress/integration/customer/credit-management/clientCreditContracts.spec.js

35 lines
1.2 KiB
JavaScript

/// <reference types="cypress" />
describe('Client credit contracts', () => {
beforeEach(() => {
cy.viewport(1280, 720);
cy.login('developer');
cy.visit('#/customer/1101/credit-management/credit-contracts', {
timeout: 5000,
});
});
it('Should add a new contract and an additional credit', () => {
cy.dataCy('createBtn').click();
cy.dataCy('Credit_input').type(123);
cy.dataCy('Grade_input').type(9);
cy.dataCy('FormModelPopup_save').click();
cy.checkNotification('Data created');
cy.dataCy('createBtn').should('not.exist');
});
it('Should add an additional credit', () => {
cy.dataCy('viewBtn').eq(0).click();
cy.get('.q-page-sticky > div').click();
cy.dataCy('Credit_input').type(321);
cy.dataCy('Grade_input').type(89);
cy.dataCy('FormModelPopup_save').click();
cy.checkNotification('Data created');
});
it('Should close a contract', () => {
cy.dataCy('closeBtn').eq(0).click();
cy.get('.q-btn--unelevated').click();
cy.checkNotification('Data saved');
cy.dataCy('createBtn').should('exist');
});
});