SmokeTesting

SmokeTesting

What is Smoke Testing?

"Smoke testing" is the process of running automated user-interface-based tests.

How does one perform Smoke Tests?

Currently, Selenium is being explored as one means of running smoke tests against Mifos.

Selenium

Examples

  • bug 1572 repro. Set baseURL to http://test.mifos.org:8085/.

  • bug 1635 repro. Set baseURL to http://test.mifos.org:8085/.

  • SeedData (spikes/testscripts/Selenium/SeedData/SeedData.html in source control). Use a local Mifos instance. Adds all seed data necessary to create a loan, then creates and activates the loan. Database can be completely empty, but this is not required. Features tested:

    • logout

    • login

    • create loan product

    • create branch office

    • create loan officer

    • create center

    • create group

    • approve group

    • create client

    • approve client

    • create loan account

Pros

  • excellent IDE (actually just a Firefox plugin)

  • great documentation

  • many different ways to locate form fields, links, etc.

  • many bits of the rendered UI are easily accessible

  • Selenium API is consistent between IDE and exported Java code

  • exports to JUnit 3 style tests

  • exported JUnit 3 tests are easily converted to JUnit 4

  • repros with known test data on a particular server are easy to record

  • convenient complement to unit tests (not a replacement)

Interesting points

  • easy to see that Mifos has lots of invalid html

  • we should consider consistent use of "id" attributes

Cons

  • Selenium IDE isn't perfect; hand-editing is often required

    • XPath confusion example

      • Selenium IDE might record the following "clickAndWait" command target when clicking on a link: "//acontains(text(),'Add-n Group')". This is an XPath expression.

      • easier might be to just change the target to "link=Add Group"

      • even better would be to refer to the id attribute of the link, if present

    • however, it doesn't take long to get used to Selenium API

  • some Firefox plugins may conflict with Selenium IDE

    • "It's All Text!" renames "id" attribute and confuses Selenium IDE

  • SeedData needs slight modification to run on test server

    • "center" is called "kendra", for instance

  • how do you check HTTP status codes?

    • may not be necessary, actually

  • tests can be fragile if not designed well

  • doesn't address data aging

    • loan disbursals/payoffs

    • batch job runs

    • known sets of test data are needed for this

  • Waitr tests already exist for Mifos