Professional Documents
Culture Documents
9 days
Agenda Today's session:
-----------------------
Software Testing:
-----------------
- is the process of evaluating a system to find
bugs
- is performed to check if the system satisfies it's
specified requirements
- completeness, usability, performance and other
functional and non-functional attributes
- validation, verification
- why testing
SDLC ( Software Development Life Cycle)
- Waterfall Model
- Requirements analysis
- planning
- implementing
- testing
- integration
- production
- to avoid defects
- result into less cost and resource
utilization
Junit:
------
- to test method functionality
- using normal java project
- using maven tool
- jars
- junit
- hamcrest-core
- using annotation
- @Test
- Before
- BeforeClass
- After
- AfterClass
- Ignore
- Testing levels:
-----------------
- functional testing
- each function of that application
- Unit Testing
- Integration Testing
- Smoke Testing
- Sanity Testing
- System Testing
- UAT
- Testing Methods:
-------------------
- Black Box Testing
- also known as functional testing
without knowing the intrnal codes and
structure of the program
Summary:
---------
- s/w testing
- why testing is required
- who does testing
- defect
- defect life cycle
- Steps in manual testing process
- created and executed test cases written using
junit
- Testing levels
- Testing methods
black box, white box, gray box
Day - 2:
--------
- TDD
- BDD
- Cucumber
- Gherkin
- Set up cucumber with Eclipse
Features of BDD:
----------------
- collaboration between business stakeholders,
business analysts, QA team and developers
- BDD Tools
Cucumber
SpecFlow
- What is cucumber
- Cucumber is a testing framework which supports
BDD.
- define application behaviour in meaningful
english text using a simple grammar defined by
a language called Gherkin
- Gherkin
- Cucumber is written in Ruby.
- it can be used to test code written in Ruby or
other languages like java, c#, python etc.
- Why BDD:
----------
- assume there is a requirement from a client for
an e-commerce website to increase the sales of the
product.
Architect:
Requierment analysis
planning
developer:
implementing
Tester:
testing
Wrong perception:
Example of a Cucumber
----------------------
Feature: Sign up
Scenario: Successful sign up
Given I have to sign up
When I sign up with valid details
Then I should recieve a confirmation mail
feature file
Gherkin:
--------
- search box
- search for product iphone x
- will return results contains all products
iphone
ione
- key points
* the test is written in plain english which is
common to all the domains
- Java
- Eclipse or STS
-
Cucumber Jars:
--------------
1. cucumber-core
2. cucumber-java
3. cucumber-junit
4. cucumber-jvm-deps
5. cucumber-reporting
6. gherkin
7. junit
8. mockito-all
9. cobertura
bddtestingapp
folder name: Feature
calculator.feature
STS or Eclipse:
---------------
- cucumber plugin
Maven Project:
--------------
- dependencies to added to pom.xml
Summary:
--------
- TDD
- BDD
- Why BDD
- Cucumber
- Gherkin
- Set up cucumber with STS or Eclipse
Feature:
Scenario:
Given
Then
Gherkin:
---------
Gherkin is a simple, lightweight and structured
language
Day - 3:
---------
- cucumber feature file
- Junit Test Runner class
- Gherkin keywords
- Step definitions
- Cucumber options
- keywords:
------------
- Feature: defines what feature you will be testing
- Scenario: title of the test
- Given: tells the pre-condition of the test
- When: additional condtions
- Then: post condition expected outcome
Gherkin:
---------
- A language above is called gherkin
- it implements the principles of BRDSL
Business Readable Domain Specific Language
Day - 4:
--------
- Gherkin keywords
- Cucumber options
- Data tables
- Cucumber Hooks
Gherkin Keywords:
------------------
Feature:
---------
- Each Gherkin file begins with a Feature keyword.
- Feature defines the logic test functionality you
will test in this feature
- If you are testing payment gateway your
Feature will become Payment Gateway
Feature: Payment Gateway
- idea of having a feature file is to put down
a summary of what you will be testing
Feature: Login Action Test
or
Feature: Login Action Test
Description: This feature will test a login
and logout functionality
or
Feature: Login Action Test
This feature will test a login and logout
functionality
Background:
-----------
- Bakcground keyword is used to define steps which
are common to all the tests in a feature file.
- Navigate to Home page
- Click on the login link
- enter username and password
- click on sumbit
Scenario: signup
given signup page
when user enters user and pass
Then registered
Scenario: login
given: login page
when user enters user and pass
then user logged in successfully
Scenario:
---------
each feature file will contain some number of tests
to test the feature.
Each test is called a scenario
- is equivalent to a test in our regular dev
process
- can break this into 3 parts
1. pre-condition (Given)
2. Test step excution (When)
3. Verification of the output with
expected result
- Given:
--------
- Given defines a pre-condition test.
Given User is on Home Page
- When
-------
- defines test action that will be executed
- Then:
-------
- defines the outcome of previous steps
Feature: Login
Scenario: Login with valid credentials
Given User is on home page
When user navigate to login page
And user enters username and password
And user has to be validate
Then message displayed successfully
And:
----
- is used to add conditions to youre steps
But:
----
Feature: Login
Scenario: Login with valid credentials
Given User is on home page
When user navigate to login page
And user enters username and password
And user has to be validate
But the user is invalid
Then message displayed wrong username & pass
*:
-
Feature: Login
Scenario: Login with valid credentials
* User is on home page
* user navigate to login page
* user enters username and password
* user has to be validate
* the user is invalid
* message displayed wrong username & pass
Gherkin Keywords:
==================
- Feature
- Scenario
- Given
- When
- And
- But
- Then
- *
"""
cucumber feature file contains
one or more scenarios
"""
Cucumber options:
------------------
- In layman language @CucumberOptions are like
property file or settings for your test
Feature: Calculator
Scenario: Addition to two values
Given two values
When I add two values
Then result is sum of two values
Summary:
--------
- Gherkin keywords
- Cucumber Options
- Data tables
- scenario outline with examples keyword
- scenario witout examples keyword
- passing data to the scenario
- maps in cucumber
passing map as data to the scenario
without examples keyword