0
0
Fork 0

ref #6104 refactor e2e tests

This commit is contained in:
Jorge Penadés 2023-10-18 10:18:25 +02:00
parent b29d326797
commit e977467eff
3 changed files with 19 additions and 11 deletions

View File

@ -83,8 +83,6 @@ const value = computed({
@filter="filterHandler"
hide-selected
fill-input
clearable
clear-icon="close"
ref="vnSelectRef"
>
<template v-for="(_, slotName) in $slots" #[slotName]="slotData">

View File

@ -1,23 +1,25 @@
/// <reference types="cypress" />
describe('VnLog', () => {
const chips = [
':nth-child(1) > :nth-child(1) > .q-item__label > .q-chip > .q-chip__content',
':nth-child(2) > :nth-child(1) > .q-item__label > .q-chip > .q-chip__content',
];
beforeEach(() => {
cy.login('developer');
cy.visit(`/#/claim/${1}/log`);
cy.get('.q-gutter-x-sm > .q-btn > .q-btn__content > .q-icon').click();
cy.openRightMenu();
});
it('should filter by insert actions', () => {
cy.get('.q-checkbox__inner').eq(0).click();
cy.checkOption(':nth-child(7) > .q-checkbox');
cy.get('.q-page').click();
cy.get('.model-info .q-chip__content').eq(0).should('have.text', 'Document');
cy.get('.model-info .q-chip__content').eq(1).should('have.text', 'Beginning');
cy.validateContent(chips[0], 'Document');
cy.validateContent(chips[1], 'Beginning');
});
it('should filter by entity', () => {
cy.get('.q-scrollarea .q-list .q-item .q-select').eq(0).click();
cy.get('.q-scrollarea .q-list .q-item .q-select').eq(0).type('cla');
cy.get('.q-virtual-scroll__content .q-item').eq(0).click();
cy.selectOption('.q-drawer--right .q-item > .q-select', 'Claim');
cy.get('.q-page').click();
cy.get('.model-info .q-chip__content').eq(0).should('have.text', 'Claim');
cy.validateContent(chips[0], 'Claim');
});
});

View File

@ -70,7 +70,7 @@ Cypress.Commands.add('selectOption', (selector, option) => {
});
Cypress.Commands.add('checkOption', (selector) => {
cy.wrap(selector).find('.q-checkbox__inner').click();
cy.get(selector).find('.q-checkbox__inner').click();
});
// Global buttons
@ -130,4 +130,12 @@ Cypress.Commands.add('validateRow', (rowSelector, expectedValues) => {
Cypress.Commands.add('openListSummary', (row) => {
cy.get('.card-list-body .actions .q-btn:nth-child(2)').eq(row).click();
});
Cypress.Commands.add('openRightMenu', () => {
cy.get('.q-gutter-x-sm > .q-btn > .q-btn__content > .q-icon').click();
});
Cypress.Commands.add('validateContent', (selector, expectedValue) => {
cy.get(selector).should('have.text', expectedValue);
});
// registerCommands();