QA: porting login test from /qa/browsertests

Tested in local bare wiki, beta hewiki and enwiki

Change-Id: Icf060de7697cb43d9a8d28c036d4efcbdfd64720
Merge "QA: porting login test from /qa/browsertests"