Skip to content

optimize bug-find rate, regress less and execute fast

Notifications You must be signed in to change notification settings

gkushang/assert-collector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Assert Collector

Optimize bug-find rate, Regress Less and Execute Fast

Build Status Coverage Status Codacy Badge

What is Assert Collector?

Do you have late regressions? What if your regression finds more bugs from a single run? Assert Collector does it.

Traditional Assertions exit from your scenario when it finds the first bug, but Assert Collector does not. It finds a bug and continues to find more bugs. The best use cases are the verifications of UI & JSON Objects!

Assert Collector is built on top of Hamcrest Matchers interface.

How to use?

Please see the detailed example test-case for more info.

Step 1: Import AssertCollector to your workspace. Use veirfyThat in-place of assertThat of Hamcrest. The rest of the interface is Hamcrest.

   
    verifyThat( "Firstname is invalid", something.getFirstname(), is( "validFirstname" ) );
   

Step 2: throwAnyFailures will throw all the failures at once, if there were any. Use it whenever required.

   
    verifyThat( "Firstname is invalid", something.getFirstname(), is( "validFirstname" ) );
    verifyThat( "Lastname is invalid", something.getLastname(), is( "invalidLastname" ) );
    verifyThat( "Username is invalid", something.getUsername(), is( "invalidUsername" ) );
    
    throwAnyFailures(); // will throw two failures. Lastname is invalid & Username is invalid
   

Step 3: Put throwAnyFailures in @After hook. All remaining failures will be thrown by After hook, if there were any.

@After
public void tearDown()
{
    ...
    ...
    
    throwAnyFailures();
}

About

optimize bug-find rate, regress less and execute fast

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages