Api 要在karateDSL方案中以相同路径传递多个URL吗
我将在后台为每个URL路径传递的多个URL应该运行场景 背景:Api 要在karateDSL方案中以相同路径传递多个URL吗,api,karate,Api,Karate,我将在后台为每个URL路径传递的多个URL应该运行场景 背景: * header Authorization = call read('basic-auth.js') { username: 'admin', password: 'admin' } * header Authorization = call read('basic-auth.js') { username: 'admin', password: 'admin' } Scenario: Creates the w
* header Authorization = call read('basic-auth.js') { username: 'admin', password: 'admin' }
* header Authorization = call read('basic-auth.js') { username: 'admin', password: 'admin' }
Scenario: Creates the webservices api page
Given path 'rest/activescript/about'
When method get
Then status 200
* def B = response
* print B
背景:
* header Authorization = call read('basic-auth.js') { username: 'admin', password: 'admin' }
* header Authorization = call read('basic-auth.js') { username: 'admin', password: 'admin' }
Scenario: Creates the webservices api page
Given path 'rest/activescript/about'
When method get
Then status 200
* def B = response
* print B
<强>实际结果:背景中的最后一个URL会在场景中考虑执行< /P>
预期结果:后台的所有Url都应在不同的场景下运行以下内容应能正常工作。虽然我不确定是否建议这样做。url通常在整个运行过程中在karate-config.js中定义
Scenario Outline: Scenario called multiple times
* url '<newUrl>'
* header Authorization = call read('basic-auth.js') { username: 'admin', password: 'admin' }
Given path 'rest/activescript/about'
When method get
Then status 200
* def B = response
* print B
Examples:
|newUrl |
|URL1|
|URL2 |
场景大纲:多次调用场景
*url“”
*header Authorization=call read('basic-auth.js'){username:'admin',password:'admin'}
给定路径“rest/activescript/about”
当方法得到
然后状态200
*def B=响应
*打印B
示例:
|新网址|
|URL1|
|URL2|
是的,它的工作方式几乎没有修改*url'',我将在karate-config.js中检查相同的内容