Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/erni-academy/net6-automation-testware

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. You can check one example of the Allure reporting engine in the following URL:
https://github.com/erni-academy/net6-automation-testware

android appium automation-framework selenium web winappdriver

Last synced: 3 months ago
JSON representation

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. You can check one example of the Allure reporting engine in the following URL:

Awesome Lists containing this project

README

        

[![Continuous-Integration](https://github.com/ERNI-Academy/net6-automation-testware/actions/workflows/CI.yml/badge.svg)](https://github.com/ERNI-Academy/net6-automation-testware/actions/workflows/CI.yml)

[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=ERNI-Academy_net6-automation-testware&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=ERNI-Academy_net6-automation-testware)

[![All Contributors](https://img.shields.io/badge/all_contributors-4-orange.svg?style=flat-square)](#contributors-)

# About

[Automation Testware](https://github.com/ERNI-Academy/net6-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.

## Built With

- [.net 6.0](https://dotnet.microsoft.com/en-us/download/dotnet/6.0)
- [Selenium 4.+](https://www.selenium.dev/documentation/webdriver/getting_started/upgrade_to_selenium_4/)
- [Appium 5.+](https://appium.io/)
- [Restsharp 107.+](https://restsharp.dev/v107/#restsharp-v107)

# Features

Testware provides capabilities to automate:

- **Websites** (using Selenium)

- Supported Browsers:
Chrome
Firefox
IE
Edge
- **Websites** (using [Selenoid](https://aerokube.com/selenoid/latest/))
- Supported Browsers:
Chrome
Firefox
Edge
- **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)

# Getting Started

1. Clone this repository
2. Open solution with visual studio
3. Build the solution

## Start automation project

1. Create a test project using any desired runner.
2. 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](#configuration) object defined at .json file.

```cs
public class LifeCycle : AutomationLifeCycleBase
{
protected override IEnumerable GetTestWareComponentAssemblies()
{
IEnumerable assemblies = new[]
{
typeof(LifeCycle).Assembly
};

return assemblies;
}

protected override IEnumerable GetTestWareEngines()
{
IEnumerable engines = new[]
{
new SeleniumManager()
};

return engines;
}

protected override TestConfiguration GetConfiguration()
{
var configManager = new ConfigurationManager();
return configManager.ReadConfigurationFile("TestConfiguration.Web.json");
}
}
```

3. 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
- **EndTestSuite:** Once at the end of test suite.
- **EndTestExecution:** Once at the end of the execution

4. Implement business automation objects _(i.e Pages)_
- Components should inherit from ITestWareComponent in order to be registered

```cs
public interface IBusinessPage : ITestWareComponent
{
void BusinessAction();
void BusinessAssertion();
}
```

5. Design test cases. _(Is it possible to access the business objects resolving from the ContainerManager)_

```cs
using (var scope = ContainerManager.Container.BeginLifetimeScope())
{
businessPage = scope.Resolve();
businessPage.BusinessAction();
}
```

## Configuration file example

```json
{
"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\\"
}
```

## Contributing

Please see our [Contribution Guide](CONTRIBUTING.md) to learn how to contribute.

## License

![MIT](https://img.shields.io/badge/License-MIT-blue.svg)

Copyright © 2022 [ERNI - Swiss Software Engineering](https://www.betterask.erni)

## Code of conduct

Please see our [Code of Conduct](CODE_OF_CONDUCT.md)

## Stats

![https://repobeats.axiom.co/api/embed/7ebe11822a109c9c80ee0470d57be9997ac78837.svg](https://repobeats.axiom.co/api/embed/7ebe11822a109c9c80ee0470d57be9997ac78837.svg)

## Follow us

[![Twitter Follow](https://img.shields.io/twitter/follow/ERNI?style=social)](https://www.twitter.com/ERNI)
[![Twitch Status](https://img.shields.io/twitch/status/erni_academy?label=Twitch%20Erni%20Academy&style=social)](https://www.twitch.tv/erni_academy)
[![YouTube Channel Views](https://img.shields.io/youtube/channel/views/UCkdDcxjml85-Ydn7Dc577WQ?label=Youtube%20Erni%20Academy&style=social)](https://www.youtube.com/channel/UCkdDcxjml85-Ydn7Dc577WQ)
[![Linkedin](https://img.shields.io/badge/linkedin-31k-green?style=social&logo=Linkedin)](https://www.linkedin.com/company/erni)

## Contact

📧 [[email protected]](mailto:[email protected])

## Contributors ✨



Didac Lopez

💻 🖋 📖 🎨 🤔 🚧 ⚠️ 💡 👀

mg-diego

💻 🖋 📖 🎨 🤔 🚧 ⚠️ 💡 👀

Rabosa616

💻 🖋 📖 🎨 🤔 🚧 ⚠️ 💡 👀

Carmen Avram

💻 🖋 📖 🎨 🤔 🚧 ⚠️ 💡 👀

Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):

This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!