0
1
Fork 0

Apply find input in dataCy

This commit is contained in:
William Buezas 2024-11-04 10:47:30 -03:00
parent 22153c5171
commit f70b98b514
5 changed files with 12 additions and 12 deletions

View File

@ -15,7 +15,7 @@ describe('NewsView', () => {
it('search for an item', () => {
cy.dataCy('searchBar').should('exist');
cy.get('input[data-testid="searchBar"]').type('Bolas de madera{enter}');
cy.dataCy('searchBar').find('input').type('Bolas de madera{enter}');
cy.dataCy('itemsViewList').should(
'not.contain',
'Introduce un término de búsqueda'

View File

@ -27,11 +27,11 @@ describe('NewsView', () => {
cy.dataCy('formDefaultSaveButton').should('exist');
cy.dataCy('formDefaultSaveButton').should('be.disabled');
cy.dataCy('newsTitleInput').should('exist');
cy.get('input[data-testid="newsTitleInput"]').type('Test new');
cy.dataCy('newsTitleInput').find('input').type('Test new');
cy.dataCy('newsTagSelect').should('exist');
cy.selectOption('[data-testid="newsTagSelect"]', 'Curso');
cy.dataCy('newsPriorityInput').should('exist');
cy.get('input[data-testid="newsPriorityInput"]').type('2');
cy.dataCy('newsPriorityInput').find('input').type('2');
cy.dataCy('formDefaultSaveButton').should('not.be.disabled');
cy.dataCy('formDefaultSaveButton').click();
cy.checkNotify('positive', 'Datos guardados');

View File

@ -1,6 +1,6 @@
Cypress.Commands.add('userViewSupplant', user => {
cy.dataCy('usersViewSearchBar').should('exist');
cy.get('input[data-testid="usersViewSearchBar"]').type(`${user}{enter}`);
cy.dataCy('usersViewSearchBar').find('input').type(`${user}{enter}`);
cy.dataCy('layoutSupplantedUserName').should('not.exist');
cy.dataCy('usersViewList').should('not.contain', 'Sin datos');
cy.dataCy('userViewCard').should('exist');

View File

@ -1,12 +1,12 @@
Cypress.Commands.add('changeUserNickname', (oldNickname, newNickname) => {
const nicknameInput = 'input[data-testid="configViewNickname"]';
cy.get(nicknameInput).should('exist');
cy.dataCy('configViewNickname').find('input').should('exist');
cy.getValue('input[data-testid="configViewNickname"]').should(
'equal',
oldNickname
);
cy.get(nicknameInput).clear();
cy.get(nicknameInput).type(newNickname);
cy.get(nicknameInput).blur();
cy.dataCy('configViewNickname').find('input').clear();
cy.dataCy('configViewNickname').find('input').type(newNickname);
cy.dataCy('configViewNickname').find('input').blur();
cy.checkNotify('positive', 'Datos guardados');
});

View File

@ -8,10 +8,10 @@ describe('PendingOrders', () => {
cy.dataCy('makePaymentButton').should('exist');
cy.dataCy('makePaymentButton').click();
cy.dataCy('payAmountDialog').should('exist');
cy.get('input[data-testid="payAmountInput"]').should('exist');
cy.get('input[data-testid="payAmountInput"]').clear();
cy.dataCy('payAmountInput').find('input').should('exist');
cy.dataCy('payAmountInput').find('input').clear();
if (typeAmount || typeAmount === 0)
cy.get('input[data-testid="payAmountInput"]').type(typeAmount);
cy.dataCy('payAmountInput').find('input').type(typeAmount);
cy.setConfirmDialog();
};