如何使用RestAssured和Cucumber在API自动化中将1种测试中的Cookies用作所有其他测试

问题描述 投票:0回答:1

在方案1中,我正在运行API。成功回复后,我会得到2个Cookie。

现在,我需要在所有其他测试中将这些cookie用作身份验证。您能建议我一种方法吗?

当前,我正在使用setContext()和getContext()。这不起作用。

api automation cucumber rest-assured
1个回答
0
投票

多种方式

  1. 使用像Spring或Pico这样的DI容器

  2. 使用方案上下文

© www.soinside.com 2019 - 2024. All rights reserved.