prashant-ramcharan / courgette-jvm

Multiprocess | Parallel Cucumber-JVM | Parallelize your Java Cucumber tests on a feature level or on a scenario level.
MIT License
130 stars 38 forks source link

Can i edit Courgette Test Runner? #378

Closed fatahillahardhi closed 1 year ago

fatahillahardhi commented 1 year ago

Hello Prashant I want to ask (again).

Can I edit Courgette Test Runner annotation like this? Example:

@RunWith(Courgette.class)
@CourgetteOptions(
        threads = env("thread_num"),
        runLevel = CourgetteRunLevel.SCENARIO,
        rerunFailedScenarios = true,
        rerunAttempts = env("rerun_attempts"),
        randomThreadDelay =  env("randomDelay"),
        reportTargetDir = "build",

the objectives that I can change thread/others using env because I will try Courgette in Gitlab. Also, I want change in mobileDevices too, for example:

mobileDevice = {
                env("Device 1"),
                env("Device 2"),
        },

because I don't want the devices to be visible to others except certain people.

if that's not possible, can I use variables instead of env? Thank you

prashant-ramcharan commented 1 year ago

Hello,

In your Courgette runner, you can specify any random value and override these values at runtime.

In GitLab you would just need to specify system properties at runtime, for example:

job1:
  variables:
    COURGETTE_THREADS: 2
  script:
    - [gradle | mvn ] test -Dcourgette.threads='$COURGETTE_THREADS'"

Or simply pass the values in the run command directly.

-Dcourgette.threads=2 -Dcourgette.rerunAttempts=2 -Dcourgette.mobileDevice="device1, device2"
fatahillahardhi commented 1 year ago

Ok that's very helpfull, thank you Prashant!