Skip to content
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
Binary file modified Labor Test Cases.xlsx
Binary file not shown.
12 changes: 12 additions & 0 deletions cypress.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"chromeWebSecurity": false,
"watchForFileChanges": false,
"viewportWidth": 1440,
"viewportHeight": 900,
"defaultCommandTimeout": 8000,
"pageLoadTimeout": 30000,
"env": {
"baseUrl": "https://getlabor.com.br/"
},
"projectId": "6t8mzz"
}
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": "hello@cypress.io",
"body": "Fixtures are a great way to mock data for responses to routes"
}
135 changes: 135 additions & 0 deletions cypress/integration/tests/test_challenge.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
/// <reference types="cypress" />




describe('TU-01', function() {
it('Verify the homepage opens and has the correct title', function() {
//Open the homepage
cy.visit(Cypress.env('baseUrl'));

//Gets the title of the page once it loads and calls it "title"
cy.title().should('eq', 'Labor - Controle de Horas');
});
});

describe('TU-02', function() {
it('Check Initial pricing on the homepage', function() {
//Open the homepage
cy.visit(Cypress.env('baseUrl'));

//Assert that has initial pricing details on the homepage
cy.get('.css-31mgl0 > .css-1njitdr').should('have.value', 'R$ 249,00/ano');
});
});

describe('TU-03', function() {
it('Check functionality of the "planos" menu', function() {
//Open the homepage
cy.visit(Cypress.env('baseUrl'));

//Click on the Pricing tab
cy.get('.css-17rqx3h > [href="/planos"]').click();

//Assert
cy.get('.css-bn4p1g').should('have.text', 'Planos');
});
});

describe('TU-04', function(){
it('Check signup fields when submitted as empty',function(){
//Open the homepage
cy.visit(Cypress.env('baseUrl'));

//Click on "Entrar"
cy.get('.css-ympbks > [href="https://app.getlabor.com.br/entrar"]').click();

//Click on "Comece agora"
cy.get('.css-1u1jkkz').click();

//Click on "Cadastrar" without fill any field
cy.get('.css-1s8t1jb').click();

//Assert that every field is mandatory to fill
cy.get(':nth-child(2) > .css-rmt2c8').should('have.text', 'Campo obrigatório');
cy.get('.e1nk4wcv1 > .css-rmt2c8').should('have.text', 'Campo obrigatório');
cy.get(':nth-child(4) > .css-rmt2c8').should('have.text', 'Campo obrigatório');
cy.get('.css-79elbk > .css-135rwlj > .css-rmt2c8').should('have.text', 'Campo obrigatório');
});
});

describe('TU-05', function(){
it('Check signup of existent user "email@test.com"',function(){
//Open the homepage
cy.visit(Cypress.env('baseUrl'));

//Click on "Entrar"
cy.get('.css-ympbks > [href="https://app.getlabor.com.br/entrar"]').click();

//Click on "Comece agora"
cy.get('.css-1u1jkkz').click();

//Sign up with an existent user
cy.get(':nth-child(2) > .css-pjp27w').type('Rafael Costa');
cy.get('.e1nk4wcv1 > .css-pjp27w').select('Desenvolvimento de Software');
cy.get(':nth-child(4) > .css-pjp27w').type('email@test.com');
cy.get('.css-79elbk > .css-135rwlj > .css-pjp27w').type('1234')

//Click on "Cadastrar" button
cy.get('.css-1s8t1jb').click();

//Assert that the e-mail "email@test.com" already exists
cy.get('.e1w0gikl6').should('have.text', 'Already registered!');
});
});

describe('TU-06', function(){

const uuid = () => Cypress._.random(0, 1e6)
const id = uuid()
const testemail = `testemail${id}`

it('Check a valid sign up', function(){
//Open the homepage
cy.visit(Cypress.env('baseUrl'));

//Click on "Entrar"
cy.get('.css-ympbks > [href="https://app.getlabor.com.br/entrar"]').click();

//Click on "Comece agora"
cy.get('.css-1u1jkkz').click();

//Sign up with an existent user
cy.get(':nth-child(2) > .css-pjp27w').type('Rafael Costa');
cy.get('.e1nk4wcv1 > .css-pjp27w').select('Desenvolvimento de Software');
cy.get(':nth-child(4) > .css-pjp27w').type(testemail + '@gmail.com');
cy.get('.css-79elbk > .css-135rwlj > .css-pjp27w').type('1234')

//Click on "Cadastrar" button
cy.contains('Cadastrar').click();

//Assert that the Sign Up process was successful
cy.url().should('not.eq', 'https://app.getlabor.com.br/cadastrar');
});
});

describe('TU-07', function(){
it('Check a valid login redirection', function(){

//Open the homepage
cy.visit(Cypress.env('baseUrl'));

//Click on "Entrar in the Home Page"
cy.get('.css-ympbks > [href="https://app.getlabor.com.br/entrar"]').click();

//Login
cy.get(':nth-child(2) > .css-pjp27w').type('email@test.com');
cy.get('.css-79elbk > .css-135rwlj > .css-pjp27w').type('1234');

//Click on Entrar in the Login area
cy.get('.css-1s8t1jb').click();

//Assert that the Login was made successfully
cy.url().should('not.eq', 'https://app.getlabor.com.br/entrar');
});
});
21 changes: 21 additions & 0 deletions cypress/plugins/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/// <reference types="cypress" />
// ***********************************************************
// This example plugins/index.js can be used to load plugins
//
// You can change the location of this file or turn off loading
// the plugins file with the 'pluginsFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/plugins-guide
// ***********************************************************

// This function is called when a project is opened or re-opened (e.g. due to
// the project's config changing)

/**
* @type {Cypress.PluginConfig}
*/
module.exports = (on, config) => {
// `on` is used to hook into various events Cypress emits
// `config` is the resolved Cypress config
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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')
Binary file added cypress/videos/tests/test_challenge.js.mp4
Binary file not shown.
Loading