AgileTestware.Bumblebee.NUnit 1.1.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package AgileTestware.Bumblebee.NUnit --version 1.1.0
NuGet\Install-Package AgileTestware.Bumblebee.NUnit -Version 1.1.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="AgileTestware.Bumblebee.NUnit" Version="1.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add AgileTestware.Bumblebee.NUnit --version 1.1.0
#r "nuget: AgileTestware.Bumblebee.NUnit, 1.1.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install AgileTestware.Bumblebee.NUnit as a Cake Addin
#addin nuget:?package=AgileTestware.Bumblebee.NUnit&version=1.1.0

// Install AgileTestware.Bumblebee.NUnit as a Cake Tool
#tool nuget:?package=AgileTestware.Bumblebee.NUnit&version=1.1.0

Description

Bumblebee provides a set of C# attributes which allows you to send your test reports directly from Visual Studio to HP ALM

Technically it consists of two parts:

  • BumblebeeTestFixture and BumblebeeTest attributes
  • XML configuration which is a part of your application configuration file.

Prerequisites

  • Agiletestware Bumblebee Server must be installed and be accessible via HTTP from user machine
  • Visual Studio 2012 or later with NUnit3TestAdapter installed
  • NuGet
  • NUnit 3

For running examples with Selenium WebDriver the following NuGet packages are needed:

  • Selenium.WebDriver
  • Selenium.WebDriver.ChromeDriver

Installation and configuration

  1. Add "AgileTestware.Bumblebee.NUnit" package to your packages.config file, e.g.:
<?xml version="1.0" encoding="utf-8"?>
<packages>
  	<package id="AgileTestware.Bumblebee.NUnit" version="1.1.0" targetFramework="net47" />
	<package id="Newtonsoft.Json" version="10.0.3" targetFramework="net47" />
	<package id="NUnit" version="3.9.0" targetFramework="net47" />
</packages>
  1. Add Bumblebee element into your App.config file:
<Bumblebee 	 		
	bumblebee_url="http://bumblebee_server:port/bumblebee"	 		
	alm_url="http://alm_server:port/qcbin"
    alm_user="user"
    alm_encrypted_pass="fd4OMOXLJjkMR6e64RJh3Q=="
    alm_domain="DEFAULT"
    alm_project="project">
</Bumblebee>

Where

  • bumblebee_url - URL of Bumblebee Server
  • alm_url - URL of HP ALM server
  • alm_user - name of a user in HP ALM
  • alm_encrypted_pass - encrypted password for HP ALM user, please use http://bumblebee_server:port/bumblebee/password/encrypt to encrypt your plain text password
  • alm_domain - domain name in HP ALM
  • alm_project - project name in HP ALM

Add BumblebeeTestFixture and BumblebeeTest attributes to your NUnit test classes

In order to tell Bumblebee to export results of test class execution, that class needs to be marked with BumblebeeTestFixture attribute and all test methods shall be marked with BumblebeeTest attributes. If test method is not marked with BumblebeeTest attribute, its result will not be uploaded to HP ALM.

using AgileTestware.Bumblebee.NUnit.Attributes;
using NUnit.Framework;
using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.Support.UI;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;

namespace Agiletstware.Demo.NUnit
{
    [BumblebeeTestFixture(TestPlan = "Subject\\Folder1\\Folder2", TestLab = "Root\\Folder1\\Folder2", TestSet = "Class attributes")]
    [TestFixture]
    public class ClassAttributesDemo
    {
        private IWebDriver webDriver;

        [SetUp]
        public void SetUp()
        {
            webDriver = new ChromeDriver();
        }

          [BumblebeeTest(Description ="Test that google returns Agiletestware.com as a first result for HP ALM and JUnit integration query")]
        [Test]
        public void SearchForTheBestIntegrationTool()
        {
            webDriver.Navigate().GoToUrl("http://google.com");
            IWebElement element = webDriver.FindElement(By.Name("q"));
            element.SendKeys("HP ALM and JUnit integration");
            element.Submit();
            IWebElement myDynamicElement = (new WebDriverWait(webDriver, TimeSpan.FromSeconds(1))
           .Until((d) =>
           {
               IWebElement el = d.FindElement(By.Id("resultStats"));
               if (el.Displayed && el.Enabled)
               {
                   return el;
               }
               return null;
           }));
            ReadOnlyCollection<IWebElement> findElements = webDriver.FindElements(By.XPath("//*[@id='rso']//h3/a"));
            Assert.True(findElements.Count > 0);
            Assert.True(findElements[0].GetAttribute("href").Contains("agiletestware"), "Ooops, we are not on the first place");
        }

        [BumblebeeTest]
        [Test]
        public void SomeFailingTest()
        {
            webDriver.Navigate().GoToUrl("http://google.com");
            webDriver.FindElement(By.LinkText("this is indeed a bad text for a link"));            
        }

        [TearDown]
        public void TearDown()
        {
            if (webDriver != null)
            {
                webDriver.Close();
                webDriver.Quit();
            }
        }
    }
}

BumblebeeTestFixture and BumblebeeTest attributes

BumblebeeTestFixture and BumblebeeTest attributes have the following properties:

  • TestPlan - Path to a test folder in HP ALM TestPlan where tests shall be created, e.g. Subject\Folder1\Folder2
  • TestLab - Path to a test lab folder in HP ALM TestLab where test set shall be created, e.g. Root\Folder1\Folder2
  • TestSet - Name of a test set in HP ALM TestLab to be created/updated
  • TestName - If specified, then the value of TestName parameter will be set as the,name of test in HP ALM. If not set, test name will be set to the name of method
  • AlmId - Defines id of a test in a HP ALM test plan which needs to be updated. If specified then TestPlan and TestName are ignored
  • Description - Description for test in HP ALM
  • OverwriteAlmSteps - If set to True, all existing test steps will be deleted
  • Parameters - JSON array of objects containing name and value for custom parameters which are passed to the bumblebee server and then mapped to HP ALM custom fields, e.g. [{'Name':'parameter 1','Value':'value 1'}, {'Name':'parameter 2','Value':'value 2'}]
  • AlmReqIds - An array of HP ALM requirements IDs to which this test should be linked
  • AlmReqRecursive - If set to True, test is linked to all child requirements of requirements defined y AlmReqIds parameter If the same property is defined on both class and method attribute, the method one takes precedence.

Exporting test results into HP ALM

Once your tests are marked with BumblebeeTestFixture and BumblebeeTest attributes, each time they are executed with NUnit adapter, results are automatically exported into HP ALM.

Please refer to our documentation for more details and use cases.

Product Compatible and additional computed target framework versions.
.NET Framework net45 is compatible.  net451 was computed.  net452 was computed.  net46 was computed.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.1.4 2,316 5/31/2018
1.1.3 1,107 5/7/2018
1.1.1 1,014 4/17/2018
1.1.0 1,052 3/27/2018