Fat Config
Usage
using Yontech.Fat;using Yontech.Fat.ConsoleRunner;/// ...static int Main(string[] args){var config = new FatConfig(){LogLevel = LogLevel.Debug;// ... other configuration};config.AddChrome(new ChromeFatConfig(){InitialSize = new Size(1200, 800)});config.AddFirefox(new FirefoxFatConfig(){RunInBackground = true,});FatConsoleRunner runner = new FatConsoleRunner(config);runner.Run();}
Supported browsers
Configure the browsers that you want to be used for testing.
config.AddChrome();config.AddChromeRemote(9222);config.AddFirefox();
If no browser is being added then the default one will be Chrome.
You can add the same browsers multiple times (in case that you want to execute with different configurations).
Automatic pick up
In case the tests are being executed with dotnet test
you have to create a class which inherits from FatConfig.
It will be picked up automatically by the Fat framework.
using Yontech.Fat.Filters;/// ...public class MyConfig : FatConfig{public MyConfig(){LogLevel = LogLevel.Debug;AddChrome();AddFirefox();// ... other configuration}}
In case there are multiple Config classes the one with the shortest name will be picked up and a warning will be logged.
Add Browser configurations
Specify the folder where driver is located. The default value is drivers
.
config.AddFirefox(new FirefoxFatConfig(){DriversFolder = "firefox_driver",RunInBackground = true,});
Enable Automatic Driver download. Optionally you can and specify the version you want to download.
config.AddChrome(new ChromeFatConfig(){AutomaticDriverDownload = true,Version = ChromeVersion.v80,DriversFolder = "chrome_driver",});
Remote debugging with Chrome
Chrome supports remote debugging which means that Fat Framework will connect to an existing running instance of Chrome. First open Chrome with remote-debugging
# on MacOs/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222 --user-data-dir="~/FatProfile"# on WindowsChrome.exe --remote-debugging-port=9222 --user-data-dir="FatProfile"
Then configure RemoteDebuggerAddress
config.AddChromeRemote(9222);
Browser start options
config.AddChrome(new ChromeFatConfig(){RunInBackground = true,StartMaximized = false,InitialSize = new Size(1200, 800),DisablePopupBlocking = true});
Browser behaviour
config.Timeouts.DefaultTimeout = 4000;config.Timeouts.FinderTimeout = 2000;
Logging
config.LogLevel = LogLevel.Warning;config.LogLevelConfig.Add("YonTech.Fat.Runner.FatRunner", LogLevel.Info);config.LogLevelConfig.Add("MyClass", LogLevel.Debug);
Run test settings
config.DelayBetweenSteps = 1000;config.DelayBetweenTestCases = 2000;
Extra properties not documented yet
List<FatBusyCondition> BusyConditions { get; set; } = new List<FatBusyCondition>();ITestCaseFilter Filter { get; set; }List<FatInterceptor> Interceptors { get; set; } = new List<FatInterceptor>();