Created
December 27, 2019 18:22
-
-
Save sweeneyapps/7509db56acf17ac0674d198efb4bba98 to your computer and use it in GitHub Desktop.
Login buttons for accessing various of customers account during test writing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==UserScript== | |
| // @name RF Accounts | |
| // @namespace http://tampermonkey.net/ | |
| // @version 0.1 | |
| // @description try to take over the world! | |
| // @author Paul Sweeney Jr. | |
| // @match https://app.rainforestqa.com/login | |
| // @grant none | |
| // ==/UserScript== | |
| (function() { | |
| 'use strict'; | |
| loginButtonFor("Customer 1", "[email protected]", "asdf1234"); | |
| loginButtonFor("Customer 2", "[email protected]", "asdf1234"); | |
| loginButtonFor("Customer 3", "[email protected]", "asdf1234"); | |
| function loginButtonFor(title, user, pass) { | |
| var centeredBox = document.querySelector("#sessions_controller_new > div.wrapper > div.login > div"); | |
| var button = document.createElement("button"); | |
| button.innerHTML = title; | |
| button.onclick = function() { | |
| login(user, pass); | |
| }; | |
| centeredBox.insertBefore(button, centeredBox.firstChild); | |
| } | |
| function login(user, pass) { | |
| var emailField = document.querySelector("#email"); | |
| var passwordField = document.querySelector("#password"); | |
| var loginButton = document.querySelector("#sessions_controller_new > div.wrapper > div.login > div > form > button"); | |
| emailField.value = user; | |
| passwordField.value = pass; | |
| loginButton.click(); | |
| } | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment