diff --git a/src/tagui_parse.php b/src/tagui_parse.php index 57dcd25c..c55009a6 100755 --- a/src/tagui_parse.php +++ b/src/tagui_parse.php @@ -16,7 +16,7 @@ $header_file = fopen('tagui_header.js','r') or die("ERROR - cannot open tagui_header.js" . "\n"); $footer_file = fopen('tagui_footer.js','r') or die("ERROR - cannot open tagui_footer.js" . "\n"); -$repo_count = 0; if (file_exists(getenv('custom_csv_file'))) { // load repository file for objects and keywords +$repo_count = 0; if (file_exists(getenv('custom_csv_file'))) { // load datatable or legacy datatable / repository $repo_file = fopen(getenv('custom_csv_file'),'r') or die("ERROR - cannot open " . getenv('custom_csv_file') . "\n"); while (!feof($repo_file)) {$repo_data[$repo_count] = fgetcsv($repo_file); if (count($repo_data[$repo_count]) == 0) die("ERROR - empty row found in " . getenv('custom_csv_file') . "\n"); @@ -26,7 +26,7 @@ $local_repo_location = str_replace("\\","/",dirname($script)) . '/tagui_local.csv'; if (file_exists($local_repo_location)) { // load local repository file if it exists for objects and keywords $local_repo_file = fopen($local_repo_location,'r') or die("ERROR - cannot open " . 'tagui_local.csv' . "\n"); -$repo_count++; fgetcsv($local_repo_file); // increase repo_count to prep for read, discard header record +if ($repo_count != 0) $repo_count++; fgetcsv($local_repo_file); // +1 if array has data, discard header record while (!feof($local_repo_file)) {$repo_data[$repo_count] = fgetcsv($local_repo_file); if (count($repo_data[$repo_count]) == 0) die("ERROR - empty row found in " . 'tagui_local.csv' . "\n"); if (count($repo_data[$repo_count]) != 1) // pad the empty columns when local repository is used with datatable @@ -35,7 +35,7 @@ if (file_exists('tagui_global.csv')) { // load global repository file if it exists for objects and keywords $global_repo_file = fopen('tagui_global.csv','r') or die("ERROR - cannot open " . 'tagui_global.csv' . "\n"); -$repo_count++; fgetcsv($global_repo_file); // increase repo_count to prep for read, discard header record +if ($repo_count != 0) $repo_count++; fgetcsv($global_repo_file); // +1 if array has data, discard header record while (!feof($global_repo_file)) {$repo_data[$repo_count] = fgetcsv($global_repo_file); if (count($repo_data[$repo_count]) == 0) die("ERROR - empty row found in " . 'tagui_global.csv' . "\n"); if (count($repo_data[$repo_count]) != 1) // pad the empty columns when global repository is used with datatable @@ -803,9 +803,9 @@ function wait_intent($raw_intent) { $params = trim(substr($raw_intent." ",1+strpos($raw_intent." "," "))); if ($params == "") $params = "5"; if (strpos($params,"'+")!==false and strpos($params,"+'")!==false) // handling for dynamic time return "casper.then(function() {". -"techo('".$raw_intent."');});\ncasper.wait((parseFloat('".$params."')*1000), function() {"."});"."\n\n"; +"techo('".$raw_intent."');});\ncasper.then(function() {casper.wait((parseFloat('".$params."')*1000), function() {"."});});"."\n\n"; else return "casper.then(function() {". -"techo('".$raw_intent."');});\ncasper.wait(" . (floatval($params)*1000) . ", function() {"."});"."\n\n";} +"techo('".$raw_intent."');});\ncasper.then(function() {casper.wait(" . (floatval($params)*1000) . ", function() {"."});});"."\n\n";} function live_intent($raw_intent) { // live mode to interactively test tagui steps and js code (casperjs context) return "casper.then(function() {". diff --git a/src/test/positive_test.signature b/src/test/positive_test.signature index 99a64d70..974fbdb1 100644 --- a/src/test/positive_test.signature +++ b/src/test/positive_test.signature @@ -1315,7 +1315,6 @@ function getTimeoutAndCheckNextStepFunction(timeout, then, methodName, defaultTi return timeout; } - // flow path for save_text and snap_image var flow_path = '/full_path'; @@ -2490,43 +2489,43 @@ if (resource.url.indexOf('report') > -1) this.download(resource.url, '/tmp/filen // test wait casper.then(function() {techo('wait');}); -casper.wait(5000, function() {}); +casper.then(function() {casper.wait(5000, function() {});}); casper.then(function() {techo('wait 2.5');}); -casper.wait(2500, function() {}); +casper.then(function() {casper.wait(2500, function() {});}); casper.then(function() {techo('wait 10.0');}); -casper.wait(10000, function() {}); +casper.then(function() {casper.wait(10000, function() {});}); casper.then(function() {techo('wait 10');}); -casper.wait(10000, function() {}); +casper.then(function() {casper.wait(10000, function() {});}); casper.then(function() {techo('wait 10s');}); -casper.wait(10000, function() {}); +casper.then(function() {casper.wait(10000, function() {});}); casper.then(function() {techo('wait 10sec');}); -casper.wait(10000, function() {}); +casper.then(function() {casper.wait(10000, function() {});}); casper.then(function() {techo('wait 10secs');}); -casper.wait(10000, function() {}); +casper.then(function() {casper.wait(10000, function() {});}); casper.then(function() {techo('wait 10seconds');}); -casper.wait(10000, function() {}); +casper.then(function() {casper.wait(10000, function() {});}); casper.then(function() {techo('wait 10 s');}); -casper.wait(10000, function() {}); +casper.then(function() {casper.wait(10000, function() {});}); casper.then(function() {techo('wait 10 sec');}); -casper.wait(10000, function() {}); +casper.then(function() {casper.wait(10000, function() {});}); casper.then(function() {techo('wait 10 secs');}); -casper.wait(10000, function() {}); +casper.then(function() {casper.wait(10000, function() {});}); casper.then(function() {techo('wait 10 seconds');}); -casper.wait(10000, function() {}); +casper.then(function() {casper.wait(10000, function() {});}); casper.then(function() {techo('wait 7.5 seconds');}); -casper.wait(7500, function() {}); +casper.then(function() {casper.wait(7500, function() {});}); // test live casper.then(function() {{var live_input = ''; @@ -2936,7 +2935,7 @@ start = timer() }); // end of JS code casper.then(function() {techo('wait 3 seconds');}); -casper.wait(3000, function() {}); +casper.then(function() {casper.wait(3000, function() {});}); casper.then(function() { // start of JS code time_taken = timer()