Cypress initial config and tests #90

Merged
jsegarra merged 26 commits from wbuezas/hedera-web-mindshore:feature/CypressInit into 4922-vueMigration 2024-11-12 12:24:41 +00:00
5 changed files with 12 additions and 12 deletions
Showing only changes of commit f70b98b514 - Show all commits

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');

podemos hacer cy.dataCy(lo que sea).find('input')
Lo he tirado y en verde

podemos hacer cy.dataCy(lo que sea).find('input') Lo he tirado y en verde

Concuerdo con la propuesta, aplicada.

Commmit: f70b98b514

Concuerdo con la propuesta, aplicada. Commmit: https://gitea.verdnatura.es/verdnatura/hedera-web/commit/f70b98b514741336dba895a5900ff45ef6bc68bd
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();

Estas 2 podrian ser candidatas a irse a un comando global

Estas 2 podrian ser candidatas a irse a un comando global

Coincido, aplicado.

Commit: e4bc14ef3b

Coincido, aplicado. Commit: https://gitea.verdnatura.es/verdnatura/hedera-web/commit/e4bc14ef3b7b8eb5f4951088c9b077a8b022363f
};