Last active
August 29, 2015 14:22
-
-
Save Artur-/e5e4b23d6dcd53c90072 to your computer and use it in GitHub Desktop.
Open test for Gerrit change
This file contains 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
var hostname="172.16.11.253"; | |
var changeId=document.evaluate("//a[contains(@title,'Reload the change')]",document.body).iterateNext().innerText; | |
var patchSet = document.body.innerText.match("Patch Sets \\(\\d+/(\\d+)\\)")[1]; | |
var testClass; | |
try { | |
var file = document.evaluate("//td[text()='A']/..//a[contains(text(),'Test.java')]",document.body).iterateNext().innerText; | |
var start = file.lastIndexOf("/")+1; | |
var end = file.lastIndexOf("Test.java"); | |
testClass = file.substring(start,end); | |
} catch (e) { | |
testClass = window.prompt("Test name"); | |
} | |
if (testClass) { | |
var testUrl = "http://"+hostname+":8080/test-"+changeId+"-"+patchSet+"/run/"+testClass+"?restartApplication&debug"; | |
window.open(testUrl); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment