Forum Discussion

JustinM89's avatar
JustinM89
Contributor
5 years ago
Solved

TestSuite missing in project error when running test with Maven

I'm trying to execute a test suite from a composite SoapUI project using the soapui-pro-maven-plugin but am having a hell of a time getting it to work. I did search on the forum here and see some other Maven-related posts, but none of them addressed the behavior I am seeing.

 

I don't want to include the entire pom, but here is the relevant plugin section:

(I am running using 'mvn clean install -Prun-api-tests')

<profile>
<id>run-api-tests</id>
<build>
<plugins>
<plugin>
<groupId>com.smartbear.soapui</groupId>
<artifactId>soapui-pro-maven-plugin</artifactId>
<version>5.1.2</version>

<configuration>
<projectFile>C:\Users\I10674\_development\workspaces\fwa-qa\Testware-Projects\service-layer\SoapUI-Projects\SSNL\SSNL-REST-Project-soapui-project\settings.xml</projectFile>
<testSuite>Call-Tests</testSuite>
<testCase>Login</testCase>
<endpoint>http://${wildfly.hostname}:${wildfly.port}</endpoint>
<host>${wildfly.hostname}:${wildfly.port}</host>
<username>${test.user.username}</username>
<password>${test.user.password}</password>
<outputFolder>C:/Users/I10674/Desktop/soapui_docker_test_results</outputFolder>
<junitReport>true</junitReport>
<settingsFile>src/test/resources/soapui/soapui-settings.xml</settingsFile>
</configuration>

<dependencies>
<dependency>
<groupId>org.reflections</groupId>
<artifactId>reflections-maven</artifactId>
<version>0.9.9-RC2</version>
</dependency>
</dependencies>

<executions>
<execution>
<phase>integration-test</phase>
<goals>
<goal>test</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>

Quick side-note, in my <projectFile> tag, I have to include the path to the settings.xml file, not the project root directory -- if I do not include this I get an exception (java.lang.Exception: Failed to load SoapUI project file ). Not sure if this is known or intended, but I didn't see it documented anywhere.

 

The issue I have now is that it tells me it can't find the test suite 'Call-Tests' in my project:

TestSuite with name [Call-Tests] is missing in Project [SSNL REST Project]


The test suite is definitely there -- I can see it when I fire up SoapUI, it's on the filesystem, I even checked the settings.xml for it and it is named 'Call-Tests' in there too. I've double-checked the spelling more than once, tried using a different test suite, and tried 3 earlier versions of the plugin -- same result.

 

Also, unrelated to my above issue (I think), but everytime I run this, I get a few warning stack traces about the plugin JARs in the .soapui/plugins directory. I have 4 JARs in there (ready-api-git-plugin, ready-jira-plugin, ready-mqtt-plugin-dist, and ready-uxm-plugin) and it prints the same warning stack trace for each. I won't provide the entire thing, but the warning is:

 

WARN [PluginLoader] Could not load plugin from file [C:\Users\I10674\.soapui\plugins\ready-uxm-plugin-1.1.0.jar]
org.reflections.ReflectionsException: could not get type for name com.smartbear.ready.PluginConfig

 

EDIT: I found where the exception is thrown, in SoapUITestCaseRunner.runRunner() at this line:

if ((this.testSuite != null) && (project.getTestSuiteByName(this.testSuite) == null)) {
     throw new Exception("TestSuite with name [" + this.testSuite + "] is missing in Project [" + project.getName() + "]");
}

It's logging the test suite name (this.testSuite), so I can only assume that the exception is being thrown by 

project.getTestSuiteByName('Call-Tests')

 

If I try this from within a Groovy script in ReadyAPI, it seems to work just fine:

import com.eviware.soapui.impl.wsdl.*
import com.eviware.soapui.model.project.*

WsdlProject project = (WsdlProject)ProjectFactoryRegistry.getProjectFactory("wsdl").createNew("C:\\Users\\I10674\\_development\\workspaces\\fwa-qa\\Testware-Projects\\service-layer\\SoapUI-Projects\\SSNL\\SSNL-REST-Project-soapui-project", null)
def ts = project.getTestSuiteByName('Call-Tests')

log.info ts // Mon Jun 03 10:23:00 EDT 2019: INFO: com.eviware.soapui.impl.wsdl.WsdlTestSuitePro@bff35f5
log.info ts.name // Mon Jun 03 10:23:00 EDT 2019: INFO: Call-Tests

 

EDIT #2: I just realized that there's a ready-api-maven-plugin...I'm almost certain this is the cause of my issue, as I am using ReadyAPI 2.5.0. The project is building, I will update this thread shortly.  OK, this was definitely the problem. I'm running into some other issues now, but got past the missing test suite error.

 

TL;DR: If using ReadyAPI, use the ready-api-maven-plugin not the soapui plugin!!!

  • Hey,

     

    The projectFile has to reference either the SoapUI project file for a non-composite project or the SoapUI project folder for a composite project. I seriously doubt it will ever work for you if you'll reference the settings.xml file.

     

    What I guess did happen for you was:

    1. You first used the soapui maven plugin (which corresponds to the open source soapui)

    • thus the concept of composite project was unkown (therefore you would get an error when selecting a folder)
    • when selecting the xml file (in this case settings.xml), the application would scan for a test suite named Call-Tests inside of it (which naturally didn't exist because that xml file was not the actual project file)

    2. You now use the correct maven plugin but you still reference the settings file and not the composite project directory :)

     

    Let me know if it still doesn't work and I'll try to help you.

3 Replies

  • Lucian's avatar
    Lucian
    Community Hero

    Hey,

     

    The projectFile has to reference either the SoapUI project file for a non-composite project or the SoapUI project folder for a composite project. I seriously doubt it will ever work for you if you'll reference the settings.xml file.

     

    What I guess did happen for you was:

    1. You first used the soapui maven plugin (which corresponds to the open source soapui)

    • thus the concept of composite project was unkown (therefore you would get an error when selecting a folder)
    • when selecting the xml file (in this case settings.xml), the application would scan for a test suite named Call-Tests inside of it (which naturally didn't exist because that xml file was not the actual project file)

    2. You now use the correct maven plugin but you still reference the settings file and not the composite project directory :)

     

    Let me know if it still doesn't work and I'll try to help you.

    • JustinM89's avatar
      JustinM89
      Contributor

      The plugin was 100% the problem, and I did update the <projectFile> element to point to the root project folder, not the settings.xml.