Environment Variable not accessible in my CI Test

Hi,
I am trying to run CI test for my IOS app. One of the test is to login the app. I need to access username and password through environment variables set in project settings of Circle CI.

This is what I did in my config.yml file.

ios:

      macos:

        xcode: 10.2.1

      working_directory: ~/app
steps:

- run:

          command: |

echo 'export APPIUM_USERNAME=$APPIUM_USERNAME' >> $BASH_ENV 

            echo 'export APPIUM_PASSWORD=$APPIUM_PASSWORD' >> $BASH_ENV

            source $BASH_ENV

          name: Configure Environment Variables

I am unable to use APPIUM_USERNAME & APPIUM_PASSWORD in my CI test.
It gives Reference Error: APPIUM_USERNAME is not defined.
How to access it correctly?

PS: Env variable gets set properly. I checked by printing it.

did you find the solution on this?

This was a somewhat dated post and the original poster has not been around for a number of years.

It may be best to post a new question based on the issue you are seeing.

It is also not clear what the original poster was having a problem with - the example they provided shows an environment variable that should be known to the circleci environment and the shell being executed being placed into a shell script and then exported back to the circleci environment by running the script via the source command. So there must have been more to the issue, but we will never know.