feat: #8612 changed shelving to VnTable & created e2e tests #1432

Merged
provira merged 28 commits from 8612-shelvinge2e into dev 2025-03-05 07:42:35 +00:00
2 changed files with 11 additions and 12 deletions
Showing only changes of commit 3835d7debe - Show all commits

View File

@ -1,7 +1,7 @@
/// <reference types="cypress" />
describe('ShelvingList', () => {
const parking = '.q-card > :nth-child(1) > .q-select > .q-field__inner > .q-field__control > .q-field__control-container';
const parking =
'.q-card > :nth-child(1) > .q-select > .q-field__inner > .q-field__control > .q-field__control-container';
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('developer');
@ -9,16 +9,14 @@ describe('ShelvingList', () => {
});
it('should give an error if the code aldready exists', () => {
cy.dataCy('Code_input').should('exist').clear();
cy.dataCy('Code_input').type('AA7');
cy.dataCy('Code_input').should('exist').clear().type('AA7');
cy.saveCard();
cy.get('.q-notification__message').should('have.text', 'The code already exists');
});
it('should edit the data and save', () => {
cy.selectOption(parking, 'P-01-1');
cy.dataCy('Code_input').clear();
cy.dataCy('Code_input').type('AA1');
cy.dataCy('Priority_input').type('10');
cy.dataCy('Code_input').clear().type('AA1');
cy.dataCy('Priority_input').clear().type('10');
provira marked this conversation as resolved Outdated

Creo que se puede dejar en una sola linea el clear() y type(), es decir, clear().type()
Con esto evitamos volver a leer el selector y ver si hay diferencias.
De cara a la ejecucción, mucho mejor

Creo que se puede dejar en una sola linea el clear() y type(), es decir, clear().type() Con esto evitamos volver a leer el selector y ver si hay diferencias. De cara a la ejecucción, mucho mejor
cy.get(':nth-child(2) > .q-checkbox > .q-checkbox__inner').click();
cy.saveCard();
cy.get('.q-notification__message').should('have.text', 'Data saved');

View File

@ -7,18 +7,18 @@ describe('ShelvingList', () => {
});
it('should redirect on clicking a shelving', () => {
cy.get('#searchbar input').type('{enter}');
cy.typeSearchbar('{enter}');
provira marked this conversation as resolved Outdated

cy.typeSearchbar

cy.typeSearchbar
cy.dataCy('cardBtn').eq(0).click();
cy.get('.summaryHeader > .header > .q-icon').click();
cy.url().should('include', '/shelving/1/summary');
});
it('should redirect from preview to basic-data', () => {
cy.get('#searchbar input').type('{enter}');
cy.typeSearchbar('{enter}');
cy.dataCy('cardBtn').eq(0).click();
cy.get('.q-card > .header').click();
cy.url().should('include', '/shelving/1/basic-data');
})
});
it('should filter and redirect if only one result', () => {
cy.selectOption('[data-cy="Parking_select"]', 'P-02-2');
@ -31,8 +31,9 @@ describe('ShelvingList', () => {
cy.dataCy('code-create-popup').type('Test');
cy.dataCy('Priority_input').type('10');
cy.selectOption(
'.grid-create > .q-select > .q-field__inner > .q-field__control > .q-field__control-container', '100-01'
)
'.grid-create > .q-select > .q-field__inner > .q-field__control > .q-field__control-container',
'100-01',
);
cy.dataCy('FormModelPopup_save').click();
cy.checkNotification('Data created');
cy.url().should('match', /\/shelving\/\d+\/basic-data/);