Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(testing): fix testing module not working #11687

Merged
merged 1 commit into from
Apr 1, 2022

Conversation

laurentlp
Copy link
Contributor

This PR basically fixes the recording and running part of the testing module.

Since we made changes to the channel-web and uses this module to record scenarios, I had to fetch the user mapping so we can properly validate the event target. Also, instead of using the channel web when running the scenario, we now use an imaginary testing module (hopefully no one uses the testing channel as a real module)!

I will convert the JSX files in another PR.

Closes botpress/v12#1610

@linear
Copy link

linear bot commented Apr 1, 2022

DEV-2365 (BUG) Testing module not save scenarios (botpress/botpress botpress/v12#1610)

Describe the bug
Testing module not save scenarios

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'Testing'
  2. Click on 'Record'
  3. Send message
  4. Stop recording
  5. Save

Expected behavior
Testing scenarios saved

Console output

POST http://localhost:3000/api/v1/bots/tabula-rasa/mod/testing/saveScenario 400 (Bad Request)
(anonymous) @ xhr.js:210
n._execute @ bluebird.js:1011
A._resolveFromExecutor @ bluebird.js:3337
A @ bluebird.js:2922
e.exports @ xhr.js:15
e.exports @ dispatchRequest.js:56
u.request @ Axios.js:112
r.forEach.u.<computed> @ Axios.js:147
(anonymous) @ bind.js:9
(anonymous) @ full.bundle.js:6
l @ analytics.browser.es.js:121
(anonymous) @ analytics.browser.es.js:351
(anonymous) @ analytics.browser.es.js:176
as @ full.bundle.js:6
u @ full.bundle.js:6
(anonymous) @ full.bundle.js:6
n._execute @ bluebird.js:1011
A._resolveFromExecutor @ bluebird.js:3337
A @ bluebird.js:2922
(anonymous) @ full.bundle.js:6
c @ react-dom.production.min.js:14
h @ react-dom.production.min.js:15
(anonymous) @ react-dom.production.min.js:15
O @ react-dom.production.min.js:17
C @ react-dom.production.min.js:18
S @ react-dom.production.min.js:18
A @ react-dom.production.min.js:21
En @ react-dom.production.min.js:84
zs @ react-dom.production.min.js:250
Ie @ react-dom.production.min.js:39
Cn @ react-dom.production.min.js:86
(anonymous) @ react-dom.production.min.js:251
t.unstable_runWithPriority @ scheduler.production.min.js:18
Ls @ react-dom.production.min.js:251
Ln @ react-dom.production.min.js:85
Show 5 more frames
bluebird.js:1590 Unhandled rejection Error: Request failed with status code 400    at e.exports (http://localhost:3000/assets/studio/ui/public/js/web.cf6726b94d97ce38d011.js?9a5d2a968ad558d7fc01:2:2928123)    at e.exports (http://localhost:3000/assets/studio/ui/public/js/web.cf6726b94d97ce38d011.js?9a5d2a968ad558d7fc01:2:4688056)    at XMLHttpRequest.x (http://localhost:3000/assets/studio/ui/public/js/web.cf6726b94d97ce38d011.js?9a5d2a968ad558d7fc01:2:2926513)From previous event:    at A.B [as _captureStackTrace] (http://localhost:3000/assets/studio/ui/public/js/web.cf6726b94d97ce38d011.js?9a5d2a968ad558d7fc01:2:2689263)    at A._resolveFromExecutor (http://localhost:3000/assets/studio/ui/public/js/web.cf6726b94d97ce38d011.js?9a5d2a968ad558d7fc01:2:2719623)    at new A (http://localhost:3000/assets/studio/ui/public/js/web.cf6726b94d97ce38d011.js?9a5d2a968ad558d7fc01:2:2712700)    at http://localhost:3000/assets/modules/testing/web/full.bundle.js:6:45535    at Object.c (http://localhost:3000/assets/studio/ui/public/js/web.cf6726b94d97ce38d011.js?9a5d2a968ad558d7fc01:2:4574850)    at h (http://localhost:3000/assets/studio/ui/public/js/web.cf6726b94d97ce38d011.js?9a5d2a968ad558d7fc01:2:4575005)    at http://localhost:3000/assets/studio/ui/public/js/web.cf6726b94d97ce38d011.js?9a5d2a968ad558d7fc01:2:4575643    at O (http://localhost:3000/assets/studio/ui/public/js/web.cf6726b94d97ce38d011.js?9a5d2a968ad558d7fc01:2:4575732)    at C (http://localhost:3000/assets/studio/ui/public/js/web.cf6726b94d97ce38d011.js?9a5d2a968ad558d7fc01:2:4576168)    at S (http://localhost:3000/assets/studio/ui/public/js/web.cf6726b94d97ce38d011.js?9a5d2a968ad558d7fc01:2:4575980)    at A (http://localhost:3000/assets/studio/ui/public/js/web.cf6726b94d97ce38d011.js?9a5d2a968ad558d7fc01:2:4577067)    at En (http://localhost:3000/assets/studio/ui/public/js/web.cf6726b94d97ce38d011.js?9a5d2a968ad558d7fc01:2:4604467)    at zs (http://localhost:3000/assets/studio/ui/public/js/web.cf6726b94d97ce38d011.js?9a5d2a968ad558d7fc01:2:4672351)    at Ie (http://localhost:3000/assets/studio/ui/public/js/web.cf6726b94d97ce38d011.js?9a5d2a968ad558d7fc01:2:4584344)    at Cn (http://localhost:3000/assets/studio/ui/public/js/web.cf6726b94d97ce38d011.js?9a5d2a968ad558d7fc01:2:4604947)    at http://localhost:3000/assets/studio/ui/public/js/web.cf6726b94d97ce38d011.js?9a5d2a968ad558d7fc01:2:4672629    at Object.t.unstable_runWithPriority (http://localhost:3000/assets/studio/ui/public/js/web.cf6726b94d97ce38d011.js?9a5d2a968ad558d7fc01:2:4682954)    at Ls (http://localhost:3000/assets/studio/ui/public/js/web.cf6726b94d97ce38d011.js?9a5d2a968ad558d7fc01:2:4672553)    at Ln (http://localhost:3000/assets/studio/ui/public/js/web.cf6726b94d97ce38d011.js?9a5d2a968ad558d7fc01:2:4604690)

Environment (please complete the following information):

  • Browser Chrome
  • Browser Version latest
  • Botpress Version 12.26.10
  • Docker

Additional context
Show details: ""

botpress/borpress botpress/v12#1610 by @ derdeollo

Copy link
Contributor

@samuelmasse samuelmasse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I was able to record a test and run it.

@laurentlp laurentlp merged commit 5804000 into master Apr 1, 2022
@laurentlp laurentlp deleted the dev-2365-bug-testing-module-not-save-scenarios branch April 1, 2022 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Testing module not save scenarios
2 participants