How to test a code before it deployed in a production so that it will not fail in orchestartor?
It’s the same as we do in every other technology.
Just prepare the test cases and run the automation with the test data for various scenarios and verify the behaviour fix the bugs if any.
Or you can also build test cases in the code itself which will test your automation whenever required and if something breaks it shows you.
Post which it can be moved to production !
How to build test automation?
As per my understanding you have a process and you need to check all the possibilities before publishing to the production ryt?
Do you have any environments like preprod or UAT? If yes, you can check the version of the application is same in all the environments.
Test the scenarios with different testdata. For example if you are logging to a process, maybe in dev and UAT there maynot be extra authentications. but make sure no additional authentications are not there in production.
Make sure you have used proper wild card wherever the url is coming into picture in the selectors.
Prepare proper config file to keep your assets and urls.
Do proper exception handling, inorder to rectify the unwanted exceptions that can happen during execution.
Do the process manually in Production if you can before moving the automation and make sure the same steps you have covered in the automation process.