gpt4 book ai didi

javascript - 获取 gherking.lexer.lexingError,当我尝试在 Karate 中使用 javascript 时

转载 作者:行者123 更新时间:2023-11-30 20:15:33 25 4
gpt4 key购买 nike

JavascriptUtil.feature

Feature: test soap end point

Background:

* def randomString = function(){
return Math.floor(100000000 + Math.random() * 900000000);}

*** 场景:

测试特征文件

@smoke@sanity
Feature: test soap end poin

Background:
* url 'URL of the API'

* call read('JavascriptUtil.feature')

Scenario: Test

* def temp = randomPhoneString()
* print temp

我得到的错误是:

Caused by: gherkin.lexer.LexingError: Lexing error on line 6: 'return Math.floor(100000000 + Math.random() * 900000000);}

最佳答案

请删除换行符或使用 """ "doc_string"语法 - refer documentation

* def randomString = function(){ return Math.floor(100000000 + Math.random() * 900000000) }

关于javascript - 获取 gherking.lexer.lexingError,当我尝试在 Karate 中使用 javascript 时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51955776/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com