Skip to content

Commit 41051df

Browse files
author
João Martins Filho
committed
refatoracao dos nomes dos arquivos e métodos e adicão de segunda feature, ocorrendo o erro
1 parent cb0a54f commit 41051df

File tree

10 files changed

+114
-45
lines changed

10 files changed

+114
-45
lines changed
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" |
14+
| "cypress" |
File renamed without changes.

cypress/support/elements/GoogleElements.js renamed to cypress/support/elements/GoogleCypressCucumberElements.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class GoogleElements {
1+
class GoogleCypressCucumberElements {
22
inputTexto = () => {
33
return ".gLFyf";
44
};
@@ -9,4 +9,4 @@ class GoogleElements {
99

1010
}
1111

12-
export default GoogleElements;
12+
export default GoogleCypressCucumberElements;
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
class GoogleCypressElements {
2+
inputTexto = () => {
3+
return ".gLFyf";
4+
};
5+
6+
linkGoogleContais = () => {
7+
return '.LC20lb';
8+
};
9+
10+
}
11+
12+
export default GoogleCypressElements;
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/// <reference types="Cypress" />
2+
import GoogleCypressCucumberElements from '../elements/GoogleCypressCucumberElements';
3+
4+
const googleCypressCucumberElements = new GoogleCypressCucumberElements();
5+
6+
class GoogleCypressCucumberObjects {
7+
8+
acessarGoogle() {
9+
cy.visit('https://www.google.com.br/');
10+
}
11+
12+
inputTexto(texto) {
13+
cy.get(googleCypressCucumberElements.inputTexto()).type(texto);
14+
}
15+
16+
clickEnter() {
17+
cy.get(googleCypressCucumberElements.inputTexto()).type('{enter}')
18+
}
19+
20+
buscaCorrespondida() {
21+
cy.get(googleCypressCucumberElements.linkGoogleContais()).should('contain','cypress-cucumber-preprocessor - npm');
22+
}
23+
}
24+
25+
export default GoogleCypressCucumberObjects;
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/// <reference types="Cypress" />
2+
import GoogleCypressElements from '../elements/GoogleCypressElements';
3+
4+
const googleCypressElements = new GoogleCypressElements();
5+
6+
class GoogleCypressObjects {
7+
8+
acessarGoogle() {
9+
cy.visit('https://www.google.com.br/');
10+
}
11+
12+
inputTexto(texto) {
13+
cy.get(googleCypressElements.inputTexto()).type(texto);
14+
}
15+
16+
clickEnter() {
17+
cy.get(googleCypressElements.inputTexto()).type('{enter}')
18+
}
19+
20+
buscaCorrespondida() {
21+
cy.get(googleCypressElements.linkGoogleContais()).should('contain', 'JavaScript End to End Testing Framework | cypress.io');
22+
}
23+
}
24+
25+
export default GoogleCypressObjects;

cypress/support/pageObjects/GoogleObjects.js

Lines changed: 0 additions & 25 deletions
This file was deleted.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/// <reference types="Cypress"/>
2+
/* global Cypress, cy, expect, Given, When, Then */
3+
import GoogleCypressCucumberObjects from '../pageObjects/GoogleCypressCucumberObjects';
4+
5+
const googleCypressCucumberObjects = new GoogleCypressCucumberObjects();
6+
7+
Given('que o usuário esteja no site google', () => {
8+
googleCypressCucumberObjects.acessarGoogle();
9+
});
10+
When('entrar com {string}', texto => {
11+
googleCypressCucumberObjects.inputTexto(texto);
12+
});
13+
And('apertar enter', () => {
14+
googleCypressCucumberObjects.clickEnter();
15+
});
16+
Then('deve visualizar a busca correspondida', () => {
17+
googleCypressCucumberObjects.buscaCorrespondida();
18+
});
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/// <reference types="Cypress"/>
2+
/* global Cypress, cy, expect, Given, When, Then */
3+
import GoogleCypressObjects from '../pageObjects/GoogleCypressObjects';
4+
5+
const googleCypressObjects = new GoogleCypressObjects();
6+
7+
Given('que o usuário esteja no site google', () => {
8+
googleCypressObjects.acessarGoogle();
9+
});
10+
When('entrar com {string}', texto => {
11+
googleCypressObjects.inputTexto(texto);
12+
});
13+
And('apertar enter', () => {
14+
googleCypressObjects.clickEnter();
15+
});
16+
Then('deve visualizar a busca correspondida', () => {
17+
googleCypressObjects.buscaCorrespondida();
18+
});

cypress/support/steps/GoogleSteps.js

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)