Skip to content

Commit cb0a54f

Browse files
author
João Martins Filho
committed
first commit
0 parents  commit cb0a54f

File tree

13 files changed

+5714
-0
lines changed

13 files changed

+5714
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Example cypress-cucumber-preprocessor with step duplicate
2+
3+
Repository created to simulation error in duplicate steps in *cypress-cucumber-preprocessor*.
4+
5+
## how to fix
6+
7+
**development**

cypress.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"projectId": "rchqse",
3+
"testFiles": "**/*.feature",
4+
"videoUploadOnPasses": false,
5+
"viewportWidth": 1366,
6+
"viewportHeight": 768
7+
}

cypress/fixtures/example.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"name": "Using fixtures to represent data",
3+
"email": "[email protected]",
4+
"body": "Fixtures are a great way to mock data for responses to routes"
5+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#language:pt
2+
3+
Funcionalidade: Acesso ao site Google
4+
5+
Esquema do Cenário: Validando acesso ao site google
6+
Dado que o usuário esteja no site google
7+
Quando entrar com <texto>
8+
E apertar enter
9+
Então deve visualizar a busca correspondida
10+
11+
Exemplos:
12+
| texto |
13+
| "cypress-cucumber-preprocessor" |
14+
| "cypress-cucumber-preprocessor" |

cypress/plugins/index.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// ***********************************************************
2+
// This example plugins/index.js can be used to load plugins
3+
//
4+
// You can change the location of this file or turn off loading
5+
// the plugins file with the 'pluginsFile' configuration option.
6+
//
7+
// You can read more here:
8+
// https://on.cypress.io/plugins-guide
9+
// ***********************************************************
10+
11+
// This function is called when a project is opened or re-opened (e.g. due to
12+
// the project's config changing)
13+
14+
module.exports = (on, config) => {
15+
// `on` is used to hook into various events Cypress emits
16+
// `config` is the resolved Cypress config
17+
}
18+
19+
const cucumber = require('cypress-cucumber-preprocessor').default;
20+
module.exports = (on, config) => {
21+
on('file:preprocessor', cucumber());
22+
};
23+

cypress/support/commands.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// ***********************************************
2+
// This example commands.js shows you how to
3+
// create various custom commands and overwrite
4+
// existing commands.
5+
//
6+
// For more comprehensive examples of custom
7+
// commands please read more here:
8+
// https://on.cypress.io/custom-commands
9+
// ***********************************************
10+
//
11+
//
12+
// -- This is a parent command --
13+
// Cypress.Commands.add("login", (email, password) => { ... })
14+
//
15+
//
16+
// -- This is a child command --
17+
// Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... })
18+
//
19+
//
20+
// -- This is a dual command --
21+
// Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... })
22+
//
23+
//
24+
// -- This will overwrite an existing command --
25+
// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... })
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
class GoogleElements {
2+
inputTexto = () => {
3+
return ".gLFyf";
4+
};
5+
6+
linkGoogleContais = () =>{
7+
return '.LC20lb';
8+
};
9+
10+
}
11+
12+
export default GoogleElements;

cypress/support/index.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// ***********************************************************
2+
// This example support/index.js is processed and
3+
// loaded automatically before your test files.
4+
//
5+
// This is a great place to put global configuration and
6+
// behavior that modifies Cypress.
7+
//
8+
// You can change the location of this file or turn off
9+
// automatically serving support files with the
10+
// 'supportFile' configuration option.
11+
//
12+
// You can read more here:
13+
// https://on.cypress.io/configuration
14+
// ***********************************************************
15+
16+
// Import commands.js using ES2015 syntax:
17+
import './commands'
18+
19+
// Alternatively you can use CommonJS syntax:
20+
// require('./commands')
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/// <reference types="Cypress" />
2+
import GoogleElements from '../elements/GoogleElements';
3+
4+
const googleElements = new GoogleElements();
5+
6+
class GoogleObjects {
7+
8+
acessarGoogle() {
9+
cy.visit('https://www.google.com.br/');
10+
}
11+
12+
inputTexto(texto) {
13+
cy.get(googleElements.inputTexto()).type(texto);
14+
}
15+
16+
clickEnter() {
17+
cy.get(googleElements.inputTexto()).type('{enter}')
18+
}
19+
20+
buscaCorrespondida() {
21+
cy.get(googleElements.linkGoogleContais()).should('contain','cypress-cucumber-preprocessor - npm');
22+
}
23+
}
24+
25+
export default GoogleObjects;

0 commit comments

Comments
 (0)