This session aims to shed some light on an emerging test automation tool, Cypress. Cypress resolves many of the test automation problems that a QA or a dev may face in UI Web Automation testing. And after a walkthrough, we will compare cypress with Selenium as well.
Contact us:
Website: https://www.knoldus.com/
Twitter: https://twitter.com/Knolspeak?ref_src...
Facbook: https://www.facebook.com/KnoldusSoftw...
Linkedin: https://in.linkedin.com/company/knoldus
Instagram: https://www.instagram.com/knoldus_inc...
The document discusses test planning, analysis, design, implementation, and execution. It describes the roles and responsibilities of test analysts in each phase of testing. This includes activities like creating test cases and conditions, designing test suites, implementing test data and environments, executing tests, and logging test results. Test implementation is influenced by factors like the development lifecycle model, quality characteristics, test infrastructure, and exit criteria.
The passage discusses the importance of teaching children about money at a young age through activities like allowing them to make purchases and helping with household financial tasks. Starting financial education early can help children understand money management and make responsible decisions as adults. Learning about money in a fun, hands-on way through everyday examples makes complex financial lessons easier for kids to grasp.
- What are Internal Developer Portal (IDP) and Platform Engineering?
- What is Backstage?
- How Backstage can help dev to build developer portal to make their job easier
Jirayut Nimsaeng
Founder & CEO
Opsta (Thailand) Co., Ltd.
Youtube Record: https://youtu.be/u_nLbgWDwsA?t=850
Dev Mountain Tech Festival @ Chiang Mai
November 12, 2022
These slides summarize key concepts about software testing strategies from the book "Software Engineering: A Practitioner's Approach". The slides cover topics such as unit testing, integration testing, regression testing, object-oriented testing, and debugging. The overall strategic approach to testing outlined in the slides is to begin with "testing in the small" at the component level and work outward toward integrated system testing. Different testing techniques are appropriate at different stages of development.
Automation testing involves automating manual testing processes using software tools to execute test scripts and compare expected and actual results. There are different types of automation frameworks including data-driven, keyword-driven, modular, and hybrid frameworks. Implementing an automation framework involves 10 steps: identifying the testing scope and needs, evaluating tools, designing the framework, developing and populating test data, and configuring schedulers.
Reinventing Application Performance Testing with Service VirtualizationCA Technologies
Traditional performance testing typically requires that all components of the application are “completed,” integrated and deployed into an appropriate environment. This results in testing not being done until late in the delivery cycle or sometimes skipped entirely. Which can then lead to a less then optimal user experience, expensive rework and potential loss of business. Learn why many organizations are adopting service virtualization to overcome the key challenges associated with performance testing.o Learn more about CA Service Virtualization please visit http://cainc.to/DMPQSE
This session aims to shed some light on an emerging test automation tool, Cypress. Cypress resolves many of the test automation problems that a QA or a dev may face in UI Web Automation testing. And after a walkthrough, we will compare cypress with Selenium as well.
Contact us:
Website: https://www.knoldus.com/
Twitter: https://twitter.com/Knolspeak?ref_src...
Facbook: https://www.facebook.com/KnoldusSoftw...
Linkedin: https://in.linkedin.com/company/knoldus
Instagram: https://www.instagram.com/knoldus_inc...
The document discusses test planning, analysis, design, implementation, and execution. It describes the roles and responsibilities of test analysts in each phase of testing. This includes activities like creating test cases and conditions, designing test suites, implementing test data and environments, executing tests, and logging test results. Test implementation is influenced by factors like the development lifecycle model, quality characteristics, test infrastructure, and exit criteria.
The passage discusses the importance of teaching children about money at a young age through activities like allowing them to make purchases and helping with household financial tasks. Starting financial education early can help children understand money management and make responsible decisions as adults. Learning about money in a fun, hands-on way through everyday examples makes complex financial lessons easier for kids to grasp.
- What are Internal Developer Portal (IDP) and Platform Engineering?
- What is Backstage?
- How Backstage can help dev to build developer portal to make their job easier
Jirayut Nimsaeng
Founder & CEO
Opsta (Thailand) Co., Ltd.
Youtube Record: https://youtu.be/u_nLbgWDwsA?t=850
Dev Mountain Tech Festival @ Chiang Mai
November 12, 2022
These slides summarize key concepts about software testing strategies from the book "Software Engineering: A Practitioner's Approach". The slides cover topics such as unit testing, integration testing, regression testing, object-oriented testing, and debugging. The overall strategic approach to testing outlined in the slides is to begin with "testing in the small" at the component level and work outward toward integrated system testing. Different testing techniques are appropriate at different stages of development.
Automation testing involves automating manual testing processes using software tools to execute test scripts and compare expected and actual results. There are different types of automation frameworks including data-driven, keyword-driven, modular, and hybrid frameworks. Implementing an automation framework involves 10 steps: identifying the testing scope and needs, evaluating tools, designing the framework, developing and populating test data, and configuring schedulers.
Reinventing Application Performance Testing with Service VirtualizationCA Technologies
Traditional performance testing typically requires that all components of the application are “completed,” integrated and deployed into an appropriate environment. This results in testing not being done until late in the delivery cycle or sometimes skipped entirely. Which can then lead to a less then optimal user experience, expensive rework and potential loss of business. Learn why many organizations are adopting service virtualization to overcome the key challenges associated with performance testing.o Learn more about CA Service Virtualization please visit http://cainc.to/DMPQSE
Automation testing is crucial for large projects to achieve test coverage and speed. It is best suited when tests are repetitive, such as regression testing of unchanged parts of an application. Automation allows companies to execute repetitive and difficult tests faster to get quick feedback on new builds. However, automation requires significant investment and effort, so it is best to start with critical workflows that are stable and unlikely to change. Leveraging a crowd testing platform can help combat challenges in achieving full test coverage through a strategic combination of in-house and crowd-sourced testing.
The document discusses severity and priority levels for software testing. There are 5 severity levels - critical, major, moderate, minor, and cosmetic. Critical defects terminate the system or corrupt data while cosmetic defects are related to aesthetics. Priority is based partially on severity but also considers frequency of failure, visibility, and project impact. The priority levels are resolved immediately, give high attention, normal queue, low priority, and suspend.
The document provides guidelines for designing a robust test automation framework. It discusses that a well-designed framework increases testing efficiency and reduces costs. The key aspects of framework design include defining objectives, selecting the appropriate framework type, managing data, ensuring reusability, integrating with other tools, and flexible execution and reporting. Idexcel's test automation framework was created following these best practices to provide a maintainable and reusable framework.
Data-driven testing is a methodology where test input and output values are read from external data sources like files or databases. A single test script can be used to execute multiple test cases by varying the test data. Maveryx is a tool that supports data-driven testing through features like intelligent object recognition, separation of test logic from data, and reading test data from sources like Excel. The document provides an overview of data-driven testing and examples of how to create a data-driven test script using Maveryx.
This document provides an overview of fundamentals of software testing. It discusses why testing is necessary, defines key terms like errors, defects and failures. It describes the context in which software is used and how defects can impact systems. The seven principles of testing and fundamental test process involving planning, analysis, implementation and reporting are explained. Psychological aspects of testing and principles of ethical code are also covered at a high level.
Curso Treinamento Automação de testes com Selenium QualisterQualister
O documento fornece informações sobre os serviços de uma empresa de testes de software chamada Qualister, incluindo treinamentos em automação de testes com Selenium, consultoria em teste, terceirização de profissionais, avaliação de usabilidade e testes de performance. O documento também apresenta detalhes sobre o instrutor de um curso de automação de testes com Selenium.
Test automation principles, terminologies and implementationsSteven Li
A general slides for test automation principle, terminologies and implementation
Also, the slides provide an example - PET, which is a platform written by Perl, but not just for Perl. It provides a general framework to use.
This document provides an introduction to unit testing and mocking. It discusses the benefits of unit testing such as safer refactoring and value that increases over time. It provides a recipe for setting up a unit test project with test classes and methods using AAA syntax. It also covers what mocking is and how to use mocking frameworks to create fake dependencies and check interactions. Resources for learning more about unit testing and related tools are provided.
The document provides best practices for testing in Salesforce, including understanding business requirements before testing, creating a test plan and scenarios, preparing test cases, data, environments, and tools. It describes the stages of the Salesforce testing lifecycle including unit, integration, system, regression, and acceptance testing. Specific testing types for Salesforce like security, environment-based, governor limit-based, and integration testing are outlined. Do's and don'ts for test planning and case development are also listed.
Robot Framework - principais característicasalinebiath
Um pouco do que aprendi sobre essa ferramenta de automação para testes (web, mobile, API, etc).
Aqui não esgotamos o assunto! Tem muito mais. Aconselho a leitura dos links nas referências, principalmente o User guide do Robot Framework.
This is the chapter 3 of ISTQB Advance Test Automation Engineer certification. This presentation helps aspirants understand and prepare content of certification.
The document discusses the advantages of cloud-based testing over traditional in-house testing. Cloud-based testing provides significant cost reductions of 40-70% due to lower infrastructure costs, pay-per-use models, and eliminating upfront capital expenditures. It also improves flexibility, time-to-market, and allows for quick scaling of test resources. However, challenges include security concerns, lack of standard integration with internal resources, and ensuring cloud vendors meet service level agreements. The document provides steps companies should take to effectively plan and execute cloud-based testing.
O Cucumber ajuda equipes a compreender requisitos corretamente através de exemplos em linguagem natural, ter uma documentação executável compartilhada, e encontrar problemas de requisitos mais cedo. A estrutura do Cucumber separa especificações de negócios de implementações técnicas. Melhores práticas incluem escrever features declarativas e reutilizar definições de passos.
Automation testing is crucial for large projects to achieve test coverage and speed. It is best suited when tests are repetitive, such as regression testing of unchanged parts of an application. Automation allows companies to execute repetitive and difficult tests faster to get quick feedback on new builds. However, automation requires significant investment and effort, so it is best to start with critical workflows that are stable and unlikely to change. Leveraging a crowd testing platform can help combat challenges in achieving full test coverage through a strategic combination of in-house and crowd-sourced testing.
The document discusses severity and priority levels for software testing. There are 5 severity levels - critical, major, moderate, minor, and cosmetic. Critical defects terminate the system or corrupt data while cosmetic defects are related to aesthetics. Priority is based partially on severity but also considers frequency of failure, visibility, and project impact. The priority levels are resolved immediately, give high attention, normal queue, low priority, and suspend.
The document provides guidelines for designing a robust test automation framework. It discusses that a well-designed framework increases testing efficiency and reduces costs. The key aspects of framework design include defining objectives, selecting the appropriate framework type, managing data, ensuring reusability, integrating with other tools, and flexible execution and reporting. Idexcel's test automation framework was created following these best practices to provide a maintainable and reusable framework.
Data-driven testing is a methodology where test input and output values are read from external data sources like files or databases. A single test script can be used to execute multiple test cases by varying the test data. Maveryx is a tool that supports data-driven testing through features like intelligent object recognition, separation of test logic from data, and reading test data from sources like Excel. The document provides an overview of data-driven testing and examples of how to create a data-driven test script using Maveryx.
This document provides an overview of fundamentals of software testing. It discusses why testing is necessary, defines key terms like errors, defects and failures. It describes the context in which software is used and how defects can impact systems. The seven principles of testing and fundamental test process involving planning, analysis, implementation and reporting are explained. Psychological aspects of testing and principles of ethical code are also covered at a high level.
Curso Treinamento Automação de testes com Selenium QualisterQualister
O documento fornece informações sobre os serviços de uma empresa de testes de software chamada Qualister, incluindo treinamentos em automação de testes com Selenium, consultoria em teste, terceirização de profissionais, avaliação de usabilidade e testes de performance. O documento também apresenta detalhes sobre o instrutor de um curso de automação de testes com Selenium.
Test automation principles, terminologies and implementationsSteven Li
A general slides for test automation principle, terminologies and implementation
Also, the slides provide an example - PET, which is a platform written by Perl, but not just for Perl. It provides a general framework to use.
This document provides an introduction to unit testing and mocking. It discusses the benefits of unit testing such as safer refactoring and value that increases over time. It provides a recipe for setting up a unit test project with test classes and methods using AAA syntax. It also covers what mocking is and how to use mocking frameworks to create fake dependencies and check interactions. Resources for learning more about unit testing and related tools are provided.
The document provides best practices for testing in Salesforce, including understanding business requirements before testing, creating a test plan and scenarios, preparing test cases, data, environments, and tools. It describes the stages of the Salesforce testing lifecycle including unit, integration, system, regression, and acceptance testing. Specific testing types for Salesforce like security, environment-based, governor limit-based, and integration testing are outlined. Do's and don'ts for test planning and case development are also listed.
Robot Framework - principais característicasalinebiath
Um pouco do que aprendi sobre essa ferramenta de automação para testes (web, mobile, API, etc).
Aqui não esgotamos o assunto! Tem muito mais. Aconselho a leitura dos links nas referências, principalmente o User guide do Robot Framework.
This is the chapter 3 of ISTQB Advance Test Automation Engineer certification. This presentation helps aspirants understand and prepare content of certification.
The document discusses the advantages of cloud-based testing over traditional in-house testing. Cloud-based testing provides significant cost reductions of 40-70% due to lower infrastructure costs, pay-per-use models, and eliminating upfront capital expenditures. It also improves flexibility, time-to-market, and allows for quick scaling of test resources. However, challenges include security concerns, lack of standard integration with internal resources, and ensuring cloud vendors meet service level agreements. The document provides steps companies should take to effectively plan and execute cloud-based testing.
O Cucumber ajuda equipes a compreender requisitos corretamente através de exemplos em linguagem natural, ter uma documentação executável compartilhada, e encontrar problemas de requisitos mais cedo. A estrutura do Cucumber separa especificações de negócios de implementações técnicas. Melhores práticas incluem escrever features declarativas e reutilizar definições de passos.
Cucumber ajuda equipes de desenvolvimento de software a: 1) compreender corretamente os requisitos através de exemplos em linguagem natural, 2) usar o mesmo vocabulário para falar sobre o software, e 3) ter uma documentação viva e de fácil leitura. Cucumber estrutura testes em features, scenarios e steps technology-facing. Melhores práticas incluem escrever features declarativas e reusar step definitions.
Este documento discute testes automatizados usando Ruby on Rails, RSpec e Cucumber. Ele explica como testes automatizados podem ser usados para prevenir defeitos, permitir refactoring seguro e documentar o comportamento esperado do software. Algumas técnicas discutidas incluem testes unitários, de integração, de aceitação e cobertura de código para garantir que cada linha de código seja testada.
O documento apresenta boas práticas para automação de testes, incluindo usar page objects, dados-driven testing e manter testes isolados. Também discute técnicas como record and replay, bare sleep e keep pooling.
O documento descreve o framework Demoiselle Behave para desenvolvimento de soluções orientadas a comportamento usando Behavior Driven Development (BDD). Ele explica os princípios e benefícios do BDD, como mapear elementos de tela, escrever histórias de usuário e implementar cenários de teste.
O documento apresenta uma introdução ao Google Apps Script, descrevendo-o como um ambiente de desenvolvimento JavaScript na nuvem que permite a automação de tarefas utilizando produtos da Google e serviços de terceiros. É apresentado um roteiro com exemplos de uso do Apps Script em planilhas, documentos e sites.
O documento apresenta Gabriel Colombo e um workshop introdutório sobre o framework Vue.js. O workshop irá cobrir os principais conceitos e funcionalidades do Vue como reatividade, data-binding, diretivas, event handling, componentes e projeto prático de um e-mail client. O objetivo é mostrar porque o Vue é um framework popular, fácil de aprender e usar para criar interfaces reativas.
Este documento apresenta um treinamento sobre Grails, incluindo: (1) introdução ao Groovy e suas funcionalidades, (2) modelagem de domínio com classes e relacionamentos, e (3) geração automática de telas e controle de acesso com plugins.
1) O documento apresenta informações sobre Angular 2 ministrado por Loiane Groner em 60 minutos, incluindo seus contatos e experiência.
2) São apresentados os principais blocos do Angular 2 como componentes, diretivas, roteamento, serviços, módulos e data binding.
3) O documento fornece um resumo dos principais tópicos para se aprender Angular 2, como tiposcript, criação de projetos, componentes, diretivas, comunicação entre componentes e muito mais.
Este documento fornece instruções para configurar balanceadores de carga HTTP e de rede no Google Cloud Platform. Ele explica como configurar pools de destino, regras de encaminhamento e verificações de integridade para distribuir tráfego entre instâncias de máquina virtual de forma balanceada.
This document provides an overview of Behavior Driven Development (BDD) using Cucumber and Selenium with Java. It discusses the traditional development process versus BDD, introduces BDD concepts and Cucumber tools, and provides examples of unit testing "hello world" with Cucumber and end-to-end testing by searching GitHub with Selenium.
Automação no ambientAutomação no ambiente de desenvolvimento com Maven e ANTelliando dias
O documento apresenta um workshop sobre ferramentas de automação no desenvolvimento como ANT e Maven. Ele discute os conceitos e funcionalidades dessas ferramentas, incluindo vantagens e desvantagens, configuração, dependências, testes, documentação e integração com outras ferramentas.
Evento Front End SP - Organizando o JavascriptMichel Ribeiro
O documento fornece 3 dicas principais para escrever códigos JavaScript melhores:
1) Aprenda bem a linguagem JavaScript e seus conceitos-chave.
2) Aplique padrões como o Module Pattern para organizar e encapsular o código.
3) Use arquiteturas como MVC para separar as preocupações da aplicação.
Além disso, fornece dicas gerais como documentar o código, criar arquivos separados, injetar dependências e realizar testes. O objetivo é ajudar a escrever códigos mais
Como usar a biblioteca SimpleTest do PHP para ganhar tempo resolvendo os problemas mas simples do dia-a-dia. Essa apresentação foi elaborada para o PHPConference2008 que aconteceu em Osasco, SP Brasil.
Desenvolvimento em .Net - Estruturas BasicasVitor Silva
O documento apresenta uma introdução ao desenvolvimento em .NET, abordando conceitos essenciais como tipos de dados, declaração e escopo de variáveis, conversões entre tipos, estruturas condicionais e de repetição, procedimentos e funções, operadores e o Visual Studio.
Angular 2, Typescript e outras tecnologias relacionadas. O documento resume conceitos importantes como:
- Componentes, diretivas, serviços, módulos e roteamento no Angular;
- Conceitos do TypeScript como tipagem, classes e interfaces;
- Ferramentas como Angular CLI para criação de projetos.
O documento fornece instruções passo-a-passo para criar projetos, suites de teste, casos de teste e etapas de teste no SoapUI. Ele explica como criar um projeto SoapUI, adicionar uma suíte de teste e um caso de teste, configurar etapas de teste como solicitações SOAP e transferências de propriedades, e executar testes.
13. Cucumber can be used to
implement automated
tests based on scenarios
described in your Gherkin
feature files.
14. Imperativo: Muitos detalhes, passo a passo
Declarativo: Conciso, direto ao ponto, poucos passos
Nível de abstração
15. Nível de abstração
Imperativo
Dado que eu abra o browser
E navegue para o site https://store.ministryoftesting.com
E clique no campo ‘Search’
Quando eu digitar ‘MUG’
E clicar em buscar
Então verei a página de busca mostrando os detalhes das canecas
16. Nível de abstração
Declarativo
Dado que eu esteja no e-commerce do Ministry of Testing
Quando eu fizer uma busca por caneca
Então verei a página de busca mostrando os detalhes das canecas
19. Boa prática
Menos é mais.
Menos passos,
menos
manutenção.
Detalhes da
implementação,
como IDs não
fazem sentido.
Foco deve ser no
comportamento.
Não tem certo ou
errado.
Experimente e
aprenda em
conjunto com seu
time.
20. Data Tables
Dado o valor dos itens que comprei
| 3 |
| 6 |
| 233 |
Quando a conta for somada
Então o total cobrado deve ser 238
21. Data Tables
Dado que eu esteja no e-commerce do Ministry of Testing
Quando eu fizer uma busca por caneca
Então verei a página de busca mostrando os detalhes das
canecas
| posicao | nome | preco |
| 1 | Bug Mug | £12.49 |
| 2 | Mug - White | £12.49 |
22. Então("verei a página de busca mostrando os detalhes das canecas") do |table|
data = table.raw
end
Data Tables
data => [["posicao", "nome", "preco"], ["1", "Bug Mug", "£12.49"],
["2", "Mug - White", "£12.49"]]
23. Esquema do Cenário
O cenário é o mesmo, mas os dados mudam!
São necessários inputs diferentes.
24. Esquema do Cenário
Cenário 1 - Somar
Dado que eu acesse a calculadora
Quando eu adicionar o valor 1
E apertar o botão de somar
E eu adicionar o valor 1
Então será exibido 2 como resultado
25. Esquema do Cenário
Cenário 2 - Subtrair
Dado que eu acesse a calculadora
Quando eu adicionar o valor 2
E apertar o botão de subtrair
E eu adicionar o valor 1
Então será exibido 1 como resultado
26. Esquema do Cenário
Cenário 3 - Multiplicar
Dado que eu acesse a calculadora
Quando eu adicionar o valor 4
E apertar o botão de multiplicar
E eu adicionar o valor 3
Então será exibido 12 como resultado
27. Esquema do Cenário
Cenário 4 - Dividir
Dado que eu acesse a calculadora
Quando eu adicionar o valor 4
E apertar o botão de dividir
E eu adicionar o valor 2
Então será exibido 2 como resultado
28. Esquema do Cenário
Dado que eu acesse a calculadora
Quando eu adicionar o valor <first_value>
E apertar o botão de <operation>
E eu adicionar o valor <second_value>
Então será exibido <result> como resultado
Exemplos:
| first_value | second_value| operation | result |
| 1 | 1 | sum | 2 |
| 2 | 1 | subtraction | 1 |
| 4 | 3 | multiplication| 12 |
| 4 | 2 | divide | 2 |
29. Boa prática
Menos é mais.
Você realmente
precisa testar
com tantos dados
assim?
Quaisquer tipo de
tabela é difícil de
ler. Use com
parcimônia.
Não tenha receio
de reescrever se
perceber que a
tabela está ficando
grande.
30. Tags
Tags are a great way to organise your features and
scenarios.
Referenciar para execução de um grupo de cenários
“Escopar” os hooks a grupos de cenarios
31. Tags
Referenciar para execução de um grupo de cenários
@calculator @fast @ready
Cenário: Fazer soma na calculadora web
Dado que eu acesse a calculadora
Quando eu adicionar o valor 1
E apertar o botão de somar
E eu adicionar o valor 1
Então será exibido 2 como resultado
33. Tags
Referenciar para execução de um grupo de cenários
@calculator
@wip and not @slow
@smoke and @fast
@calculator or @spreadsheet
34. Tags são herdadas pelos elementos filhos.
Tags que são colocadas na Funcionalidade serão
herdadas pelos Cenários, Esquemas de Cenário e
Exemplos.
Tags que são colocadas no Esquema do Cenário serão
herdadas pelos Exemplos.
Tags
Herança de tags
35. @calculadora
Funcionalidade: Calculadora online
@website_search @gui
Cenário: Buscar caneca no site
Dado que eu esteja no e-commerce do Ministry of Testing
Quando eu fizer uma busca por caneca
Então verei a página de busca mostrando os detalhes das canecas
Tags
Herança de tags
42. Boa prática
Separe arquivos
diferentes por
tipo de hook.
after_hooks.rb
before_hooks.rb
Não dê muita
responsabilidade
para os hooks. Eles
são invisíveis na
execução.
43. Nested Steps
Invocar um ou mais steps dentro de outro é um recurso
interessante para reaproveitar código.
44. Nested Steps
Dado("que a usuária {string} exista") do |user|
###
end
Dado("que eu faça login como {string}") do |user|
###
end
45. Nested Steps
Dado("que {string} esteja logada") do |user|
end
steps %{
que a usuária #{user} exista
que eu faça login como #{user}
}
46. Boa prática
Use com cuidado.
O acoplamento
fica muito forte
entre os steps.
Nested steps é
um ótimo recurso
para um baixo
nível de
reaproveitamento
e legibilidade.
50. Reports
After do |scenario|
if scenario.failed?
print_name = "#{scenario.name}.png"
Capybara.page.save_screenshot("reports/#{print_name}")
embed("reports/#{print_name}", "image/png","#{scenario.name}")
end
end
51. Boa prática
Os reports são
uma ótima forma
de compartilhar
os resultados dos
testes. Faça deles
seus aliados.
52. Retry
Se você tem um cenário flaky, o ideal é investigar a causa
e corrigir o mais rápido possível.
Mas quando não for possível, é necessário lidar com ele
sem impactar sua suíte toda.
54. Boa prática
Quanto mais
tentativas você
colocar, mais o
resultado do teste
vai demorar em
caso de falhas.
Configure seu CI
para avisar
quando flaky
cenários
ocorrerem.
55. World object
In Ruby, Cucumber runs scenarios in a World.
You can add any behaviour to the World, like helper
methods, or logging, etc.
57. Boa prática
Organize os
helpers em
arquivos e
módulos com
responsabilidades
claras.
Usar helpers ajuda
a manter o
desacoplado,
organizado e
reutilizável.
58. Page Objects
class Home < SitePrism::Page
set_url '/index.htm'
set_url_matcher(/google.com/?/)
element :search_field, 'input[name="q"]'
element :search_button, 'button[name="btnK"]'
end
59. Page Objects
The public methods represent the services that the page offers
Try not to expose the internals of the page
Generally don't make assertions
Methods return other PageObjects
Need not represent an entire page
Different results for the same action are modelled as different methods
60. Boa prática
Não faça
assertions nas
nas suas
PageObjects. Use
expectations a
seu favor.
Não retorne
PageObjects nos
métodos. O
Cucumber não vai
bem com esse
acoplamento.
61. Page Objects
class Home < SitePrism::Page
element :search_field, 'input[name="q"]'
def result_verify
# implementação, retorna true ou false
end
end
63. class Home < SitePrism::Page
element :search_field, 'input[name="q"]'
def result_verify
# implementação, retorna true ou false
end
end
Page Objects
68. Boa prática
É muito mais
tentador, mas
foque no
comportamento
da sua API, não na
implementação.
Organize os
payloads em
arquivos
separados dos
steps.
Crie seu API
objects para lidar
com cada
endpoint.
69. API Testing
Dado que eu me autentique na API do MoT
Quando eu fizer um post no endpoint “event/create”
Então o evento será criado
E o status retornado será 200
70. API Testing
Dado que eu me autentique na API do MoT
Quando eu enviar a criação de um novo evento
Então o evento será criado com sucesso
71. API Testing
Quando(“eu enviar a criação de um novo evento”) do
body = {
"id": "4",
"createdAt": "2019-03-18T08:14:59.675Z",
"name": "Handcrafted",
"local": "local 4"
}
end
76. API Testing
Quando(“eu enviar a criação de um novo evento”) do
body = File.read(‘create_body.json’)
api = MinistryOfTestingEventsAPI.new
response = api.create(body)
end
77. Dicas de ouro
Experimente
novas ideias e
abordagens.
Refatore seu
código sempre.
Comece simples
e pratique.
Compartilhe seus
aprendizados e
dúvidas com seu
time e com sua
comunidade.