简体   繁体   中英

How to determine running environment type in cucumber runtime?

I want to run a cucmber

I use jenkins to run gradle build and then run test with cucumber script.

I want to create a user for testing. If I run on DEV env I want to use user1 . When running on QA server I want to use user2 .

I can to use this zs_proile var:

export WEBDRIVER=local and user user2

but maybe reading from config file will be more generic

What would be the clean way to check in test during run time which env do I run in?

You can add profiles to build.gradle file and set values dependant on which env the artifact is prepared for. Some useful references: using properties and token filtering .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM