wttech/bobcat

bobcat aem in a maven project

GuptaMegha opened this issue · 4 comments

Bobcat version: 2.1.0

Bobcat modules used:

  • bb-aem-core
  • bb-aem-65
  • bb-junit5

I want to use bobcat framework as a maven project, how to load yaml config properties in maven project (POM.xml)

I tried to use yaml-properties-maven-plugin to read config.yaml, but it seems not working with issue: mojohaus/properties-maven-plugin#39

Hi @GuptaMegha,
take a look at: https://cognifide.github.io/bobcat/docs/configuring-bobcat/
You need to put your options under resources folder and Bobcat will load them accordingly. In Maven setting you just need to set up additional plugins (e.g. Allure).

Hi @mkrzyzanowski :
I tried the same way as you mentioned. Added dependancy in Pom, options files under resources folder and added surefire and allure plugin. But there are "no tests executed". I am wondering if my pom file is missing somthing. Pasted part of Pom file as following.

            <plugin>
                <groupId>io.qameta.allure</groupId>
                <artifactId>allure-maven</artifactId>
                <version>2.9</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.22.1</version>
                <inherited>true</inherited>
                <executions>
                    <execution>
                        <phase>test</phase>
                        <goals>
                        <goal>test</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <systemPropertyVariables>
                        <property>
                            <name>bobcat.config</name>
                            <value>yaml</value>
                        </property>
                        <property>
                            <name>bobcat.config.contexts</name>
                            <value>{"chrome","locator","dev"}</value>
                        </property>
                        <property>
                            <name>webdriver.chrome.driver</name>
                            <value>C:\\Users\\PZhang\\Desktop\\jenkins\\chromedriver.exe</value>
                        </property>
                        <property>
                            <name>junit.jupiter.extensions.autodetection.enabled</name>
                            <value>true</value>
                        </property>
                    </systemPropertyVariables>
                </configuration>
            </plugin>

Thank you very much in advance.
Peng

Hi @stormtide11, couple things here , since you are working with JUnit 5:

<configuration>
                <properties>
                    <configurationParameters>
                        junit.jupiter.conditions.deactivate = *
                        junit.jupiter.extensions.autodetection.enabled = true
                        junit.jupiter.testinstance.lifecycle.default = per_class
                        junit.jupiter.execution.parallel.enabled = true
                    </configurationParameters>
                </properties>
            </configuration>

or a dedicated file: junit-platform.properties.

I have prepared an example project setup here: https://github.com/mkrzyzanowski/bobcat-maven-example.

Hope this helps! Cheers :)

@mkrzyzanowski - The example maven project setup is working like a gem. Thank you very much for your efforts!!