Skip to content

virtualansoftware/testscripts-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

maven plugin for "testscripts-generator"

Why do we need maven plugin?

Currently, the testng test class code created and repeated in all the project. This one will help to generate the testng Java code for workflow ymls projected via maven plugin. This will remove the boiler plate code which repeated for any idaithalam java project.

How will this work?

This generator will create Java class and test method for all the given ymls.

<plugin>
    <groupId>io.virtualan</groupId>
    <artifactId>testscripts-generator</artifactId>
    <version>0.1.0</version>
    <configuration>
        <generatedBasedir>src/test/java</generatedBasedir>
        <workflowScripts>
            <RestTestPlanExecutor>
                <property>
                    <name>workflowExecution_xl</name>
                    <value>rest-get.yml</value>
                </property>
            </RestTestPlanExecutor>
        </workflowScripts>
    </configuration>
    <executions>
        <execution>
            <id>test-generator</id>
            <goals>
                <goal>generateTest</goal>
            </goals>
        </execution>
    </executions>
</plugin>

Generated JAVA Code

The above plugin would generate the following java code and would be excuted as well.

package io.virtualan.idaithalam.test;

import io.virtualan.idaithalam.core.api.VirtualanTestPlanExecutor;
import org.testng.Assert;

public class RestTestPlanExecutor {

	@org.testng.annotations.Test
	public void workflowExecution_xl(){
		try {
			boolean isSuccess = VirtualanTestPlanExecutor.invoke("rest-get.yml");
 			Assert.assertTrue(isSuccess);
 		} catch (Exception e) {
			Assert.assertTrue(false);
		}
	}

}

Email info@virtualan.io for any questions.

About

#Idaithalam maven test script generation plugin - The plugin would generate testng java code for idaithalam workflow ymls

Topics

Resources

License

Stars

Watchers

Forks

Languages