feat: refs #8648 enhance roadmapList tests with improved selectors and additional scenarios
gitea/salix-front/pipeline/pr-dev This commit looks good
Details
gitea/salix-front/pipeline/pr-dev This commit looks good
Details
This commit is contained in:
parent
669257e98d
commit
d9b0ed1174
|
@ -1,12 +1,76 @@
|
|||
describe('RoadMap', () => {
|
||||
const getSelector = (colField) =>
|
||||
`tr:last-child > [data-col-field="${colField}"] > .no-padding`;
|
||||
|
||||
const selectors = {
|
||||
roadmap: getSelector('name'),
|
||||
id: getSelector('id'),
|
||||
etd: getSelector('etd'),
|
||||
summaryHeader: '.summaryHeader > :nth-child(2)',
|
||||
summaryGoToSummaryBtn: '.summaryHeader > a > .q-icon',
|
||||
summaryBtn: 'tableAction-0',
|
||||
inputRoadmap: 'Roadmap_input',
|
||||
checkbox: '.q-virtual-scroll__content tr:last-child .q-checkbox',
|
||||
cloneFormBtn: '.q-card__actions > .q-btn--standard',
|
||||
cloneBtn: '#subToolbar > :nth-child(3)',
|
||||
deleteBtn: ':nth-child(4) > .q-btn__content',
|
||||
confirmBtn: 'VnConfirm_confirm',
|
||||
inputEtd: 'ETD_inputDate',
|
||||
};
|
||||
|
||||
const data = {
|
||||
roadmap: 'TEST-ROADMAP',
|
||||
etd: '01/01/2025',
|
||||
};
|
||||
|
||||
const dataCreated = 'Data created';
|
||||
const summaryUrl = '/summary';
|
||||
|
||||
beforeEach(() => {
|
||||
cy.viewport(1920, 1080);
|
||||
cy.login('developer');
|
||||
cy.visit(`/#/route/roadmap`);
|
||||
cy.typeSearchbar('{enter}');
|
||||
});
|
||||
|
||||
it('Should list roadmaps', () => {
|
||||
cy.get('.q-table')
|
||||
.children()
|
||||
.should('be.visible')
|
||||
.should('have.length.greaterThan', 0);
|
||||
});
|
||||
|
||||
it('Route list create roadmap and redirect', () => {
|
||||
cy.addBtnClick();
|
||||
cy.get('input[name="name"]').type('roadMapTestOne{enter}');
|
||||
cy.get('.q-notification__message').should('have.text', 'Data created');
|
||||
cy.url().should('include', '/summary');
|
||||
cy.dataCy(selectors.inputRoadmap).type(`${data.roadmap}{enter}`);
|
||||
cy.checkNotification(dataCreated);
|
||||
cy.url().should('include', summaryUrl);
|
||||
});
|
||||
|
||||
it('open summary', () => {
|
||||
cy.dataCy(selectors.summaryBtn).last().click();
|
||||
cy.get(selectors.summaryHeader).should('contain', data.roadmap);
|
||||
cy.get(selectors.summaryGoToSummaryBtn).click();
|
||||
cy.get(selectors.summaryHeader).should('contain', data.roadmap);
|
||||
});
|
||||
|
||||
it('Should clone selected roadmap with new ETD', () => {
|
||||
cy.get(selectors.checkbox).click();
|
||||
cy.get(selectors.cloneBtn).click();
|
||||
cy.dataCy(selectors.inputEtd).click().type(`${data.etd}{enter}`);
|
||||
cy.get(selectors.cloneFormBtn).click();
|
||||
cy.get(selectors.etd).should('contain', data.etd);
|
||||
});
|
||||
|
||||
it('Should delete selected roadmap', () => {
|
||||
cy.get(selectors.id).then(($el) => {
|
||||
const valor = $el.text();
|
||||
|
||||
cy.get(selectors.checkbox).click();
|
||||
cy.get(selectors.deleteBtn).click();
|
||||
cy.dataCy(selectors.confirmBtn).click();
|
||||
cy.typeSearchbar('{enter}');
|
||||
cy.get(selectors.id).should('not.have.text', valor);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue