TestPlant provides a way to perform eggPlant Functional tests from within Microsoft Visual Studio. You can use eggIntegration for Visual Studio, an extension to Visual Studio, to run eggPlant Functional test scripts as generic tests from a Visual Studio test project. Teams who are using the Microsoft application lifecycle management (ALM) systems of Team Foundation Server (TFS) or Visual Studio Online can install this extension and then execute eggPlant Functional tests from Microsoft Test Manager or from a Visual Studio build.
The Visual Studio generic tests that call eggPlant Functional scripts can be integrated into the standard Microsoft ALM workflows in the same way as any other Microsoft ALM automation test. For information about running Visual Studio tests, see the Microsoft documentation:
- Running Tests in Microsoft Test Manager
- How to: Run Tests from Microsoft Visual Studio
- Setting Up Test Machines to Run Tests or Collect Data
Requirements for eggIntegration for Visual Studio
Make sure your system meets the minimum requirements to run eggIntegration for Visual Studio:
- Visual Studio 2013 Premium or Ultimate edition
- Other requirements as necessary to run an appropriate version of Visual Studio; check Microsoft’s Visual Studio website for information.
Note: Visual Studio Professional, Express Editions, Community Editions, or Microsoft Test Professional do not support creating generic tests.
Download eggIntegration for Visual Studio from the TestPlant eggIntegration downloads page. As a user with local administrator permissions, execute eggIntegrationVS_setupX.exe (where X is a version number), then follow the steps in the Setup wizard. On the final screen, make sure you allow the wizard to install the Visual Studio Packages on completion.
By default, eggIntegration for Visual Studio is installed to C:\Program Files (x86)\eggPlant Visual Studio Integration. However, note that you can change this location in the Setup wizard. The Visual Studio package installer is copied to same folder where you install the application. You can manage packages from the main menu in Visual Studio by going to Tools > Extensions and Updates. The Extensions and Updates dialog box lets you disable or uninstall packages.
Adding Tests to Visual Studio
You need to create a test project in Visual Studio to run tests. From the main menu, select File > New > Project. In the left sidebar of the New Project dialog box, select Visual C# > Test, and in the main window, choose Unit Test Project. You can also select Visual Basic, but not C++. When the project is created, you can delete the generated UnitTest1.cs file.
Note: The project must be a test project. Otherwise, you cannot execute the tests even though you can add them to a project.
Creating a new test project in Visual Studio
After you open the project, select Tools > eggPlant Functional Tests from the main menu. The following dialog box is displayed:
If you select Run scripts using eggPlant Drive mode and a Host that is a remote machine, then the suite path browse button and Add scripts button are disabled. With this setup, you must manually enter the scripts and suite path on the remote machine. Selecting the option to run eggPlant Functional scripts on the local machine uses command-line execution of eggPlant Functional.
To add scripts to a test, click the Add scripts button. You can also click in the bottom blank row of the Script list, then type a new script name. To edit an existing script, double-click a row in the Script list. You need to enter only the name of the script in the suite.
The dialog box saves the selected settings for the user between sessions. After you select the suite and scripts and click OK, a generic test is created in the project for each script:
To open the Test Explorer window, select Test > Windows > Test Explorer from the main menu. The Test Explorer window opens in the left sidebar of Visual Studio.
Open or double click a generic test in the Solution Explorer in the right sidebar to view or edit the command-line arguments for RunEPFScriptVS.exe, which is the process that executes the script and collects the results.
When you’re running through eggDrive, RunEPFScriptVS.exe uses XML-RPC to connect to eggPlant Functional. It selects the suite and calls RunWithNewResults scriptName.
If a host argument is not given, the script executes by calling RunScript.bat with the command line arguments:
runscript.bat "fullScriptPath" -GlobalResultsFolder Results [optional other parameters]
To begin execution of your test, right-click a test in the Test Explorer window or use one of the Run menu items.
The eggPlant script log output is translated into the Visual Studio format and copied to the Visual Studio test location. Click the Output link at the bottom of the Test Explorer window to see the results, errors, and any screenshots. The results files created by eggPlant Functional are not deleted, so you can still view script results in the eggPlant Functional UI as well.
To run tests from Microsoft Test Manager, you need to set up a test controller and test agents as described in the Microsoft documentation, Setting Up Test Machines to Run Tests.
This topic was last updated on September 20, 2016, at 12:06:01 PM.