Skip to content
This repository has been archived by the owner on Nov 23, 2021. It is now read-only.

bobcat aem in a maven project #396

Closed
GuptaMegha opened this issue Oct 25, 2019 · 4 comments
Closed

bobcat aem in a maven project #396

GuptaMegha opened this issue Oct 25, 2019 · 4 comments
Labels

Comments

@GuptaMegha
Copy link

GuptaMegha commented Oct 25, 2019

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

@mkrzyzanowski
Copy link
Contributor

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).

@stormtide11
Copy link

stormtide11 commented Dec 2, 2019

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

@mkrzyzanowski
Copy link
Contributor

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 :)

@GuptaMegha
Copy link
Author

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants