Skip to content

Commit

Permalink
#68 - supporting flow files in other languages
Browse files Browse the repository at this point in the history
- move flow_language variable from tagui_header.js to tagui_config.txt
for easy configuration
- fix regression on test mode string replacement due to multi-language
change in tagui_header.js
  • Loading branch information
kensoh committed Nov 12, 2017
1 parent 4abf56a commit c08e0e8
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
3 changes: 3 additions & 0 deletions src/tagui_config.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
// TagUI web automation browser settings
// verbose style to support tester module

// set default flow language
var flow_language = 'english';

// set time in ms before error out
casper.options.waitTimeout = 10000;
casper.options.logLevel = 'debug';
Expand Down
3 changes: 0 additions & 3 deletions src/tagui_header.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ var timer_start_time = Date.now();
// initialise default global variables
var quiet_mode = false; var save_text_count = 0; var snap_image_count = 0;

// initialise default flow language
var flow_language = 'english';

// counters for tracking messages in sikuli and chrome integrations
var sikuli_count = 0; var chrome_id = 0;

Expand Down
5 changes: 3 additions & 2 deletions src/tagui_parse.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,9 @@
$script_content = str_replace("techo('FINISH - automation","dummy_echo('FINISH - test",$script_content); // silent
$script_content = str_replace("this.echo(","test.comment(",$script_content); // change echo to test comment
$script_content = str_replace("test.comment('ERROR","test.fail('ERROR",$script_content); // error comment to fail
$script_content = str_replace("if (!quiet_mode) casper.echo(echo_string);",
"if (!quiet_mode) casper.test.comment(echo_string);",$script_content); // change echo to test comment in techo
// change echo to test comment in techo to show output correctly as test comments
$script_content = str_replace("casper.echo(echo_string);","casper.test.comment(echo_string);",$script_content);
$script_content = str_replace("casper.echo(translated_string);","casper.test.comment(translated_string);",$script_content);
$script_content = str_replace("\\n'","'",str_replace("'\\n","'",$script_content)); // compact test output
// casperjs testing does not allow creation of casper object as it is already created by test engine
$script_content = str_replace("var casper = require(","// var casper = require(",$script_content);
Expand Down
6 changes: 3 additions & 3 deletions src/test/positive_test.signature
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ var casper = require('casper').create();
// TagUI web automation browser settings
// verbose style to support tester module

// set default flow language
var flow_language = 'english';

// set time in ms before error out
casper.options.waitTimeout = 10000;
casper.options.logLevel = 'debug';
Expand Down Expand Up @@ -40,9 +43,6 @@ var timer_start_time = Date.now();
// initialise default global variables
var quiet_mode = false; var save_text_count = 0; var snap_image_count = 0;

// initialise default flow language
var flow_language = 'english';

// counters for tracking messages in sikuli and chrome integrations
var sikuli_count = 0; var chrome_id = 0;

Expand Down

0 comments on commit c08e0e8

Please sign in to comment.