|
| 1 | +describe(' GX-24109 | ✅ToolsQA | Elements | Text Box: Fill form and Submit', () => { |
| 2 | + beforeEach('PRC: Ingresar a la página', () => { |
| 3 | + cy.visit('/text-box'); |
| 4 | + }); |
| 5 | + |
| 6 | + it('GX-24109 | TC1: Validar el funcionamiento del formulario al completarlo con datos correctos.', () => { |
| 7 | + cy.fixture('data/GX-24109-TextBoxForm').then(the => { |
| 8 | + cy.get(the.FullName.input).type(the.FullName.data.valid); //campo nombre completo lleno |
| 9 | + cy.get(the.FullName.input).should('have.value', the.FullName.data.valid); |
| 10 | + cy.get(the.CurrentAddress.input).type(the.CurrentAddress.data.valid); //campo direccion actual lleno |
| 11 | + cy.get(the.CurrentAddress.input).should('have.value', the.CurrentAddress.data.valid); |
| 12 | + cy.get(the.PermanentAddress.input).type(the.PermanentAddress.data.valid); //campo permanente actual lleno |
| 13 | + cy.get(the.PermanentAddress.input).should('have.value', the.PermanentAddress.data.valid); |
| 14 | + cy.get(the.SubmitButton).click(); //click en boton |
| 15 | + cy.get('#name').should('have.text', 'Name:NataliaPedraza'); |
| 16 | + cy.get('#currentAddress').should('have.value', the.CurrentAddress.data.valid); |
| 17 | + cy.get('#permanentAddress').should('have.value', the.PermanentAddress.data.valid); |
| 18 | + }); |
| 19 | + }); |
| 20 | + |
| 21 | + it('GX-24109 |TC2: Validar el no funcionamiento del formulario al quedar sus campos vacíos.', () => { |
| 22 | + cy.fixture('data/GX-24109-TextBoxForm').then(the => { |
| 23 | + cy.get(the.FullName.input).should('be.empty'); //campo nombre completo vacio |
| 24 | + cy.get(the.CurrentAddress.input).should('be.empty'); //campo direccion actual vacio |
| 25 | + cy.get(the.PermanentAddress.input).should('be.empty'); //campo permanente actual vacio |
| 26 | + cy.get(the.SubmitButton).click(); //click en boton |
| 27 | + }); |
| 28 | + }); |
| 29 | + |
| 30 | + it('GX-24109 | TC3: Validar el funcionamiento del campo del correo electrónico. ', () => { |
| 31 | + cy.fixture('data/GX-24109-TextBoxForm').then(the => { |
| 32 | + cy.get(the.Email.input).type(the.Email.data.valid); //campo email valido |
| 33 | + cy.get(the.Email.input).should('have.value', the.Email.data.valid); |
| 34 | + cy.get(the.SubmitButton).click(); //click en boton |
| 35 | + cy.get('#email').should('have.text', 'Email:[email protected]'); |
| 36 | + }); |
| 37 | + }); |
| 38 | + |
| 39 | + it('GX-24109 | TC4: Validar el no funcionamiento del input correo electrónico si el mismo no tiene @.', () => { |
| 40 | + cy.fixture('data/GX-24109-TextBoxForm').then(the => { |
| 41 | + cy.get(the.Email.input).type(the.Email.data.invalid1); //no contiene @. |
| 42 | + cy.get(the.Email.input).should('have.value', the.Email.data.invalid1); |
| 43 | + cy.get(the.SubmitButton).click(); //click en boton |
| 44 | + cy.get(the.Email.input).should('have.css', 'border-color', 'rgb(255, 0, 0)'); |
| 45 | + cy.get(the.Email.input).should('have.class', 'field-error'); |
| 46 | + }); |
| 47 | + }); |
| 48 | + |
| 49 | + it('GX-24109 | TC5: Validar el no funcionamiento del input correo electrónico si el mismo no tiene (mínimo) 1 carácter alfanumérico antes de “@” .', () => { |
| 50 | + cy.fixture('data/GX-24109-TextBoxForm').then(the => { |
| 51 | + cy.get(the.Email.input).type(the.Email.data.invalid2); //no contiene (mínimo) 1 carácter alfanumérico antes de “@” . |
| 52 | + cy.get(the.Email.input).should('have.value', the.Email.data.invalid2); |
| 53 | + cy.get(the.SubmitButton).click(); //click en boton |
| 54 | + cy.get(the.Email.input).should('have.css', 'border-color', 'rgb(255, 0, 0)'); |
| 55 | + cy.get(the.Email.input).should('have.class', 'field-error'); |
| 56 | + }); |
| 57 | + }); |
| 58 | + |
| 59 | + it('GX-24109 | TC6: Validar el no funcionamiento del input correo electrónico si el mismo no tiene "." después: 1 carácter alfanumérico después de “@”.', () => { |
| 60 | + cy.fixture('data/GX-24109-TextBoxForm').then(the => { |
| 61 | + cy.get(the.Email.input).type(the.Email.data.invalid3); //no contiene "." después: 1 carácter alfanumérico después de “@”. |
| 62 | + cy.get(the.Email.input).should('have.value', the.Email.data.invalid3); |
| 63 | + cy.get(the.SubmitButton).click(); //click en boton |
| 64 | + cy.get(the.Email.input).should('have.css', 'border-color', 'rgb(255, 0, 0)'); |
| 65 | + cy.get(the.Email.input).should('have.class', 'field-error'); |
| 66 | + }); |
| 67 | + }); |
| 68 | + |
| 69 | + it('GX-24109 | TC7: Validar el no funcionamiento del input correo electrónico si el mismo no tiene (mínimo) 2 caracteres alfanuméricos después de “.”.', () => { |
| 70 | + cy.fixture('data/GX-24109-TextBoxForm').then(the => { |
| 71 | + cy.get(the.Email.input).type(the.Email.data.invalid4); //no contiene (mínimo) 2 caracteres alfanuméricos después de “.” |
| 72 | + cy.get(the.Email.input).should('have.value', the.Email.data.invalid4); |
| 73 | + cy.get(the.SubmitButton).click(); //click en boton |
| 74 | + cy.get(the.Email.input).should('have.css', 'border-color', 'rgb(255, 0, 0)'); |
| 75 | + cy.get(the.Email.input).should('have.class', 'field-error'); |
| 76 | + }); |
| 77 | + }); |
| 78 | +}); |
| 79 | + |
| 80 | +import { removeLogs } from '@helper/RemoveLogs'; |
| 81 | + |
| 82 | +removeLogs(); |
0 commit comments