Posts

Dry up your code: Decisive OR clause [2nd mile]

2 . Decisive OR clause Lets take step #3 of the same scenario: #1 - Given the "user" launches the app  #2 - When he logs in #3 - Then he sees the home page   Poss ible (logical) variation s o f step #3 could be # 3 .0 - Then he sees the home page         Def #1: T hen /^he sees the home page $/ do               @home_ page. should be _displayed             end          # 3 .1 -  Then he does not see the home page                 Def #2: T hen /^ he does not see the home page $/ do               @home_ page. should _not be _displayed             end  Now lets use the power of Decisive OR c lause to define the step as Def: T hen /^he ( sees|does not see) the home pa...

Dry up your code: Simple OR clause [1st mile]

1. Simple OR clause Consider the following scenario, #1 - Given the "user" launches the app  #2 - When he logs in #3 - Then he sees the home page Lets look at step #2 closer and identify possible variations of it #2.0 - When he logs in                 [Def #1: When /^he logs in$/ ] #2.1 - When "user" logs in           [Def #2: When /^"([^"]*)" logs in$/ ] #2.2 - When "admin" logs in        [Def #2: When /^"([^"]*)" logs in$/ ] #2.3 -  When she logs in              [Def #3: When /^she logs in$/ ] Believe me variation #2.3 will be used a lot if your team has a healthy gender ratio. Now do we need 3 step definitions to capture all the 4 variations. Nope (otherwise why am I writing this blog anyways :-) Step...

Childhood, why is it still uncomparable ??? [2nd Mile]

If successful in missing the eyes and more painful sticks, never have we missed the opportunity to claim ourselves as masters of disguise Interesting as it gets when called to assemble, especially when cosmetic powder does more whitening to the canvas than our faces. The usual drill again except for the daily news, which though inspired to read the newspaper, perhaps was not so successful even today.  Near the main gate can be seen friendly faces which were getting more nervous by every ticking second, fearful of the anticipated encounter for being late. May be it was one other reason to proclaim a holiday if the school bus fails to turn up on any given day. Then comes the realization of what awaits us, if the cosmetics do no magic that day and the canvas winks to be seen by the strict eyes, or locally known as PT staff. As we disperse, the gravity of the situation forces me to rush-up but the mind says to play it low to avoid being caught. Clouds of fear ...

Childhood, why is it still uncomparable ??? [1st Mile]

“Those were days when sunlight was never enough. An average day started with regrets for boarding school bus, if not for friends and a few encouraging teachers…” An average day starts with the sound I am still allergic to, blowing of the alarm. A moment of regret and a swift reflex act of silencing the source, acts as a kick to mark the start of the day. Nevertheless one of the greatest wonders by God, the sun, as we call it, does again the magic of peeping through the window to light the day with a welcome note. To please the Creator and get the day blessed, the lips start to chant a set of daily prayers in the usual order. Once done with brushing, comes the duty of the brotherhood, waking the sleeping angel, my sister. In the next 10 mins, everything has to be done to embrace the uniform followed by tying of the canvas knot. As mom rushes to make the lunch and break the haziness of my sister, dad volunteers inking the pen. Once packing is complete, starts the run of the day to r...

All Thy works shall praise Thee, O LORD

Image