salix-front/test/cypress/integration/VnLocation.spec.js

57 lines
2.4 KiB
JavaScript
Raw Normal View History

const locationOptions = '[role="listbox"] > div.q-virtual-scroll__content > .q-item';
2024-01-24 07:30:09 +00:00
describe('VnLocation', () => {
2024-04-23 06:40:30 +00:00
const dialogInputs = '.q-dialog label input';
2024-05-14 09:11:28 +00:00
describe('Worker Create', () => {
2024-06-18 08:37:49 +00:00
const inputLocation = '.q-form input[aria-label="Location"]';
2024-02-02 13:52:19 +00:00
beforeEach(() => {
cy.viewport(1280, 720);
cy.login('developer');
2024-05-14 09:11:28 +00:00
cy.visit('/#/worker/create', { timeout: 5000 });
2024-02-02 13:52:19 +00:00
cy.waitForElement('.q-card');
});
it('Show all options', function () {
cy.get(inputLocation).click();
cy.get(locationOptions).should('have.length.at.least', 5);
2024-02-02 13:52:19 +00:00
});
it('input filter location as "al"', function () {
2024-02-02 13:52:19 +00:00
cy.get(inputLocation).click();
cy.get(inputLocation).clear();
cy.get(inputLocation).type('al');
cy.get(locationOptions).should('have.length.at.least', 3);
2024-02-02 13:52:19 +00:00
});
it('input filter location as "ecuador"', function () {
2024-02-02 13:52:19 +00:00
cy.get(inputLocation).click();
cy.get(inputLocation).clear();
cy.get(inputLocation).type('ecuador');
cy.get(locationOptions).should('have.length.at.least', 1);
2024-02-02 13:52:19 +00:00
});
});
describe('Fiscal-data', () => {
2024-02-02 13:41:59 +00:00
beforeEach(() => {
cy.viewport(1280, 720);
cy.login('developer');
2024-05-14 09:42:34 +00:00
cy.visit('/#/supplier/567/fiscal-data', { timeout: 7000 });
cy.waitForElement('.q-form');
2024-02-02 13:41:59 +00:00
});
it('Create postCode', function () {
2024-06-18 08:37:49 +00:00
cy.get('.q-form > .q-card > .vn-row:nth-child(6) .--add-icon').click();
2024-04-23 06:40:30 +00:00
cy.get('.q-card > h1').should('have.text', 'New postcode');
cy.get(dialogInputs).eq(0).clear('12');
cy.get(dialogInputs).eq(0).type('1234453');
cy.selectOption(
2024-05-14 09:42:34 +00:00
'.q-dialog__inner > .column > #formModel > .q-card > :nth-child(4) > .q-select > .q-field__inner > .q-field__control ',
'Valencia'
);
cy.selectOption(
2024-05-14 09:42:34 +00:00
'.q-dialog__inner > .column > #formModel > .q-card > :nth-child(5) > .q-select > .q-field__inner > .q-field__control ',
'Province one'
);
cy.selectOption(
2024-05-14 09:42:34 +00:00
'.q-dialog__inner > .column > #formModel > .q-card > :nth-child(6) > .q-select > .q-field__inner > .q-field__control ',
'España'
);
cy.get('.q-mt-lg > .q-btn--standard').click();
2024-02-02 13:41:59 +00:00
});
2024-01-24 07:30:09 +00:00
});
});