fitnesse n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
FitNesse PowerPoint Presentation
Download Presentation
FitNesse

Loading in 2 Seconds...

play fullscreen
1 / 30

FitNesse - PowerPoint PPT Presentation


  • 176 Views
  • Uploaded on

FitNesse. Authors: Nghia Pham. Agenda. FitNesse Fit and Slim How to write Test Cases Connect DataBase with Fit SSH with Slim. FitNesse – A brief intro. FitNesse – A brief intro. What is FitNesse ? A web server A wiki A tool for enhancing collaboration in software development

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'FitNesse' - shad-roach


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
fitnesse

FitNesse

Authors: Nghia Pham

agenda
Agenda
  • FitNesse
  • Fit and Slim
  • How to write Test Cases
  • Connect DataBase with Fit
  • SSH with Slim
fitnesse a brief intro1
FitNesse – A brief intro

What is FitNesse?

  • A web server
  • A wiki
  • A tool for enhancing collaboration in software development
  • A software testing tool
    • Define Acceptance Tests (simple tables(input, output))
    • It supports Java (native), .Net, C++ …
    • It provides a simple way to run tests (tables) and suits
fitnesse a brief intro2
FitNesse – A brief intro
  • Fitnesse is not
    • An automation tool with interface capturing ability
    • An automation tool with web browser driving ability
  • But there’re such tools that work with Fitnesse
fitnesse a brief intro3
FitNesse – A brief intro

Table-based approach for acceptance testing

  • Starting from a user story, the customer enters in a table (spreadsheet) the expectations of the program’s behavior.
  • At this point tables can be used as oracle. The customer can manually insert inputs in the System and compare outputs with expected results.
fit and slim
Fit and Slim

Slim

Fit

No, we’re not talking about

this kind of Fit and Slim

fit and slim1
Fit and Slim

Fit (Framework for Integrated Test)

and

Slim (Simple List Invocation Method)

are two different ways (test engines) to do automation testing with FitNesse

fit and slim2
Fit and Slim

Fit

Slim

Developed later as an alternative to Fit

  • Born with Fitnesse
  • Developers write “fixtures” to link the test cases with the actual system itself
  • Developers write “fixtures” to link the test cases with the Slim Executor
  • Fit compares these test cases with actual values returned by the system, and highlights the results with colors and annotations
  • All the HTML processing, comparisons, and colorizing are run on Fitnesse server
fit and slim3
Fit and Slim

Fit

Slim

All the features are on the FitNesse server, so test tables remain consistent regardless of the platform of the SUT

  • Fixture code is run on the system under test (SUT), so it depends on the system
  • Lots of differences between implementations in Java, .NET, Python
  • No need to import fixture class, common syntax, common fixture types
  • Fit has not been developed for a while
  • Slim is in active development
how to
How to…
  • How to…

It’s demo time

how to install fitnesse
How to install Fitnesse

Software requirement:

  • Oracle JDK for your platform from http://www.oracle.com/technetwork/java/javase/downloads/index.html
  • Eclipse for Java EE from http://www.eclipse.org/downloads/
  • Latest fitnesse.jar from http://www.fitnesse.org/FrontPage.FitNesseDevelopment.DownLoad
how to run fitnesse
How to run Fitnesse
  • Create a “StartFitnesse.bat” in the same folder with “fitnesse.jar”
  • Create its content using the syntax:

java -jar [path]\fitnesse.jar -p port_number

Ex: java -jar d:\fitnesse.jar -p 9999

  • Double click the bat file to start Fitnesse server
  • Open a web browser and navigate to http://localhost:9999/
how to create a page
How to create a page
  • Every Fitnesse page must has a name inCamel-Case format.

Ex: TestPage, OneMorePage, LastOneHere

  • Create a root page (no parent):
    • Put the page name in an existing page where you want to create a link to it, prefix the name with a dot “.”
    • Click the [?] next to the page name to create content for the page. The page name above will become a link
  • Create a child page:
    • Click [add child] link next to the parent page title and enter the child page name
    • Create a link for the page or it will become a lost page
how to create a table
How to create a table

Create a table in Fitnesse

  • The first cell contains the table name
  • Design the table in a spreadsheet
  • Open Edit mode of a page
  • Copy and paste the table here
  • Click “Spreadsheet to Fitnesse” button
  • Save changes
how to create a slim fixture
How to create a Slim fixture

Create Slim fixture for Decision table

  • Open Eclipse, create a new Java project
  • Add a new package, give it any name you like
  • Add a new class in the package. Its name must be the same as the table you want to link to
  • Add methods for input and output columns
    • Output method has the same name as its column. It returns the expected result.
    • Input method has prefix “set” before its column name. It takes in the value of the column.
  • Set path to the “bin” folder of the project in the test page and import the package above
how to use external library
How to use external library
  • To use an external library
    • Add the library to the Java project (fixture code). Import its classes and use however you like
    • Set the path to the external library in the test pages that require this library
    • It’s as simple as that
  • Demo Keyword-driven test with Selenium Web-Driver library
connect database with fit
Connect Database with Fit
  • To use an external library
    • Step 1: Create DataBase in FitFitNesseDemo page
    • Step 2: Edit content in DataBase page

>MySql

>SetUp

>SuiteSetUp

>TearDown

>InterFaces

connect database with fit1
Connect Database with Fit
  • To use an external library
    • Step 4: Create a new page in Interfaces
    • Step 5: Declare some variables in DatabaseVariables

!define host {localhost}

!define schema {automation}

!define user {root}

!define pass {root}

connect database with fit2
Connect Database with Fit
  • To use an external library
    • Step 6: Create a new page “ConnectionDataBase” in MySql
    • Step 7: Change properties in ConnectionDataBase page from Default to Test type
connect database with fit3
Connect Database with Fit
  • Step 8: Edit ConnectDataBase

!*****> Import Interfaces in the SimpleSelect

!include .FitFitNesseDemo.AdminPortal.InterFaces.GlobalVariables

!include .FitFitNesseDemo.AdminPortal.InterFaces.LogInPage

!include .FitFitNesseDemo.DataBase.InterFaces.DatabaseVariables

*****!

!*****> Define to call multiple fixtures:

|''add''|!-dbfit.MySqlTest-!|''as''|database|

|''add''|!-fitlibrary.spider.SpiderFixture!|''as''|spider|

*****!

!*****> Connect to database

!|Connect|${host}|${user}|${pass}|${schema}|

*****!

connect database with fit4
Connect Database with Fit
  • Step 8: Edit ConnectDataBase

!*****> Query to get username and password in database

|''select''|database|

!3 Simple Select

|query| SELECT username FROM user WHERE role='${roleName}'|

|username?|

|>>account|

|query| SELECT password from person where id =(SELECT person_id FROM `user` WHERE role='${roleName}')|

|password?|

|>>password|

*****!

!*****> Set username and password  

|set|username|get symbol named|account|

|set|password|get symbol named|password|

*****!

connect database with fit5
Connect Database with Fit
  • Step 8: Edit ConnectDataBase

!*****> Query to get username and password in database

|''select''|database|

!3 Simple Select

|query| SELECT username FROM user WHERE role='${roleName}'|

|username?|

|>>account|

|query| SELECT password from person where id =(SELECT person_id FROM `user` WHERE role='${roleName}')|

|password?|

|>>password|

*****!

!*****> Set username and password  

|set|username|get symbol named|account|

|set|password|get symbol named|password|

*****!

ssh with slim
SSH with Slim
  • To use an external library
    • Step 1: Add “jsch.jar” and “remote-api.jar” library to our lib folder.
    • Step 2: Create SlimFitNesseDemo page
ssh with slim1
SSH with Slim
  • Step 3: Config in SlimFitNesseDemo page

>Ssh

!path lib/*.jar

!define TEST_SYSTEM {slim}

!define COLLAPSE_SETUP {true}

!define COLLAPSE_TEARDOWN {true}

  • Step 4: Create SlimFitNesseDemo page
ssh with slim2
SSH with Slim
  • Step 3: Config in SlimFitNesseDemo page

|import|

|com.cisco.tcbu.automation.ssh|

!*****> Execute a command by ssh

|Script|Ssh On Fitnesse|192.168.170.228|

|check|connect|root |true|

|check|exec|ls -la|0|

|check|exec|cd folder|1|

|check|exec|ls -a --color=never|0|

|$check=|exec|tail -30 ../var/log/messages.log|

|check|disconnect|false|

**********!

ssh with slim3
SSH with Slim
  • Step 4: Run the test case