Skip to content

Commit

Permalink
Add a flag to turn off the auto refresh of PV status for tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
slacmshankar committed May 10, 2016
1 parent 2aa323e commit 73be345
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,8 @@ function abortArchiveRequestFromDetails(pvName) {
}


var refreshPVStatus = false;
var inRefreshPVStatus = false;
var skipAutoRefresh = false;

// Displays the status of the PVs as typed in the #archstatpVNames textarea in the archstats table.
function checkPVStatus() {
Expand All @@ -269,11 +270,14 @@ function checkPVStatus() {
createReportTable(jsonurl, tabledivname,
[{'srcAttr' : 'pvName', 'label' : 'PV Name'} ,
{'srcAttr' : 'status', 'label' : 'Status', 'srcFunction' : function(curdata) {
if(skipAutoRefresh) {
return curdata.status;
}
if(curdata.status !== undefined && curdata.status != 'Being archived') {
if(!refreshPVStatus) {
refreshPVStatus = true;
if(!inRefreshPVStatus) {
inRefreshPVStatus = true;
window.setTimeout(function() {
refreshPVStatus = false;
inRefreshPVStatus = false;
checkPVStatus();
}, 60*1000);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import org.junit.Before;
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
Expand Down Expand Up @@ -41,6 +42,7 @@ public void tearDown() throws Exception {
@Test
public void testArchiveFieldsPV() throws Exception {
driver.get("http://localhost:17665/mgmt/ui/index.html");
((JavascriptExecutor)driver).executeScript("window.skipAutoRefresh = true;");
WebElement pvstextarea = driver.findElement(By.id("archstatpVNames"));
String[] fieldsToArchive = new String[] {
"UnitTestNoNamingConvention:sine",
Expand Down

0 comments on commit 73be345

Please sign in to comment.