Giter Club home page Giter Club logo

tobaba / net6-automation-testware Goto Github PK

View Code? Open in Web Editor NEW

This project forked from erni-academy/net6-automation-testware

0.0 0.0 0.0 39.88 MB

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.

Home Page: https://erni-academy.github.io/net6-automation-testware/

License: MIT License

C# 100.00%

net6-automation-testware's Introduction

Continuous-Integration

SonarQube Scanner

All Contributors

About

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

Features

Testware provides capabilities to automate:

  • Websites (using Selenium)

    • Supported Browsers:
      Chrome Firefox IE 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 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");
        }
    }
  1. 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
  2. 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();
    }
  1. 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();
        }

Configuration file example

{
    "Configurations": [
        {
            "Tag": "API",
            "Capabilities": [
                {
                    "Name": "API",
                    "BaseUrl": "https://newton.vercel.app/api/v2/",
                    "Timeout": 3000
                }
            ]
        },
        {
            "Tag": "WebDriver",
            "Capabilities": [
                {
                    "Name": "WebDriver",
                    "Path": "C:\\workspace\\Drivers",
                    "Driver": "Chrome",
                    "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 to learn how to contribute.

License

MIT

Copyright ยฉ 2022 ERNI - Swiss Software Engineering

Code of conduct

Please see our Code of Conduct

Stats

https://repobeats.axiom.co/api/embed/7ebe11822a109c9c80ee0470d57be9997ac78837.svg

Follow us

Twitter Follow Twitch Status YouTube Channel Views Linkedin

Contact

๐Ÿ“ง [email protected]

Contributors โœจ


Didac Lopez

๐Ÿ’ป ๐Ÿ–‹ ๐Ÿ“– ๐ŸŽจ ๐Ÿค” ๐Ÿšง โš ๏ธ ๐Ÿ’ก ๐Ÿ‘€

mg-diego

๐Ÿ’ป ๐Ÿ–‹ ๐Ÿ“– ๐ŸŽจ ๐Ÿค” ๐Ÿšง โš ๏ธ ๐Ÿ’ก ๐Ÿ‘€

Rabosa616

๐Ÿ’ป ๐Ÿ–‹ ๐Ÿ“– ๐ŸŽจ ๐Ÿค” ๐Ÿšง โš ๏ธ ๐Ÿ’ก ๐Ÿ‘€

Carmen Avram

๐Ÿ’ป ๐Ÿ–‹ ๐Ÿ“– ๐ŸŽจ ๐Ÿค” ๐Ÿšง โš ๏ธ ๐Ÿ’ก ๐Ÿ‘€

Thanks goes to these wonderful people (emoji key):

This project follows the all-contributors specification. Contributions of any kind welcome!

net6-automation-testware's People

Contributors

allcontributors[bot] avatar carmenavram avatar lopezmdidac avatar mg-diego avatar rabosa616 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.