File tree Expand file tree Collapse file tree 2 files changed +10
-9
lines changed
packages/code-export-javascript-mocha Expand file tree Collapse file tree 2 files changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -190,11 +190,11 @@ describe('command code emitter', () => {
190190 return expect ( prettify ( command ) ) . resolves . toBe (
191191 '{\n' +
192192 commandPrefixPadding +
193- 'const element = await driver.findElement(By.id("test")).getAttribute("value") \n' +
193+ 'const element = await driver.findElement(By.id("test"))\n' +
194194 commandPrefixPadding +
195- " const locator = `option[@value='${element} ']`\n" +
195+ ' const locator = `option[@value=\ '${await element.getAttribute("value")}\ ']`\n' +
196196 commandPrefixPadding +
197- 'const selectedText = element.findElement(By.xpath(locator)).getText()\n' +
197+ 'const selectedText = await element.findElement(By.xpath(locator)).getText()\n' +
198198 commandPrefixPadding +
199199 'assert(selectedText == "test")\n}'
200200 )
@@ -914,11 +914,11 @@ describe('command code emitter', () => {
914914 return expect ( prettify ( command ) ) . resolves . toBe (
915915 '{\n' +
916916 commandPrefixPadding +
917- 'const element = await driver.findElement(By.id("test")).getAttribute("value") \n' +
917+ 'const element = await driver.findElement(By.id("test"))\n' +
918918 commandPrefixPadding +
919- " const locator = `option[@value='${element} ']`\n" +
919+ ' const locator = `option[@value=\ '${await element.getAttribute("value")}\ ']`\n' +
920920 commandPrefixPadding +
921- 'const selectedText = element.findElement(By.xpath(locator)).getText()\n' +
921+ 'const selectedText = await element.findElement(By.xpath(locator)).getText()\n' +
922922 commandPrefixPadding +
923923 'assert(selectedText == "test")\n}'
924924 )
Original file line number Diff line number Diff line change @@ -870,16 +870,17 @@ async function emitVerifySelectedLabel(locator, labelValue) {
870870 level : 1 ,
871871 statement : `const element = await driver.findElement(${ await location . emit (
872872 locator
873- ) } ).getAttribute("value") `,
873+ ) } )`,
874874 } ,
875875 {
876876 level : 1 ,
877- statement : "const locator = `option[@value='${element}']`" ,
877+ statement :
878+ 'const locator = `option[@value=\'${await element.getAttribute("value")}\']`' ,
878879 } ,
879880 {
880881 level : 1 ,
881882 statement :
882- 'const selectedText = element.findElement(By.xpath(locator)).getText()' ,
883+ 'const selectedText = await element.findElement(By.xpath(locator)).getText()' ,
883884 } ,
884885 { level : 1 , statement : `assert(selectedText == "${ labelValue } ")` } ,
885886 { level : 0 , statement : `}` } ,
You can’t perform that action at this time.
0 commit comments