Skip to content

Commit 0d56a16

Browse files
committed
fixed error when migrating old test case which has a command
1 parent c401c34 commit 0d56a16

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/selenium-ide/src/neo/IO/legacy/migrate.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,11 @@ export function migrateTestCase(data) {
117117
const sanitized = sanitizeXml(data);
118118
const result = JSON.parse(convert.xml2json(sanitized, { compact: true }));
119119
const baseUrl = result.html.head.link._attributes.href;
120+
let tr = result.html.body.table.tbody.tr;
121+
tr = Array.isArray(tr) ? tr : [tr];
120122
const test = {
121123
name: result.html.body.table.thead.tr.td._text,
122-
commands: result.html.body.table.tbody.tr.filter(row => (row.td[0]._text && !/^wait/.test(row.td[0]._text))).map(row => (
124+
commands: tr.filter(row => (row.td[0]._text && !/^wait/.test(row.td[0]._text))).map(row => (
123125
{
124126
command: row.td[0]._text && row.td[0]._text.replace("AndWait", ""),
125127
target: xmlunescape(parseTarget(row.td[1])),

0 commit comments

Comments
 (0)