Refactor evaluator functions in JSON examples to use URL pattern matching. Update expected URL formats to regex patterns for better validation in chrome evaluation examples.
This commit is contained in:
@@ -43,7 +43,7 @@
|
|||||||
"chrome"
|
"chrome"
|
||||||
],
|
],
|
||||||
"evaluator": {
|
"evaluator": {
|
||||||
"func": "is_expected_active_tab",
|
"func": "is_expected_url_pattern_match",
|
||||||
"result": {
|
"result": {
|
||||||
"type": "active_url_from_accessTree",
|
"type": "active_url_from_accessTree",
|
||||||
"goto_prefix": "https://www."
|
"goto_prefix": "https://www."
|
||||||
@@ -51,8 +51,9 @@
|
|||||||
"expected": {
|
"expected": {
|
||||||
"type": "rule",
|
"type": "rule",
|
||||||
"rules": {
|
"rules": {
|
||||||
"type": "url",
|
"expected": [
|
||||||
"url": "https://www.dmv.virginia.gov/licenses-ids/license/applying/eligibility"
|
"^https://(www\\.)?dmv\\.virginia\\.gov/licenses-ids/license/applying/eligibility"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -44,37 +44,35 @@
|
|||||||
],
|
],
|
||||||
"evaluator": {
|
"evaluator": {
|
||||||
"func": [
|
"func": [
|
||||||
"exact_match",
|
"is_expected_url_pattern_match",
|
||||||
"exact_match"
|
"is_expected_url_pattern_match"
|
||||||
],
|
],
|
||||||
"conj": "or",
|
"conj": "or",
|
||||||
"result": [
|
"result": [
|
||||||
{
|
{
|
||||||
"type": "url_dashPart",
|
"type": "active_url_from_accessTree",
|
||||||
"goto_prefix": "https://www.",
|
"goto_prefix": "https://www."
|
||||||
"partIndex": -1,
|
|
||||||
"needDeleteId": false,
|
|
||||||
"returnType": "string"
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "url_dashPart",
|
"type": "active_url_from_accessTree",
|
||||||
"goto_prefix": "https://www.",
|
"goto_prefix": "https://www."
|
||||||
"partIndex": -1,
|
|
||||||
"needDeleteId": false,
|
|
||||||
"returnType": "string"
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"expected": [
|
"expected": [
|
||||||
{
|
{
|
||||||
"type": "rule",
|
"type": "rule",
|
||||||
"rules": {
|
"rules": {
|
||||||
"expected": "tamiflu.html#side-effects"
|
"expected": [
|
||||||
|
"^https://(www\\.)?drugs\\.com/tamiflu\\.html#side-effects"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "rule",
|
"type": "rule",
|
||||||
"rules": {
|
"rules": {
|
||||||
"expected": "tamiflu-side-effects.html"
|
"expected": [
|
||||||
|
"^https://(www\\.)?drugs\\.com/sfx/tamiflu-side-effects\\.html"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user