我有一个故事,我需要提供JSON配置文件路径和工具路径,并将这两个路径传递给python脚本?
[当我尝试在工具路径旁边添加第二条路径时,它将使用路径后的所有字符串作为路径:/有没有办法在“给定”中提供两条路径?
故事看起来像
Scenario: Verify Certificate and Cipher misconfiguration
Given TestSSL tool path 'C:\Users\Desktop\SSLTLS\testssl.sh-3.0'
Then Certificate and Cipher check should return 0 for successful security-check
java代码
@Given("TestSSL tool path '$path'")
public void get_TestSSL_path(@Named("path") String path)
{
try
{
Paths.get(path);
toolPath = path;
}
catch (InvalidPathException | NullPointerException ex)
{
}
}
@Then("Certificate and Cipher check should return 0 for successful security-check")
public void verify_cipher_and_certificate_attributes() throws IOException, InterruptedException {
String pythonFileName = "./scripts/python/security_misconfiguration_SSL_TLS.py";
String fullcmdCommand = jsonpath + " " + toolPath ;
System.out.println("Full path : " +fullcmdCommand);
int script_result = Utilities.runPythonScript(pythonFileName, fullcmdCommand);
Assert.assertEquals(0, script_result);
}
@Given("TestSSL tool paths '$paths'")
public void get_TestSSL_path(@Named("paths") List<String> paths)
...
Given TestSSL tool paths 'C:\Users\Desktop\SSLTLS\testssl.sh-3.0, C:\Users\Desktop\SSLTLS\testssl.sh-4.0'