Automation Testware is a flexible solution that implements the interaction and management of the main automation engines for Web (Selenium), Mobile (Appium) and Desktop (WinAppDriver) environments.
TestWare provides a robust and scalable core that can be reused by any automation project in order to abstract the core automation implementation focusing only on its business needs.
This solution comes from the need to standarize and reuse the common usage and extension of the different automation engines.
With this action the maintenance decreases and the robustness increases.
Testware provides capabilities to automate:
-
Websites (using Selenium)
-
Websites (using Selenoid)
-
Mobile Applications (using Appium)
-
Windows Desktop applications (using WinAppDriver)
-
API Rest (using Restsharp)
Testware provides capabilities to report:
- HTML (using extent report)
Evidence collection:
- Screenshots after each step (for web, mobile applications and windows desktop applications)
- Clone this repository
- Open solution with visual studio
- Build the solution
- Create a test project using any desired runner.
- Implement a LifeCycle handler class
- It should inherit from AutomationLifeCycleBase.
- GetTestWareComponentAssemblies: Returns the assemblies list that contains the TestWareComponents.
- GetTestWareEngines: Returns the engines instances that will be used at the current Automation project.
- GetConfiguration: Returns the configuration object defined at .json file.
public class LifeCycle : AutomationLifeCycleBase
{
protected override IEnumerable<Assembly> GetTestWareComponentAssemblies()
{
IEnumerable<Assembly> assemblies = new[]
{
typeof(LifeCycle).Assembly
};
return assemblies;
}
protected override IEnumerable<IEngineManager> GetTestWareEngines()
{
IEnumerable<IEngineManager> engines = new[]
{
new SeleniumManager()
};
return engines;
}
protected override TestConfiguration GetConfiguration()
{
var configManager = new ConfigurationManager();
return configManager.ReadConfigurationFile("TestConfiguration.Web.json");
}
}
-
Add calls to the lifecycle class on the execution life cycles according
- BeginTestExecution: Once at the very begining of execution. It initializes the Core.
- BeginTestSuite (optional): Once at the begining of the test suite/feature.
- BeginTestCase: Once at the begining of a test case. It Initialize the Engines
- BeginTestStep (optional): Once at the begining of test step.
- EndTestStep (optional): Once at the end of test step. It generate evidences of execution (optional)
- EndTestCase: Once at the end of test case. It dispose the engine
- BeginTestCase: Once at the begining of a test case. It Initialize the Engines
- EndTestSuite: Once at the end of test suite.
- BeginTestSuite (optional): Once at the begining of the test suite/feature.
- EndTestExecution: Once at the end of the execution
- BeginTestExecution: Once at the very begining of execution. It initializes the Core.
-
Implement business automation objects (i.e Pages)
- Components should inherit from ITestWareComponent in order to be registered
public interface IBusinessPage : ITestWareComponent
{
void BusinessAction();
void BusinessAssertion();
}
- Design test cases. (Is it possible to access the business objects resolving from the ContainerManager)
using (var scope = ContainerManager.Container.BeginLifetimeScope())
{
businessPage = scope.Resolve<IBusinessPage>();
businessPage.BusinessAction();
}
{
"Configurations": [
{
"Tag": "API",
"Capabilities": [
{
"Name": "API",
"BaseUrl": "https://newton.vercel.app/api/v2/",
"Timeout": 3000
}
]
},
{
"Tag": "WebDriver",
"Capabilities": [
{
"Name": "WebDriver",
"Driver": "Chrome",
"Arguments": [
"--start-maximized"
]
}
]
},
{
"Tag": "RemoteDriver",
"Capabilities": [
{
"Name": "Chrome",
"Uri": "http://localhost:4444/wd/hub",
"BrowserName": "Chrome",
"BrowserVersion": "111.0",
"Resolution": "1920x1080x24",
"EnableLog": false,
"EnableVnc": true,
"EnableVideo": false,
"CommandTimeOutInMinutes": 5,
"Arguments": [
"--start-maximized"
]
},
{
"Name": "Firefox",
"Uri": "http://localhost:4444/wd/hub",
"BrowserName": "Firefox",
"BrowserVersion": "110.0",
"Resolution": "1920x1080x24",
"EnableLog": false,
"EnableVnc": true,
"EnableVideo": false,
"CommandTimeOutInMinutes": 5,
"Arguments": [
"--start-maximized"
]
},
{
"Name": "Edge",
"Uri": "http://localhost:4444/wd/hub",
"BrowserName": "Edge",
"BrowserVersion": "111.0",
"Resolution": "1920x1080x24",
"EnableLog": false,
"EnableVnc": true,
"EnableVideo": false,
"CommandTimeOutInMinutes": 5,
"Arguments": [
"--start-maximized"
]
}
]
},
{
"Name": "Appiumdriver",
"AppiumUrl": "http://127.0.0.1:4723/wd/hub",
"ApkUrl": "https://github.com/saucelabs/sample-app-mobile/releases/download/2.7.1/Android.SauceLabs.Mobile.Sample.app.2.7.1.apk",
"ApkPath": "C:\\workspace\\services\\AutomationFramework\\AutomationFramework.DataEntities\\Binaries\\SwagLabs.apk",
"CommandTimeOutInMinutes": 5,
"DeviceName": "emulator-5554",
"PlatformName": "Android",
"Options": [
{
"Name": "fullReset",
"Value": false
},
{
"Name": "noReset",
"Value": true
},
{
"Name": "appActivity",
"Value": "com.swaglabsmobileapp.MainActivity"
},
{
"Name": "unicodeKeyboard",
"Value": true
},
{
"Name": "resetKeyboard",
"Value": true
},
{
"Name": "autoAcceptAlerts",
"Value": true
},
{
"Name": "autoGrantPermissions",
"Value": true
},
{
"Name": "newCommandTimeout",
"Value": 500
}
]
},
{
"Tag": "WinAppDriver",
"Capabilities": [
{
"Name": "Notepad",
"ApplicationPath": "C:\\Windows\\System32\\notepad.exe",
"ApplicationName": "Notepad",
"ApplicationClassName": "Notepad",
"WinAppDriverUrl": "http://127.0.0.1:4723/wd/hub",
"CommandTimeOutInMinutes": 5
},
{
"Name": "Calculator",
"ApplicationPath": "C:\\Windows\\System32\\calc.exe",
"ApplicationName": "Calculator",
"ApplicationClassName": "",
"WinAppDriverUrl": "http://127.0.0.1:4723/wd/hub",
"CommandTimeOutInMinutes": 5
}
]
}
],
"TestResultPath": "C:\\workspace\\ERNI\\results\\"
}
Please see our Contribution Guide to learn how to contribute.
Copyright Β© 2022 ERNI - Swiss Software Engineering
Please see our Code of Conduct
π§ [email protected]
Thanks goes to these wonderful people (emoji key):
This project follows the all-contributors specification. Contributions of any kind welcome!