Skip to content

Commit

Permalink
Merge pull request #304 from kelaberetiv/patch-289-295
Browse files Browse the repository at this point in the history
Potential fix for #289 and #295
  • Loading branch information
ryzalk authored Nov 10, 2018
2 parents 1789d68 + dbf3835 commit fb24db0
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 20 deletions.
10 changes: 5 additions & 5 deletions src/tagui_parse.php
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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() {".
Expand Down
29 changes: 14 additions & 15 deletions src/test/positive_test.signature
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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 = '';
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit fb24db0

Please sign in to comment.