function run($b, $debug = false) { $browser = Config::$BROWSERS[$b]; $host = $debug ? 'localhost' : $browser[0]; $path = $debug ? 'C:\\Documents and Settings\\shenlixia01\\Local Settings\\Application Data\\Google\\Chrome\\Application\\chrome.exe' : $browser[1]; $browserSet = array_key_exists('browserSet', $_GET) ? "^&browserSet=" . $_GET['browserSet'] : ''; $url = "http://" . $_SERVER['SERVER_ADDR'] . ($debug ? "" : ":8089") . substr($_SERVER['PHP_SELF'], 0, -11) . "/list.php?batchrun=true^&browser={$b}" . $browserSet; if (!array_key_exists("ci", $_GET)) { $url .= "^&mail=true"; } if (array_key_exists("filter", $_GET)) { $filterR = array_key_exists($b, $_GET) ? $_GET[$b] : $_GET['filter']; if (strstr($b, 'main') || strstr($b, 'supp')) { $url .= "^&filterRun={$filterR}^&filter={$_GET['filter']}"; } else { $url .= "^&filterRun={$_GET['filter']}^&filter={$_GET['filter']}"; } } // if( $b!='ie6') { if (array_key_exists('cov', $_GET)) { $url .= "^&cov={$_GET['cov']}"; } // } // else // $url .= "^&cov=true"; print $url; if ($b == 'baidu') { $url = "--'{$url}'"; } require_once 'lib/Staf.php'; $result = Staf::process_start($path, $url, $host); return $result; }
/** * 考虑单浏览器执行入口,从config提取浏览器ip信息,通过staf启动用例的执行 * @param $b * @param $filter * @param $debug */ function run($b, $release = false, $debug = false) { $browser = Config::$BROWSERS[$b]; $host = $debug ? 'localhost' : $browser[0]; $path = $debug ? 'C:\\Users\\yangbo\\AppData\\Local\\Google\\Chrome\\Application\\chrome.exe' : $browser[1]; $url = "http://" . $_SERVER['SERVER_ADDR'] . ($debug ? "" : ":8000") . substr($_SERVER['PHP_SELF'], 0, -11) . "/list.php?batchrun=true^&browser={$b}"; if (!array_key_exists("ci", $_GET)) { $url .= "^&mail=true"; } if ($release) { $url .= "^&release=true"; } if (array_key_exists("filter", $_GET)) { $url .= "^&filter={$_GET['filter']}"; } if (array_key_exists('cov', $_GET)) { $url .= "^&cov={$_GET['cov']}"; } // else // $url .= "^&cov=true"; if ($b == 'baidu') { $url = "--'{$url}'"; } require_once 'lib/Staf.php'; $result = Staf::process_start($path, $url, $host); // print $result; }
public static function StopAll() { $hostarr = array(); foreach (Config::$BROWSERS as $b => $h) { $host = $h[0]; if (array_search($host, $hostarr)) { continue; } array_push($hostarr, $host); require_once 'lib/Staf.php'; Staf::process_stop('', $host, true); Staf::process("free all"); } }
public static function StopOne($key) { $host = Config::$BROWSERS[$key][0]; require_once 'lib/Staf.php'; Staf::process_stop('', $host, true); }