当我尝试在空手道中使用 javascript 时得到 gherking.lexer.lexingError
Getting gherking.lexer.lexingError, when I try to use javascript in Karate
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) }
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) }