From 76fa8af33ac56bc0505be0af7ef88259ea37663c Mon Sep 17 00:00:00 2001 From: Jerome Devost Date: Wed, 17 Oct 2018 20:52:42 -0400 Subject: [PATCH 1/3] Update to use matchPattern --- scenarios_examples/DemoMovies.json | 55 ++++++++++++++++++++++-------- 1 file changed, 40 insertions(+), 15 deletions(-) diff --git a/scenarios_examples/DemoMovies.json b/scenarios_examples/DemoMovies.json index dfbb5cc..37168f0 100644 --- a/scenarios_examples/DemoMovies.json +++ b/scenarios_examples/DemoMovies.json @@ -12,21 +12,46 @@ "timeBetweenActions": 1, "randomGoodQueries": [], "randomBadQueries": [], - "randomCustomData": [ - ], - "globalFilter": "NOT @mytype=Wikipedia", + "randomCustomData": [], + "globalFilter": "@mytype=Movie", "scenarios": [{ - "name": "(G) red willis", - "weight": 3, - "events": [{ - "type": "SearchAndClick", - "arguments": { - "queryText": "red willis", - "matchField": "title", - "matchRegex": "^RED( [0-9])?$", - "probability": 0.95 - } - }] - }] + "name": "(G) red willis", + "weight": 3, + "events": [{ + "type": "SearchAndClick", + "arguments": { + "queryText": "red willis", + "matchField": "title", + "matchPattern": "^RED( [0-9])?$", + "probability": 0.95 + } + }] + }, + { + "name": "(G) jason bourne", + "weight": 3, + "events": [{ + "type": "SearchAndClick", + "arguments": { + "queryText": "jason bourne", + "matchField": "title", + "matchPattern": " Identity$", + "probability": 1 + } + }] + }, + { + "name": "(G) balboa", + "weight": 3, + "events": [{ + "type": "SearchAndClick", + "arguments": { + "queryText": "balboa", + "docClickTitle": "Rocky", + "probability": 1 + } + }] + } + ] } \ No newline at end of file From 3fb022276d771a25ecaed9a6cf968782960f7d2d Mon Sep 17 00:00:00 2001 From: Jerome Devost Date: Wed, 17 Oct 2018 21:26:28 -0400 Subject: [PATCH 2/3] make sure event is flagged as uabot --- scenariolib/visit.go | 1 + 1 file changed, 1 insertion(+) diff --git a/scenariolib/visit.go b/scenariolib/visit.go index dcd7c27..12d6e0c 100644 --- a/scenariolib/visit.go +++ b/scenariolib/visit.go @@ -296,6 +296,7 @@ func (v *Visit) DecorateCustomMetadata(evt *ua.ActionEvent, customData map[strin evt.CustomData = map[string]interface{}{ "JSUIVersion": JSUIVERSION, "ipaddress": v.IP, + "c_isbot": true, } // Send all the possible random custom data that can be added from the config From 40bf011320c0b641b41e3a78be1faeee7118f895 Mon Sep 17 00:00:00 2001 From: Jerome Devost Date: Thu, 18 Oct 2018 14:44:14 -0400 Subject: [PATCH 3/3] Remove c_isbot and add it as RandomCustomData --- contributors.txt | 1 + scenariolib/visit.go | 1 - scenarios_examples/DemoMovies.json | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/contributors.txt b/contributors.txt index d35854e..3e05d50 100644 --- a/contributors.txt +++ b/contributors.txt @@ -1,4 +1,5 @@ "Etienne Rocheleau" +"Jerome Devost" "Francis Nadeau" "Pascal Soucy" "Adam Bolduc" diff --git a/scenariolib/visit.go b/scenariolib/visit.go index 12d6e0c..dcd7c27 100644 --- a/scenariolib/visit.go +++ b/scenariolib/visit.go @@ -296,7 +296,6 @@ func (v *Visit) DecorateCustomMetadata(evt *ua.ActionEvent, customData map[strin evt.CustomData = map[string]interface{}{ "JSUIVersion": JSUIVERSION, "ipaddress": v.IP, - "c_isbot": true, } // Send all the possible random custom data that can be added from the config diff --git a/scenarios_examples/DemoMovies.json b/scenarios_examples/DemoMovies.json index 37168f0..b7d2a92 100644 --- a/scenarios_examples/DemoMovies.json +++ b/scenarios_examples/DemoMovies.json @@ -12,7 +12,7 @@ "timeBetweenActions": 1, "randomGoodQueries": [], "randomBadQueries": [], - "randomCustomData": [], + "randomCustomData": [{"apiname": "c_isbot", "values": ["true"]}], "globalFilter": "@mytype=Movie", "scenarios": [{ "name": "(G) red willis",