How to Exclude Test Suites in Robot Framework ? We are using Maven

后端 未结 2 1210

We just started using Robot Framework using Eclipse and Maven. We want to run only certain test suites(test suites will have testcases).Is there any way to do that?

2条回答
  •  青春惊慌失措
    2021-01-15 03:50

    Here is how you can select which robot tests you want to execute, when using maven.

    Maven's pom.xml file looks like this:

    ....
    
         
        
        
        
         EXCLUDE 
        ....
    
    ....
    
      
          
                org.robotframework
                robotframework-maven-plugin
                
                    
                        ${suite.test}
                    
                    
                        ${include.tag}
                    
                    
                        ${exclude1.tag}
                        ${exclude2.tag}
                        ${exclude3.tag}
                    
                    .....
                 
                 ....
            
            .....
        
        .....
       
    

    Without command line options, all tests suites are executed, except the ones tagged with EXCLUDE:

    mvn robotframework:run
    

    Command line options can be added to fine tune which testsuites are executed. This command only executes the test suite named PerformanceSuite

    mvn robotframework:run -Dsuite.test=PerformanceSuite
    

    This command executes all test suites except the ones tagged with EXCLUDE (default behavior) and the ones tagged with "DEMO" or "SAMPLE"

    mvn robotframework:run  -Dexclude1.tag=DEMO -Dexclude2.tag=SAMPLE
    

    This command runs only tests suites tagged with "SERVER" but excludes the ones taged with SAMPLE:

     mvn robotframework:run  -Dinclude.tag=SERVER -Dexclude1.tag=SAMPLE
    

    Remember that tags are (recursively) inherited, in the current test-suite from the parent test suite.

提交回复
热议问题