|
| 1 | +describe('GX-32081-✅-tools-qa-elements-text-box-fill-form-and-submit', () => { |
| 2 | + beforeEach('Visitar la pagina DemoQA', () => { |
| 3 | + cy.visit('/text-box'); |
| 4 | + }); |
| 5 | + //todo: Forma 1 |
| 6 | + it('32082 | TC1: Validar resultado después de completar formulario con datos validos', () => { |
| 7 | + //todo: Completar formularios |
| 8 | + textBoxPage.fillUserNameInput(data.valid.userName); |
| 9 | + textBoxPage.fillEmailInput(data.valid.userEmail); |
| 10 | + textBoxPage.fillCurrentAddressInput(data.valid.userCurrentAddress); |
| 11 | + textBoxPage.fillPermanentAddressInput(data.valid.userPermanentAddress); |
| 12 | + textBoxPage.clickOnSubmitButton(); |
| 13 | + //todo: Validaciones |
| 14 | + textBoxPage.get.nameResult().should('contain', data.valid.userName); |
| 15 | + textBoxPage.get.emailResult().should('contain', data.valid.userEmail); |
| 16 | + textBoxPage.get.currentAddressResult().should('contain', data.valid.userCurrentAddress); |
| 17 | + textBoxPage.get.permanentAddressResult().should('contain', data.valid.userPermanentAddress); |
| 18 | + }); |
| 19 | + //todo: Forma 2 |
| 20 | + it('32082 | TC1: Validar resultado después de completar formulario con datos validos', () => { |
| 21 | + textBoxPage.completeForm({ |
| 22 | + userName: data.valid.userName, |
| 23 | + email: data.valid.userEmail, |
| 24 | + currentAddress: data.valid.userCurrentAddress, |
| 25 | + permanentAddress: data.valid.userPermanentAddress, |
| 26 | + }); |
| 27 | + //todo: Validaciones |
| 28 | + textBoxPage.get.nameResult().should('contain', data.valid.userName); |
| 29 | + textBoxPage.get.emailResult().should('contain', data.valid.userEmail); |
| 30 | + textBoxPage.get.currentAddressResult().should('contain', data.valid.userCurrentAddress); |
| 31 | + textBoxPage.get.permanentAddressResult().should('contain', data.valid.userPermanentAddress); |
| 32 | + }); |
| 33 | + it('32082 | TC2: Validar No genere resultado después de completar “Input email” con datos inválidos', () => { |
| 34 | + data.invalid.forEach(invalidData => { |
| 35 | + textBoxPage.fillEmailInput(invalidData.email); |
| 36 | + textBoxPage.clickOnSubmitButton(); |
| 37 | + //todo: validaciones |
| 38 | + textBoxPage.get.emailResult().should('not.exist'); |
| 39 | + textBoxPage.get.inputEmail().should('have.css', 'border', '1px solid rgb(255, 0, 0)'); |
| 40 | + textBoxPage.clearEmailInput(); |
| 41 | + }); |
| 42 | + }); |
| 43 | +}); |
| 44 | +import data from '../../../fixtures/data/GX-32081-textBoxLeonardo.json'; |
| 45 | +import { textBoxPage } from '@pages/Elements/GX-32081-textBoxLeonardo.Page'; |
| 46 | +import { removeLogs } from '@helper/RemoveLogs'; |
| 47 | +removeLogs(); |
0 commit comments