Skip to content

Commit 73be345

Browse files
committed
Add a flag to turn off the auto refresh of PV status for tests.
1 parent 2aa323e commit 73be345

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

src/main/org/epics/archiverappliance/mgmt/staticcontent/js/mgmt.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,8 @@ function abortArchiveRequestFromDetails(pvName) {
251251
}
252252

253253

254-
var refreshPVStatus = false;
254+
var inRefreshPVStatus = false;
255+
var skipAutoRefresh = false;
255256

256257
// Displays the status of the PVs as typed in the #archstatpVNames textarea in the archstats table.
257258
function checkPVStatus() {
@@ -269,11 +270,14 @@ function checkPVStatus() {
269270
createReportTable(jsonurl, tabledivname,
270271
[{'srcAttr' : 'pvName', 'label' : 'PV Name'} ,
271272
{'srcAttr' : 'status', 'label' : 'Status', 'srcFunction' : function(curdata) {
273+
if(skipAutoRefresh) {
274+
return curdata.status;
275+
}
272276
if(curdata.status !== undefined && curdata.status != 'Being archived') {
273-
if(!refreshPVStatus) {
274-
refreshPVStatus = true;
277+
if(!inRefreshPVStatus) {
278+
inRefreshPVStatus = true;
275279
window.setTimeout(function() {
276-
refreshPVStatus = false;
280+
inRefreshPVStatus = false;
277281
checkPVStatus();
278282
}, 60*1000);
279283
}

src/test/org/epics/archiverappliance/mgmt/ArchiveFieldsWorkflowTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import org.junit.Before;
1010
import org.junit.Test;
1111
import org.openqa.selenium.By;
12+
import org.openqa.selenium.JavascriptExecutor;
1213
import org.openqa.selenium.WebDriver;
1314
import org.openqa.selenium.WebElement;
1415
import org.openqa.selenium.firefox.FirefoxDriver;
@@ -41,6 +42,7 @@ public void tearDown() throws Exception {
4142
@Test
4243
public void testArchiveFieldsPV() throws Exception {
4344
driver.get("http://localhost:17665/mgmt/ui/index.html");
45+
((JavascriptExecutor)driver).executeScript("window.skipAutoRefresh = true;");
4446
WebElement pvstextarea = driver.findElement(By.id("archstatpVNames"));
4547
String[] fieldsToArchive = new String[] {
4648
"UnitTestNoNamingConvention:sine",

0 commit comments

Comments
 (0)