0

I would like to save some credentials in the angular environment.prod file and pass them to protractor.config.js

Is it possible to import and use env variables from the Angular app environments files.

I did create a normal JavaScript file containing an object and pass it to the protractor.config.js:

var userAccess = require('./src/protractor_env.js');
....
....
console.log(userAccess.mail);

It's working fine, but I would like to use the environment.prod.ts built-in file... is this possible and would it be a good practice?

  • Why do you want to do that? – Vishal Aggarwal Feb 25 '18 at 19:09
  • Good question! My bad, I didn't mention this. Following: I do have a function in protractor.config.js inside onPrepare() function where I use an access for google mail. I would like to remove those credentials from this file and make them available in the environment file. For more details, pls. see this question: sqa.stackexchange.com/questions/31856/… from me. – k.vincent Feb 26 '18 at 7:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.