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

Feature/sqa 843 #2

Open
wants to merge 9 commits 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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
Teste que eu faço com Cypress
<p align="center">
<a href="https://www.cypress.io"><img src="https://cloud.githubusercontent.com/assets/1268976/20607953/d7ae489c-b24a-11e6-9cc4-91c6c74c5e88.png"/></a>

9 changes: 9 additions & 0 deletions cypress.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const { defineConfig } = require("cypress");

module.exports = defineConfig({
e2e: {
setupNodeEvents(on, config) {
// implement node event listeners here
},
},
});
92 changes: 92 additions & 0 deletions cypress/Pages/whistleblowerPage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@

const home = "https://fatalmodel.com/"

const viewportWidth = 1440
const viewportHeight = 720

class WhistleblowerPageResources{
//Define a Viewport Desktop
setDesktopViewport() {
Cypress.config('viewportWidth', viewportWidth)
Cypress.config('viewportHeight', viewportHeight)
}

//Entrar na página home
visitHome(){
cy.visit(home)
}



//Acessa a página Home e limpa o Session Storage / Faz aparecer sempre a modal +18 terms e Cookies
visitHomeAndClearSessionStorage() {
cy.visit(home, {
onBeforeLoad: win => {
win.sessionStorage.clear()
}
})
}
//Identifica e clica no botão da modal +18 terms e Cookies
agreeModalTerms() {
cy.contains('Concordo').click()
}

//Aperta o botão continuar da página de denuncias
clickContinue(){
cy.contains('Continuar').click()
}

//Coloca email para ir para página de denuncias(usuario deslogado)
adEmail(){
cy.get('.denounce__form > [data-v-4c838268=""]').click().type('[email protected]')
}

//Força a ficar na mesma aba após clicar em denunciar perfil
leaveSameTabe(){
cy.contains('a', 'Denunciar perfil ').invoke('removeAttr','target').click()
}

//Visita um perfil de AD em winterfell
visitAdProfile(){
cy.visit('https://fatalmodel.com/1362118/laura-fernandes-1362118')
}

//checa se o titulo é visivel
CheckTitleIsVisible(){
cy.get('.denounce__title > .inner-text').should ('be.visible')
cy.contains('ESCOLHA UM MOTIVO PARA A DENÚNCIA').should('be.visible')
}

//checa se o subtitulo é visivel
checkSubTitleIsVisible(){
cy.get('.denounce__subtitle > .inner-text').should('be.visible')
cy.contains('Selecione abaixo o motivo pelo qual você está denunciando este perfil.').should('be.visible')
}

//Check button Irregularidade no perfil is visible
checkButtonIrregularidadeIsVisible(){
cy.get('.denounce__types > :nth-child(1)').should ('be.visible')
}



//Check button Extorsão e golpe do pix is visible
checkButtonGolpepixIsVisible(){
cy.get('.denounce__types > :nth-child(2)').should ('be.visible')
}



//Check button Gênero incorreto is visible
checkButtonGeneroIsVisible(){
cy.get('.denounce__types > :nth-child(3)').should ('be.visible')
}



//Check content is visible
checkContentIsVisible(){
cy.get('.denounce__content').should ('be.visible')
}
}
export default new WhistleblowerPageResources;
50 changes: 50 additions & 0 deletions cypress/e2e/WhistleblowerPageResources.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/// <reference types="cypress" />
import whistleblowerPage from '../Pages/whistleblowerPage';
import WhistleblowerPageResources from '../Pages/whistleblowerPage'
//DD(TESTE)
describe("Whistleblower Page Test", () => {
WhistleblowerPageResources.setDesktopViewport();

it('Agree modal +18 terms and Cookies', () => {
WhistleblowerPageResources.visitHomeAndClearSessionStorage();
WhistleblowerPageResources.agreeModalTerms();

})
it('Check title is visible', () =>{
WhistleblowerPageResources.visitAdProfile();
WhistleblowerPageResources.agreeModalTerms();
WhistleblowerPageResources.leaveSameTabe();
WhistleblowerPageResources.clickContinue();
WhistleblowerPageResources.adEmail();
WhistleblowerPageResources.clickContinue();

})
it ('Check title is visible', () => {
WhistleblowerPageResources.CheckTitleIsVisible();
})

it('Check subtitle is visible', () => {
WhistleblowerPageResources.checkSubTitleIsVisible();

})

it ('Check button Irregularidade no perfil is visible', () => {
WhistleblowerPageResources.checkButtonIrregularidadeIsVisible();
})

it ('Check button Extorsão e golpe do pix is visible', () => {
WhistleblowerPageResources.checkButtonGolpepixIsVisible();
})

it ('Check button Gênero incorreto is visible', () => {
WhistleblowerPageResources.checkButtonGeneroIsVisible()


})
it ('Check content is visible', () => {
WhistleblowerPageResources.checkContentIsVisible();
})
})



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"
}
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/e2e.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// ***********************************************************
// This example support/e2e.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')
1 change: 1 addition & 0 deletions node_modules/.bin/cypress

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/extract-zip

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/is-ci

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/node-which

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/rimraf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/semver

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/sshpk-conv

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/sshpk-sign

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/sshpk-verify

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/uuid

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading