codeforequity-at / botium-core

The Selenium for Chatbots - Bots Testing Bots
https://www.botium.ai
MIT License
229 stars 64 forks source link

Hyperlink check problem #373

Closed xmichele closed 5 years ago

xmichele commented 5 years ago

Describe the bug Hello I was initially useing botium-cli version of June with LINK feature working well. Recently I updated to botium-cli 0.5.4 and noticed that probably this keyword has been removd and replaced with HASLINK keyword provided by botium-asserter-basiclink. Now I got the error Cannot read property 'includes' of undefined , maybe caused by other npm WARN in installation phase.

Before running the test I run npm install --save botium-asserter-basiclink in my botium folder and added in my botium.json under myCapabilities:

"ASSERTERS": [{ "ref": "HASLINK", "src": "botium-asserter-basiclink" }]

I also checked https://npm.community/t/cannot-read-property-match-of-undefined/203

In my convo I have ..

bot

HASLINK https://myURLToCheck

Screenshots and Log files INSTALL PHASE . . npm WARN saveError ENOENT: no such file or directory, open '/app/package.json' npm notice created a lockfile as package-lock.json. You should commit this file. npm WARN enoent ENOENT: no such file or directory, open '/app/package.json' npm WARN botium-asserter-basiclink@0.0.6 requires a peer of botium-core@^1.5.4 but none is installed. You must install peer dependencies yourself. npm WARN app No description npm WARN app No repository field. npm WARN app No README data npm WARN app No license field.

Botium Version botium-cli 0.5.4

codeforequity-at commented 5 years ago

Thanks for the detailed explanation. In the Botium CLI, the latest version of the hyperlink asserter was not included. Please try again in a few minutes with the 0.0.55 build - you don't have to install the hyperlink asserter, it's included in the botium-cli. You can name it however you want, in the "ref" field in botium.json - "HASLINK" as well as "LINK", both are fine.

xmichele commented 5 years ago

Ok, I tryed HASLINK because LINK was no recognized as special keyword (i.e. normal text) However HASLINK and LINK are equivalent?

codeforequity-at commented 5 years ago

it depends how you named it in your botium.json - with ref you can assign whatever keyword you want for the asserter:

"ASSERTERS": [{
  "ref": "CHECK_THE_FCKING_LINKS",
  "src": "botium-asserter-basiclink"
}]
xmichele commented 5 years ago

tryed with new 0.0.55 and HASLINK. Seems to work well. The only problem is that if I put only a substring of the link provided from the chatbot, the test passes and passes also if it leads to 404 in a normal browser I'm using "SCRIPTING_MATCHING_MODE":"include" but I didn't thought it affects link checking feature

codeforequity-at commented 5 years ago

botium-asserter-basiclink is for assertions that a hyperlink matching the pattern is part of the bot reponse, nothing more. It uses the same matching logic as the text asserter. asserting that the link is actually pointing to a valid URL resource is part of the paid botium box plans.

xmichele commented 5 years ago

But for valid , didn't mean that response code is not 4xx as well?

codeforequity-at commented 5 years ago

no, it just asserts if the link is part of the bot response