Skip to content

Releases: ProtoTest/ProtoTest.Nightshade

Nightshade v1.1 - Phase 1 Optimizations

22 May 07:50

Choose a tag to compare

Updates include:

  • All optimization requests from Motorola engineers from Phase 1 (Device Agnostic Tests + MC65).
  • Enhanced documentation.
  • Enhanced logging configuration.
  • General fixes and streamlines.

Nightshade v1.0 Code Complete

09 May 04:38

Choose a tag to compare

Introducing Nightshade v1.0

Nightshade is a C# test framework for Testplant’s EggPlant GUI Automation Tool. It was built on top of eggDrive (http://docs.testplant.com/?q=content/using-eggdrive) and provides a simple API for executing EggPlant commands with C# code. Broadly based upon the Selenium-WebDriver syntax, tests will look very similar to selenium tests. This means that automation engineers don’t have to learn the SenseTalk scripting language, they can instead build their tests in a known language (C#) and a known IDE (Visual Studio). Any automation engineer familiar with ‘page objects’ and selenium should be able to understand the syntax and how to execute and debug the tests.
Nightshade works using EggPlant’s “EggDrive” feature. Once eggPlant is installed, and a valid license is applied, the runScript.bat file (included in the eggplant directory) can be used to launch eggPlant. Nightshade includes the EggPlantDriver class that contains methods for starting and stopping this jar. Eggplant operates using images stored on the hard drive. The images are created using the EggPlant IDE, and if additional images are needed the EggPlant IDE has to be used to add additional images.
When EggPlant is launched in ‘drive’ mode it opens up a XmlRpc service on the local machine. This service listens for commands to be issued, and executes them one by one Nightshade includes an XmlRpc client from that we use to call this service called “EggPlantDriveService”. This class uses an external library called ‘CookComputing.XmlRpc’, no coding is necessary. It will automatically throw an exception if an error occurs in eggPlant (such as if an element is not visible) (Built using example here : http://docs.testplant.com/?q=content/java-example-script)

Framework Core:

By.cs - This contains the information on how to build a ‘locator’ string, which follows the Eggplant syntax.
Common.cs - Random helper methods that don’t have another place to live.
Config.cs - This file reads from the app.config, and stores all values in properties. To check or update a config setting in code, use Config.VariableName. Also contains methods for reading/writing to the App.config file.
EggplantDriver.cs - This contains helper methods for all major commands available in eggplant, including starting/stopping eggplant, starting a suite, clicking an element, etc.
EggplantElement.cs - This is an abstract representation of a UI element. Can be defined using the By class for ease of use. Wraps the EggplantDriver commands in a nice API.
EggPlantScript.cs - Contains the methods necessary for executing and validating an eggplant .script file. Not being currently used.
EggplantTestBase.cs - Test base class, all test classes should inherit from this. Framework functionality is triggered by the FixtureSetup, SetUp, TearDown, and FixtureTearDown methods.
IEggplantDriveService.cs - This is a client used to communicate with the XMLRPC service that Eggplant creates when launched in drive mode.
SearchRectangle.cs - Builds a rectangle to be used when building locators.
VerificationErrors.cs - Non-terminating error, which will fail the test but not halt script execution.

Framework Custom Attributes -
TestTeardownAttribute.cs - This defines a method to be used after the test is finished. Used for script cleanup.
RepeatForConfigValueAttribute.cs - Reads from the App.Config for a Key, converts it to an int, and repeats a test that many times.
RepeatForTime.cs - Repeat a test for a given amount of time.
RepeatOnFailureAttribute.cs - Repeat a test if it fails.