Skip to content

Commit

Permalink
Merge pull request #631 from codeforequity-at/develop
Browse files Browse the repository at this point in the history
Botium Core 1.11.4
  • Loading branch information
Botium authored May 25, 2021
2 parents 8ddecf8 + 8fa9f44 commit dcda898
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 7 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "botium-core",
"version": "1.11.3",
"version": "1.11.4",
"description": "The Selenium for Chatbots",
"main": "index.js",
"module": "dist/botium-es.js",
Expand Down Expand Up @@ -67,7 +67,7 @@
"uuid": "^8.3.2",
"vm2": "^3.9.3",
"write-yaml": "^1.0.0",
"xlsx": "^0.16.9",
"xlsx": "^0.17.0",
"xregexp": "^5.0.2",
"yaml": "^1.10.2"
},
Expand Down
3 changes: 2 additions & 1 deletion src/scripting/CompilerXlsx.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ module.exports = class CompilerXlsx extends CompilerBase {
const workbook = XLSX.read(scriptBuffer, { type: 'buffer' })
if (!workbook) throw new Error('Workbook not readable')

debug(`Loaded XLSX with Props: ${workbook.Props ? JSON.stringify(workbook.Props) : '<none>'}`)
const eol = this.caps[Capabilities.SCRIPTING_XLSX_EOL_WRITE]
const maxEmptyRowCount = 10

Expand Down Expand Up @@ -278,7 +279,7 @@ module.exports = class CompilerXlsx extends CompilerBase {
}
rowindex++

if (emptylines > 1) break
if (emptylines > maxEmptyRowCount) break
}
}

Expand Down
17 changes: 17 additions & 0 deletions test/compiler/compilerxlsx.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,23 @@ describe('compiler.compilerxlsx', function () {
assert.equal(context.utterances[0].name, 'TESTUTT1')
assert.equal(context.utterances[1].name, 'TESTUTT2')
})
it('should read 2 utterances separated by empty lines', async function () {
const scriptBuffer = fs.readFileSync(path.resolve(__dirname, CONVOS_DIR, 'convos_2utterances_emptylines.xlsx'))
const context = buildContext()

const caps = {
SCRIPTING_XLSX_SHEETNAMES_UTTERANCES: 'Utterances'
}
const compiler = new Compiler(context, Object.assign({}, DefaultCapabilities, caps))

compiler.Compile(scriptBuffer, 'SCRIPTING_TYPE_UTTERANCES')
assert.lengthOf(context.convos, 0)
assert.lengthOf(context.utterances, 2)
assert.equal(context.utterances[0].name, 'TESTUTT1')
assert.equal(context.utterances[0].utterances.length, 2)
assert.equal(context.utterances[1].name, 'TESTUTT2')
assert.equal(context.utterances[1].utterances.length, 3)
})
it('should read 2 convos from given region by letter', async function () {
const scriptBuffer = fs.readFileSync(path.resolve(__dirname, CONVOS_DIR, 'convos_2convos_middle.xlsx'))
const context = buildContext()
Expand Down
Binary file not shown.

0 comments on commit dcda898

Please sign in to comment.