midscene icon indicating copy to clipboard operation
midscene copied to clipboard

feat: add environment variable interpolation to YAML script parser

Open georgezlei opened this issue 1 year ago • 5 comments

Add YAML Configuration Parser with Environment Variable Support

Environment variable interpolation is very useful when sensitive data, such as user passwords and other PII data is used in the test. This PR introduced a {{VAR_NAME}} syntax in the YAML script to interpolate the environment variables.

Changes

  • Implemented environment variable interpolation in YAML configuration parser.
  • Added unit tests for YAML utilities including building, parsing, and flow item brief generation

Features

  • Environment variable interpolation using {{VAR_NAME}} syntax
  • Throws descriptive errors for undefined environment variables

Testing

Added test suite covering:

  • Environment variable interpolation
  • Error handling for undefined variables

georgezlei avatar Dec 31 '24 02:12 georgezlei

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

CLAassistant avatar Dec 31 '24 02:12 CLAassistant

Deploy Preview for midscene ready!

Name Link
Latest commit e3a2623e11de8983422e8a636ec74251a9043dda
Latest deploy log https://app.netlify.com/sites/midscene/deploys/677dacf97f2ff4000898a667
Deploy Preview https://deploy-preview-226--midscene.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

netlify[bot] avatar Dec 31 '24 02:12 netlify[bot]

Hi @georgezlei

Great job !

How about we replace the {{var_name}} syntax to the ${var_name} syntax? The ${var_name} syntax looks tidier and similar to the JavaScript template string syntax.

And remember to sign the CLA in this PR .

yuyutaotao avatar Dec 31 '24 03:12 yuyutaotao

Thanks for the comment. Interpolation syntax is updated accordingly.

georgezlei avatar Jan 07 '25 22:01 georgezlei

@georgezlei Remember to sign the cla so that i can merge this PR.

yuyutaotao avatar Jan 08 '25 01:01 yuyutaotao

@yuyutaotao CLA has been signed 2 days ago. I have no idea why it still showing as pending here.

Just rechecked it and it is confirmed that CLA was signed. Would you be able to help me check if there is anything wrong?

georgezlei avatar Jan 10 '25 03:01 georgezlei

I understand. I don't know the reason either. Let's merge it without updating the CLA status.

yuyutaotao avatar Jan 10 '25 04:01 yuyutaotao