How to Pass the value to a variable in terminal #1204
Answered
by
mdmintz
abdurraheemj
asked this question in
Q&A
|
Hi Michael, |
Answered by
mdmintz
Feb 9, 2022
Replies: 2 comments 14 replies
|
Hi @abdurraheemj You can set the environment via the command-line using built-in environments that map to pytest --env=qa
pytest --env=productionIn tests, access with |
8 replies
Answer selected by
mdmintz
|
@abdurraheemj You already had the right idea with: if self.env == "qa":
self.open(QA_URL)
elif self.env == "production":
self.open(PRODUCTION_URL)Those parameters get set on the command-line with: pytest --env=qa
pytest --env=production |
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Hi @abdurraheemj You can set the environment via the command-line using built-in environments that map to
self.env:In tests, access with
self.env. You'll have to type out "production" when using that one.Then you can use that within
ifstatements.