diff --git a/src/main/resources/META-INF/maven/archetype-metadata.xml b/src/main/resources/META-INF/maven/archetype-metadata.xml index f6bb3e9..f434831 100644 --- a/src/main/resources/META-INF/maven/archetype-metadata.xml +++ b/src/main/resources/META-INF/maven/archetype-metadata.xml @@ -38,17 +38,10 @@ *.java - - src/test/java/__groupId__/__artifactId__/utils - - BaseTest.java - - src/test/resources features/*.feature - schemas/*.conf schemas/*.json diff --git a/src/main/resources/archetype-resources/src/test/java/__groupId__/__artifactId__/glue/CustomStepsDefinition.java b/src/main/resources/archetype-resources/src/test/java/__groupId__/__artifactId__/glue/CustomStepsDefinition.java index daeadd8..e1cbcab 100644 --- a/src/main/resources/archetype-resources/src/test/java/__groupId__/__artifactId__/glue/CustomStepsDefinition.java +++ b/src/main/resources/archetype-resources/src/test/java/__groupId__/__artifactId__/glue/CustomStepsDefinition.java @@ -22,8 +22,7 @@ public class CustomStepsDefinition extends BaseGSpec { RestSpec restSpec; /** - * Example of how to inherit the needed objects from GingerSpec. For more information - * check https://github.com/veepee-oss/gingerspec/wiki/Creating-your-own-steps + * Example of how to inherit the needed objects from GingerSpec. * @param spec the CommonGSpec class */ public CustomStepsDefinition(CommonG spec) { @@ -37,7 +36,6 @@ public CustomStepsDefinition(CommonG spec) { restSpec = new RestSpec(this.commonspec); } - /** * This is an example of how to create your own selenium steps. For more info check * https://github.com/veepee-oss/gingerspec/wiki/Creating-your-own-steps#selenium-example @@ -58,7 +56,6 @@ public void myCustomSeleniumStep() throws InterruptedException { driver.findElement(By.id("submit")).click(); } - /** * This is an example of how to create your own REST steps. You can directly use * REST-Assured for this (https://rest-assured.io/). For more information, check diff --git a/src/main/resources/archetype-resources/src/test/java/__groupId__/__artifactId__/runners/CucumberRunnerIT.java b/src/main/resources/archetype-resources/src/test/java/__groupId__/__artifactId__/runners/CucumberRunnerIT.java index f1752b8..d8dcf1f 100644 --- a/src/main/resources/archetype-resources/src/test/java/__groupId__/__artifactId__/runners/CucumberRunnerIT.java +++ b/src/main/resources/archetype-resources/src/test/java/__groupId__/__artifactId__/runners/CucumberRunnerIT.java @@ -1,14 +1,17 @@ package ${groupId}.${artifactId}.runners; import io.cucumber.testng.CucumberOptions; -import ${groupId}.${artifactId}.utils.BaseTest; +import com.privalia.qa.utils.BaseGTest; /** * This is the runner class responsible of running the included *.feature files in the project. * Glue files can be specified in the {@link CucumberOptions} annotation * - * Also check out the {@link BaseTest} class, there you can create TestNG hooks and more :) + * Here you can also create your own TestNG hooks or even configure parallel tests execution. + * For more info on these topics check: + * https://testng.org/doc/documentation-main.html#annotations + * https://cucumber.io/docs/guides/parallel-execution/#testng */ @CucumberOptions(plugin = { "json:target/CucumberRunnerIT.json", @@ -19,7 +22,7 @@ "src/test/resources/features" }, glue = "classpath:${groupId}.${artifactId}.glue") -public class CucumberRunnerIT extends BaseTest { +public class CucumberRunnerIT extends BaseGTest { } diff --git a/src/main/resources/archetype-resources/src/test/java/__groupId__/__artifactId__/utils/BaseTest.java b/src/main/resources/archetype-resources/src/test/java/__groupId__/__artifactId__/utils/BaseTest.java deleted file mode 100644 index 8f033de..0000000 --- a/src/main/resources/archetype-resources/src/test/java/__groupId__/__artifactId__/utils/BaseTest.java +++ /dev/null @@ -1,47 +0,0 @@ -package ${groupId}.${artifactId}.utils; - - -import com.privalia.qa.utils.BaseGTest; -import com.privalia.qa.utils.ThreadProperty; -import org.testng.ITestContext; -import org.testng.annotations.*; - -import java.lang.reflect.Method; - -/** - * Use this class to define your own TestNG hooks. For more info on TestNG hooks check: - * https://testng.org/doc/documentation-main.html#annotations - */ -abstract public class BaseTest extends BaseGTest { - - @BeforeSuite(alwaysRun = true) - public void beforeSuite(ITestContext context) { - } - - @AfterSuite(alwaysRun = true) - public void afterSuite(ITestContext context) { - } - - @BeforeClass(alwaysRun = true) - public void beforeClass(ITestContext context) { - } - - @BeforeMethod(alwaysRun = true) - public void beforeMethod(Method method) { - } - - @AfterMethod(alwaysRun = true) - public void afterMethod(Method method) { - } - - @AfterClass() - public void afterClass() { - } - - /* Set parallel = true to allow parallel test execution */ - @Override - @DataProvider(parallel = false) - public Object[][] scenarios() { - return super.scenarios(); - } -} \ No newline at end of file diff --git a/src/main/resources/archetype-resources/src/test/resources/configuration/common.properties b/src/main/resources/archetype-resources/src/test/resources/configuration/common.properties index 6c7e0df..52b33cb 100644 --- a/src/main/resources/archetype-resources/src/test/resources/configuration/common.properties +++ b/src/main/resources/archetype-resources/src/test/resources/configuration/common.properties @@ -1,23 +1,10 @@ # ********************************* COMMON PROPERTIES ************************************************ # This file is used to store variables that you can use directly in your Scenarios and Steps. For this -# you will have to use ${envProperties:my.key}. For example, the following step: +# you will have to use ${envProperties:my.key}. Ideally, this is used to store variables that can change +# depending on an environment (like urls, user credentials, IP addresses, etc). # -# Given I put some '${envProperties:spice.name}' in my soup -# -# Will be transformed to: -# -# Given I put some 'ginger' in my soup -# -# For using the variables in the other files, you have to use -Denv= when running your test, -# for example: -# -# mvn verify -Denv=int -> uses the variables from int.properties file -# mvn verify -Denv=uat -> uses the variables from uat.properties file -# mvn verify -Denv=pro -> you got the idea, right? -# -# Ideally, this is used to store variables that can change depending on an environment (like urls, -# user credentials, IP addresses, etc). If -Denv is not detected, the values from this file will be -# used by default +# Take a look at the full documentation here +# https://github.com/veepee-oss/gingerspec/wiki/Gherkin-variables#using-environment-dependent-variables #***************************************************************************************************** spice.name=ginger \ No newline at end of file diff --git a/src/main/resources/archetype-resources/src/test/resources/configuration/int.properties b/src/main/resources/archetype-resources/src/test/resources/configuration/int.properties deleted file mode 100644 index 3ab5e30..0000000 --- a/src/main/resources/archetype-resources/src/test/resources/configuration/int.properties +++ /dev/null @@ -1,14 +0,0 @@ -# ********************************* INT PROPERTIES ************************************************ -# This file is used to store variables that you can use directly in your Scenarios and Steps. For this -# you will have to use ${envProperties:my.key}. For example, the following step: -# -# Given I put some '${envProperties:spice.name}' in my soup -# -# Will be transformed to: -# -# Given I put some 'celery' in my soup -# -# If you use -Denv=int when running your tests (i.e mvn verify -Denv=int) -#***************************************************************************************************** - -spice.name=celery \ No newline at end of file diff --git a/src/main/resources/archetype-resources/src/test/resources/configuration/intsap.properties b/src/main/resources/archetype-resources/src/test/resources/configuration/intsap.properties deleted file mode 100644 index 1fa1b14..0000000 --- a/src/main/resources/archetype-resources/src/test/resources/configuration/intsap.properties +++ /dev/null @@ -1,14 +0,0 @@ -# ********************************* INTSAP PROPERTIES ************************************************ -# This file is used to store variables that you can use directly in your Scenarios and Steps. For this -# you will have to use ${envProperties:my.key}. For example, the following step: -# -# Given I put some '${envProperties:spice.name}' in my soup -# -# Will be transformed to: -# -# Given I put some 'pepper' in my soup -# -# If you use -Denv=intsap when running your tests (i.e mvn verify -Denv=intsap) -#***************************************************************************************************** - -spice.name=pepper \ No newline at end of file diff --git a/src/main/resources/archetype-resources/src/test/resources/configuration/preprod.properties b/src/main/resources/archetype-resources/src/test/resources/configuration/preprod.properties new file mode 100644 index 0000000..ec52d86 --- /dev/null +++ b/src/main/resources/archetype-resources/src/test/resources/configuration/preprod.properties @@ -0,0 +1,10 @@ +# ********************************* INT PROPERTIES ************************************************ +# This file is used to store variables that you can use directly in your Scenarios and Steps. For this +# you will have to use ${envProperties:my.key}. Ideally, this is used to store variables that can change +# depending on an environment (like urls, user credentials, IP addresses, etc). +# +# Take a look at the full documentation here +# https://github.com/veepee-oss/gingerspec/wiki/Gherkin-variables#using-environment-dependent-variables +#***************************************************************************************************** + +spice.name=celery \ No newline at end of file diff --git a/src/main/resources/archetype-resources/src/test/resources/configuration/uat.properties b/src/main/resources/archetype-resources/src/test/resources/configuration/uat.properties deleted file mode 100644 index 3900ece..0000000 --- a/src/main/resources/archetype-resources/src/test/resources/configuration/uat.properties +++ /dev/null @@ -1,14 +0,0 @@ -# ********************************* UAT PROPERTIES ************************************************ -# This file is used to store variables that you can use directly in your Scenarios and Steps. For this -# you will have to use ${envProperties:my.key}. For example, the following step: -# -# Given I put some '${envProperties:spice.name}' in my soup -# -# Will be transformed to: -# -# Given I put some 'cumin' in my soup -# -# If you use -Denv=uat when running your tests (i.e mvn verify -Denv=uat) -#***************************************************************************************************** - -spice.name=cumin \ No newline at end of file diff --git a/src/main/resources/archetype-resources/src/test/resources/schemas/config.conf b/src/main/resources/archetype-resources/src/test/resources/schemas/config.conf deleted file mode 100644 index 1c6bae4..0000000 --- a/src/main/resources/archetype-resources/src/test/resources/schemas/config.conf +++ /dev/null @@ -1 +0,0 @@ -foo = bar \ No newline at end of file diff --git a/src/main/resources/archetype-resources/src/test/resources/schemas/testCreateFile.json b/src/main/resources/archetype-resources/src/test/resources/schemas/testCreateFile.json deleted file mode 100644 index 6fcf72d..0000000 --- a/src/main/resources/archetype-resources/src/test/resources/schemas/testCreateFile.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "key1": "value1", - "key2": [], - "key3": { - "key3_1": "value3_1", - "key3_2": "value3_2" - } -} \ No newline at end of file