Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update cac-tat #193

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions cypress.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"pluginsFile": false,
"viewportHeight": 880,
"viewportWidth": 1280
}
5 changes: 5 additions & 0 deletions cypress/fixtures/example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "Using fixtures to represent data",
"email": "[email protected]",
"body": "Fixtures are a great way to mock data for responses to routes"
}
61 changes: 61 additions & 0 deletions cypress/integration/CAC-TAT.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/// <reference types="Cypress" />

describe('Central de Atendimento ao Cliente TAT', function() {
this.beforeEach(function() {
cy.visit('./src/index.html')
})
it('verifica o título da aplicação', function() {
cy.visit('./src/index.html')

cy.title().should('be.equal', 'Central de Atendimento ao Cliente TAT')
})


it('preenche os campos obrigatórios e envia o formulário', function(){
const longText = 'Teste, Teste, Teste, Teste, Teste, Teste, Teste, Teste, Teste, Teste'
cy.get('#firstName').type('Pedro')
cy.get('#lastName').type('Felix')
cy.get('#email').type('[email protected]')
cy.get('#open-text-area').type(longText, {delay: 0})
cy.get('button[type="submit"]').click()

cy.get('.success').should('be.visible')

})

it('exibe mensagem de erro ao submeter o formulário com um email com formatação inválida', function(){
cy.get('#firstName').type('Pedro')
cy.get('#lastName').type('Felix')
cy.get('#email').type('pedro.felix08%gmail,com')
cy.get('#phone'.type('929999999s'))
cy.get('#open-text-area').type('Teste')
cy.get('button[type="submit"]').click()

cy.get('.error').should('be.visible')

})

it.only('campo telefone continua vazio quando preenchido com valor não-numérico', function(){
cy.get('#phone')
.type('kjhdfasdkjfhsduij')
.should('have.value', '')


})

})




// teste abaixo do meu site de loja de roupas

// describe('Central de Atendimento ao Cliente TAT', function() {
// it('verifica o título da aplicação', function() {
// cy.visit('https://grifechic.my.canva.site/chicgrife')

// cy.title().should('be.equal', 'Catálogo loja grife Chic')


// })
// })
25 changes: 25 additions & 0 deletions cypress/support/commands.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// ***********************************************
// This example commands.js shows you how to
// create various custom commands and overwrite
// existing commands.
//
// For more comprehensive examples of custom
// commands please read more here:
// https://on.cypress.io/custom-commands
// ***********************************************
//
//
// -- This is a parent command --
// Cypress.Commands.add('login', (email, password) => { ... })
//
//
// -- This is a child command --
// Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... })
//
//
// -- This is a dual command --
// Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... })
//
//
// -- This will overwrite an existing command --
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
20 changes: 20 additions & 0 deletions cypress/support/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// ***********************************************************
// This example support/index.js is processed and
// loaded automatically before your test files.
//
// This is a great place to put global configuration and
// behavior that modifies Cypress.
//
// You can change the location of this file or turn off
// automatically serving support files with the
// 'supportFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/configuration
// ***********************************************************

// Import commands.js using ES2015 syntax:
import './commands'

// Alternatively you can use CommonJS syntax:
// require('./commands')
Loading