[BrowserTest] Update login tests to use api

This should make it possible to run all of the VE test suite
against an arbitrary wiki (with VE installed) including
the latest vagrant image with VisualEditor role enabled

Tested on the vagrant image and on beta labs

Change-Id: Ib249e4ffb607210756bb110187c7e2864b0c83f5
Merge "[BrowserTest] Update login tests to use api"