Skip to content

Calling variables from .env file #211

Answered by ASaiAnudeep
vladparl asked this question in Q&A
Discussion options

You must be logged in to vote

Update your step definition to accept custom username and password

When(/^login with (.*) and (.*)$/, {timeout: 30000}, function (username, password) {
  spec = pactum.spec();
  spec.post("/auth/login");
  spec.withJson({
    username: process.env[username],
    password: process.env[password]
    })
});

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@vladparl
Comment options

Answer selected by vladparl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants