Magenic / MAQS

Magenic's automation quick start
MIT License
45 stars 18 forks source link

Remove requirement to have appsettings.json #286

Open billros opened 4 years ago

billros commented 4 years ago

We promote automation of test cases as well as "Automation Assist" tools. However, MAQS is "streamlined" for the latter.

There are a number of utility methods in MAQS that are useful in utility tools, not just test cases. Much of our code assumes we are running within a test class/method and forces certain requirements... including the use of Appsettings.json (or App.config).

In a recent case, I wrote a utility that would screen-scrape an app (there was no API available) to get needed info out. I had to create the appsettings.json file, even though I was not using it for anything. Environment targetted, logging info/level, location, browser, browser options, were all controlled within my utility. Under the covers, MAQS was validating certain sections (SeleniumMAQS) and keys (WebSiteBase). I was controlling all the variables within my code, but MAQS would not work without that file. We have defaults for just about everything, why not run without it. If WebSiteBase is not present (because the file is not present) we can just open a brouser to about:blank, if we ever actually open a browser anyway. (in my utility, I over-rode the driver in the Test Object, so that value was never actually used!)

jonreding2010 commented 4 years ago

I did some digging and the Validate method in Config.cs could be the reason for this.. Should we be checking if the config file exists before validating it?

TroyWalshProf commented 4 years ago

Believable it or not it isn't that straight forward. You really don't need a config file at all, every setting can get passed in via a runsettings or command line parameters. Would be a weird thing to do, but not so much so that we should prevent people form doing it.

FermJacob commented 4 years ago

@billros Can you re-validate this request?