Functional test for badges updated

I also added some new useful step for testing purpose.