@@ -217,23 +217,23 @@ async function emitVerifyElementNotPresent(locator) {
217217}
218218
219219async function emitVerifySelectedValue ( locator , value ) {
220- return Promise . resolve ( `await driver.wait(until.elementLocated(${ await LocationEmitter . emit ( locator ) } ));await expect(driver.findElement(${ await LocationEmitter . emit ( locator ) } )).resolves.toHaveSelectedValue(" ${ value } " );` ) ;
220+ return Promise . resolve ( `await driver.wait(until.elementLocated(${ await LocationEmitter . emit ( locator ) } ));await expect(driver.findElement(${ await LocationEmitter . emit ( locator ) } )).resolves.toHaveSelectedValue(\` ${ value } \` );` ) ;
221221}
222222
223223async function emitVerifySelectedLabel ( locator , labelValue ) {
224- return Promise . resolve ( `await driver.wait(until.elementLocated(${ await LocationEmitter . emit ( locator ) } ));await driver.findElement(${ await LocationEmitter . emit ( locator ) } ).then(element => {element.getAttribute("value").then(selectedValue => {element.findElement(By.xpath('option[@value="'+selectedValue+'"]')).then(selectedOption => {selectedOption.getText().then(selectedLabel => {expect(selectedLabel).toBe(" ${ labelValue } " );});});});});` ) ;
224+ return Promise . resolve ( `await driver.wait(until.elementLocated(${ await LocationEmitter . emit ( locator ) } ));await driver.findElement(${ await LocationEmitter . emit ( locator ) } ).then(element => {element.getAttribute("value").then(selectedValue => {element.findElement(By.xpath('option[@value="'+selectedValue+'"]')).then(selectedOption => {selectedOption.getText().then(selectedLabel => {expect(selectedLabel).toBe(\` ${ labelValue } \` );});});});});` ) ;
225225}
226226
227227async function emitVerifyNotSelectedValue ( locator , value ) {
228- return Promise . resolve ( `await driver.wait(until.elementLocated(${ await LocationEmitter . emit ( locator ) } ));await expect(driver.findElement(${ await LocationEmitter . emit ( locator ) } )).resolves.not.toHaveSelectedValue(" ${ value } " );` ) ;
228+ return Promise . resolve ( `await driver.wait(until.elementLocated(${ await LocationEmitter . emit ( locator ) } ));await expect(driver.findElement(${ await LocationEmitter . emit ( locator ) } )).resolves.not.toHaveSelectedValue(\` ${ value } \` );` ) ;
229229}
230230
231231async function emitVerifyValue ( locator , value ) {
232- return Promise . resolve ( `await driver.wait(until.elementLocated(${ await LocationEmitter . emit ( locator ) } ));await expect(driver.findElement(${ await LocationEmitter . emit ( locator ) } )).resolves.toHaveValue(" ${ value } " );` ) ;
232+ return Promise . resolve ( `await driver.wait(until.elementLocated(${ await LocationEmitter . emit ( locator ) } ));await expect(driver.findElement(${ await LocationEmitter . emit ( locator ) } )).resolves.toHaveValue(\` ${ value } \` );` ) ;
233233}
234234
235235async function emitVerifyText ( locator , text ) {
236- return Promise . resolve ( `await driver.wait(until.elementLocated(${ await LocationEmitter . emit ( locator ) } ));await expect(driver.findElement(${ await LocationEmitter . emit ( locator ) } )).resolves.toHaveText(" ${ text } " );` ) ;
236+ return Promise . resolve ( `await driver.wait(until.elementLocated(${ await LocationEmitter . emit ( locator ) } ));await expect(driver.findElement(${ await LocationEmitter . emit ( locator ) } )).resolves.toHaveText(\` ${ text } \` );` ) ;
237237}
238238
239239async function emitVerifyNotText ( locator , text ) {
@@ -245,7 +245,7 @@ async function emitVerifyTitle(title) {
245245}
246246
247247async function emitStore ( value , varName ) {
248- return Promise . resolve ( `vars["${ varName } "] = " ${ value } " ;` ) ;
248+ return Promise . resolve ( `vars["${ varName } "] = \` ${ value } \` ;` ) ;
249249}
250250
251251async function emitStoreText ( locator , varName ) {
@@ -284,7 +284,7 @@ async function emitSelectFrame(frameLocation) {
284284
285285function emitSelectWindow ( windowLocation ) {
286286 if ( / ^ n a m e = / . test ( windowLocation ) ) {
287- return Promise . resolve ( `await driver.switchTo().window(" ${ windowLocation . split ( "name=" ) [ 1 ] } " );` ) ;
287+ return Promise . resolve ( `await driver.switchTo().window(\` ${ windowLocation . split ( "name=" ) [ 1 ] } \` );` ) ;
288288 } else {
289289 return Promise . reject ( new Error ( "Can only emit `select window` using name locator" ) ) ;
290290 }
@@ -307,11 +307,11 @@ async function emitMouseOut(locator) {
307307}
308308
309309function emitAssertAlert ( alertText ) {
310- return Promise . resolve ( `await driver.switchTo().alert().then(alert => {alert.getText().then(text => {expect(text).toBe(" ${ alertText } " );});});` ) ;
310+ return Promise . resolve ( `await driver.switchTo().alert().then(alert => {alert.getText().then(text => {expect(text).toBe(\` ${ alertText } \` );});});` ) ;
311311}
312312
313313function emitAssertAlertAndAccept ( alertText ) {
314- return Promise . resolve ( `await driver.switchTo().alert().then(alert => {alert.getText().then(text => {expect(text).toBe(" ${ alertText } " );alert.accept();});});` ) ;
314+ return Promise . resolve ( `await driver.switchTo().alert().then(alert => {alert.getText().then(text => {expect(text).toBe(\` ${ alertText } \` );alert.accept();});});` ) ;
315315}
316316
317317function emitChooseOkOnNextConfirmation ( ) {
@@ -323,11 +323,11 @@ function emitChooseCancelOnNextConfirmation() {
323323}
324324
325325function emitAnswerOnNextPrompt ( textToSend ) {
326- return Promise . resolve ( `await driver.switchTo().alert().then(alert => {alert.sendKeys(" ${ textToSend } " ).then(() => {alert.accept();});});` ) ;
326+ return Promise . resolve ( `await driver.switchTo().alert().then(alert => {alert.sendKeys(\` ${ textToSend } \` ).then(() => {alert.accept();});});` ) ;
327327}
328328
329329async function emitEditContent ( locator , content ) {
330- return Promise . resolve ( `await driver.wait(until.elementLocated(${ await LocationEmitter . emit ( locator ) } ));await driver.findElement(${ await LocationEmitter . emit ( locator ) } ).then(element => {driver.executeScript(" if(arguments[0].contentEditable === 'true') {arguments[0].innerHTML = '${ content } '}" , element);});` ) ;
330+ return Promise . resolve ( `await driver.wait(until.elementLocated(${ await LocationEmitter . emit ( locator ) } ));await driver.findElement(${ await LocationEmitter . emit ( locator ) } ).then(element => {driver.executeScript(\` if(arguments[0].contentEditable === 'true') {arguments[0].innerHTML = '${ content } '}\` , element);});` ) ;
331331}
332332
333333async function emitSubmit ( locator ) {
0 commit comments