forked from rormoura/ke-delivery
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request rormoura#64 from rormoura/dev
Dev
- Loading branch information
Showing
25 changed files
with
514 additions
and
159 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# cartButton.feature | ||
|
||
Feature: Testes da página de novoItem | ||
Como um usuário | ||
Eu quero testar a funcionalidade do componente CartButton | ||
|
||
Scenario: Deslogar | ||
Given Eu entrei na página de "NovoPedido" | ||
When Eu aperto no botão "Sair" | ||
Then Eu alcanço a página de "home" | ||
|
||
Scenario: Verificar visibilidade do carrinho após clique | ||
Given Eu cheguei na página "NovoPedido" | ||
Given o carrinho tem visibilidade = "false" | ||
When Eu aperto o botão "cart-button" | ||
Then a visibilidade do carrinho vai para "true" | ||
|
||
Scenario: Adicionar um novo pedido no carrinho | ||
Given Estamos na página "NovoPedido" | ||
Given a visibilidade do carrinho é = "false" | ||
When Eu clico em "buttonAddCart" para adicionar um item | ||
Then a quantidade de itens no carrinho é maior que 0 | ||
|
||
|
||
Scenario: Aumentar as quantidades dos pedidos no carrinho | ||
Given Fomos para a página "novoPedido" | ||
Given Eu clico em "buttonAddCart" para adicionar novo item | ||
When Eu uso o botão "cart-button" | ||
When Eu aperto em "buttonIncreaseItem" para aumentar a quantidade de itens | ||
Then a quantidade de itens no carrinho é superior a 3 | ||
|
||
|
||
Scenario: Diminuir as quantidades dos pedidos no carrinho | ||
Given Chegamos em "novoPedido" | ||
Given Eu clico em "buttonAddCart" para colocar um novo item | ||
Given Eu clico novamente em "buttonAddCart" para colocar um novo item | ||
When Eu pressiono o botão "cart-button" | ||
When Eu aperto em "buttonDecreaseItem" para diminuir a quantidade de itens | ||
Then a quantidade de itens no carrinho é inferior a 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
import { Given, Then, When } from "@badeball/cypress-cucumber-preprocessor"; | ||
|
||
// Scenario: Visualizar tests | ||
Given( | ||
"Eu entrei na página de {string}", (page: string) => { | ||
cy.visit(page); | ||
} | ||
); | ||
|
||
When("Eu aperto no botão {string}", (button: string) => { | ||
cy.getDataCy(button).click(); | ||
}); | ||
|
||
Then("Eu alcanço a página de {string}", (page: string) => { | ||
cy.url().should("include", page); | ||
}); | ||
|
||
|
||
//Testando carrinho | ||
Given( | ||
"Eu cheguei na página {string}", (page: string) => { | ||
cy.visit(page); | ||
} | ||
); | ||
|
||
Given( | ||
"o carrinho tem visibilidade = {string}", (value: string) => { | ||
cy.getDataCy('Visible').should('contain', value); | ||
} | ||
); | ||
|
||
When("Eu aperto o botão {string}", (button: string) => { | ||
cy.getDataCy(button).click(); | ||
}); | ||
|
||
Then("a visibilidade do carrinho vai para {string}", (value: string) => { | ||
cy.getDataCy('Visible').should('have.text', value); | ||
}); | ||
|
||
//Adicionar um novo pedido no carrinho | ||
Given( | ||
"Estamos na página {string}", (page: string) => { | ||
cy.visit(page); | ||
} | ||
); | ||
|
||
Given( | ||
"a visibilidade do carrinho é = {string}", (value: string) => { | ||
cy.getDataCy('Visible').should('contain', value); | ||
} | ||
); | ||
|
||
When("Eu clico em {string} para adicionar um item", (button: string) => { | ||
cy.getDataCy(button).click({ multiple: true, force: true }); | ||
}); | ||
|
||
Then("a quantidade de itens no carrinho é maior que {int}", (value: number) => { | ||
cy.getDataCy('qtdItems').invoke('text').then(parseFloat).should('be.gt', value) | ||
}); | ||
|
||
|
||
//Aumentar as quantidades dos pedidos no carrinho | ||
Given( | ||
"Fomos para a página {string}", (page: string) => { | ||
cy.visit(page); | ||
} | ||
); | ||
|
||
Given("Eu clico em {string} para adicionar novo item", (button: string) => { | ||
cy.getDataCy(button).click({ multiple: true, force: true }); | ||
}); | ||
|
||
When("Eu uso o botão {string}", (button: string) => { | ||
cy.getDataCy(button).click(); | ||
}); | ||
|
||
When("Eu aperto em {string} para aumentar a quantidade de itens", (button: string) => { | ||
cy.getDataCy(button).click({ multiple: true, force: true }); | ||
}); | ||
|
||
Then("a quantidade de itens no carrinho é superior a {int}", (value: number) => { | ||
cy.getDataCy('qtdItems').invoke('text').then(parseFloat).should('be.gt', value) | ||
}); | ||
|
||
//Diminuir as quantidades dos pedidos no carrinho | ||
Given( | ||
"Chegamos em {string}", (page: string) => { | ||
cy.visit(page); | ||
} | ||
); | ||
|
||
Given("Eu clico em {string} para colocar um novo item", (button: string) => { | ||
cy.getDataCy(button).click({ multiple: true, force: true }); | ||
}); | ||
|
||
Given("Eu clico novamente em {string} para colocar um novo item", (button: string) => { | ||
cy.getDataCy(button).click({ multiple: true, force: true }); | ||
}); | ||
|
||
When("Eu pressiono o botão {string}", (button: string) => { | ||
cy.getDataCy(button).click(); | ||
}); | ||
|
||
When("Eu aperto em {string} para diminuir a quantidade de itens", (button: string) => { | ||
cy.getDataCy(button).click({ multiple: true, force: true }); | ||
}); | ||
|
||
Then("a quantidade de itens no carrinho é inferior a {int}", (value: number) => { | ||
cy.getDataCy('qtdItems').invoke('text').then(parseFloat).should('be.lt', value) | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
frontend/src/app/home/components/Restaurants/Menu/index.module.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.