botium-core 1.15.2 → 1.15.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "botium-core",
3
- "version": "1.15.2",
3
+ "version": "1.15.4",
4
4
  "description": "The Selenium for Chatbots",
5
5
  "main": "index.js",
6
6
  "module": "dist/botium-es.js",
@@ -262,9 +262,8 @@ module.exports = class SimpleRestContainer {
262
262
  if (requestOptions.body) {
263
263
  debug('Request.form and request.body are mutually exclusive')
264
264
  }
265
+ requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded'
265
266
  requestOptions.body = new URLSearchParams(requestOptions.form).toString()
266
- // it is set automatically by fetch
267
- // requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded'
268
267
  delete requestOptions.form
269
268
  }
270
269
 
@@ -710,9 +709,9 @@ module.exports = class SimpleRestContainer {
710
709
  }
711
710
  }
712
711
  this._addRequestOptions(requestOptions)
713
- this._fetchify(requestOptions)
714
712
  await executeHook(this.caps, this.requestHook, Object.assign({ requestOptions }, this.view))
715
713
  this._addRequestCookies(requestOptions)
714
+ this._fetchify(requestOptions)
716
715
 
717
716
  return requestOptions
718
717
  }
@@ -597,7 +597,7 @@ class Convo {
597
597
  }
598
598
  Object.assign(scriptingMemory, scriptingMemoryUpdate)
599
599
  try {
600
- await this.scriptingEvents.assertConvoStep({ convo: this, convoStep, container, scriptingMemory, botMsg, transcript, transcriptStep })
600
+ await this.scriptingEvents.assertConvoStep({ convo: this, convoStep, container, scriptingMemory, botMsg, transcript, transcriptStep, transcriptSteps })
601
601
  await this.scriptingEvents.onBotEnd({ convo: this, convoStep, container, scriptingMemory, botMsg, transcript, transcriptStep })
602
602
  optionalStepAssertionError = false
603
603
  } catch (err) {
@@ -139,8 +139,9 @@ const _assertHook = async (myCaps) => {
139
139
  const request = await container.pluginInstance._buildRequest(msg)
140
140
 
141
141
  assert.exists(request.body)
142
- assert.exists(request.body.bodyFieldRequestHook)
143
- assert.equal(request.body.bodyFieldRequestHook, 1)
142
+ const body = JSON.parse(request.body)
143
+ assert.exists(body.bodyFieldRequestHook)
144
+ assert.equal(body.bodyFieldRequestHook, 1)
144
145
 
145
146
  assert.exists(container.pluginInstance.view)
146
147
  assert.exists(container.pluginInstance.view.context)
@@ -382,9 +383,8 @@ describe('connectors.simplerest', function () {
382
383
  [Capabilities.SIMPLEREST_RESPONSE_JSONPATH]: ['$.status']
383
384
  }
384
385
  const scope = nock('https://mock2.com')
385
- .post('/endpointForm', (body) => {
386
- return body === 'formparam1=valueparam1%2B-%25'
387
- })
386
+ .post('/endpointForm', 'formparam1=valueparam1%2B-%25')
387
+ .matchHeader('Content-Type', 'application/x-www-form-urlencoded')
388
388
  .reply(200, {
389
389
  status: 'ok'
390
390
  })