Moved Ruby code that multiple repositories use to mediawiki_selenium Ruby gem

Bug: 56088
Change-Id: Ie4bb4690c72708a1616767463ff51b26c3a9c50b