0

XML DSL

 <citrus-ftp:client id="ftpClient"
      host="${var1}"
      port="${var2}"
      username="${var3}"
      password="${var4}"
      timeout="10000"/>

步骤.XML

<spring:beans xmlns="http://www.citrusframework.org/schema/cucumber/testcase"

    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    
    xmlns:spring="http://www.springframework.org/schema/beans"
    
    xmlns:citrus="http://www.citrusframework.org/schema/testcase"
    
    xmlns:citrus-ftp="http://www.citrusframework.org/schema/ftp/config"
    
   
    xmlns:citrus-http="http://www.citrusframework.org/schema/http/config" 
    
    xsi:schemaLocation="
    http://www.springframework.org/schema/beans
    
    http://www.springframework.org/schema/beans/spring-beans.xsd
    
     http://www.citrusframework.org/schema/cucumber/testcase 
     
     http://www.citrusframework.org/schema/cucumber/testcase/citrus-cucumber-testcase.xsd 
    
    http://www.citrusframework.org/schema/http/config
    
    http://www.citrusframework.org/schema/http/config/citrus-http-config.xsd
    
   
    http://www.citrusframework.org/schema/ftp/config
   
  
    http://www.citrusframework.org/schema/ftp/config/citrus-ftp-config.xsd">

 <citrus-ftp:client id="ftpClient"
      host="${var1}"
      port="${var2}"
      username="${var3}"
      password="${var4}"
      timeout="10000"/>
 
    
      
<spring:import resource="FTP_Template.xml" />
<step given="^Test FTP connection">
<citrus:call-template name="MyFTP">
</citrus:call-template>
</step>
</spring:beans>

黄瓜功能文件

Scenario: Test FTP
        Given FTP Host:"localhost"
        Given FTP Port:"21"
        Given FTP Username:"ravi"
        Given FTP Password:"admin"
        Given Test FTP connection

我有一个黄瓜功能文件。在文件中,我声明了变量 FTP 主机端口用户名密码。我需要将功能文件变量作为 <citrus-ftp: client> 的输入,以通过功能文件进行动态配置。谁能帮我解决这个问题

4

0 回答 0