Moved Ruby code that multiple repositories use to mediawiki_selenium Ruby gem

Bug: 56088
Change-Id: Iaf33db440128c6be74bf47aecdf5e22bbe754b7a