Skip to main content

Running Reqnroll Framework Tests on HyperExecute


Reqnroll is an open-source behavior-driven development (BDD) framework for .NET, the successor to SpecFlow. It allows you to define test scenarios in plain language using Gherkin syntax, making collaboration between technical and non-technical team members seamless.

HyperExecute is an AI Native Test Orchestration Cloud Platform that empowers you to run end-to-end tests quickly and efficiently. It provides Just-in-Time (JIT) testing infrastructure with fast execution speeds, smart orchestration, and detailed logs.

This guide details how to execute your Reqnroll framework tests on HyperExecute via two different methods:

Testing Using Local System

Follow the step-by-step guide to execute your test on HyperExecute.

Prerequisites

To run the Tests on HyperExecute from your Local System, you are required:

Step 1: Configure Your Test Suite

You can use your own project to configure and test it. For demo purposes, we are using the sample repository.

Sample repo

Download or Clone the code sample for the Reqnroll from the TestMu AI GitHub repository to run the tests on the HyperExecute.

Image View on GitHub

If you are using your own project, make sure you update the Hub endpoint in your tests file.

By setting up the Hub endpoint, you establish the communication channel between your tests and the browser nodes, enabling effective test distribution and execution.

Configure the desired capabilities based on your test requirements. For example:

DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.SetCapability(CapabilityType.BrowserName, "Chrome");
capabilities.SetCapability(CapabilityType.Version, "96");
capabilities.SetCapability(CapabilityType.Platform, "Windows 10");

You can also use dev and beta browser versions. To generate capabilities for your test requirements, you can use our inbuilt 🔗 Capabilities Generator Tool.

Step 2: Setup the CLI in your Test Suite

After cloning / downloading the sample repo, you need to setup the CLI and the environment variables.

Download the HyperExecute CLI

The CLI is used for triggering the tests on HyperExecute. It is recommend to download the CLI binary on the host system and keep it in the root directory of the suite to perform the tests on HyperExecute.

You can download the CLI for your desired platform from the below mentioned links:

PlatformHyperExecute CLI
Windowshttps://downloads.lambdatest.com/hyperexecute/windows/hyperexecute.exe
MacOShttps://downloads.lambdatest.com/hyperexecute/darwin/hyperexecute
Linuxhttps://downloads.lambdatest.com/hyperexecute/linux/hyperexecute

Setup Environment Variable

Now, you need to export your environment variables LT_USERNAME and LT_ACCESS_KEY that are available in the TestMu AI Profile page.

Run the below mentioned commands in your terminal to setup the CLI and the environment variables.

export LT_USERNAME="undefined"
export LT_ACCESS_KEY="undefined"

Step 3: Configure YAML in your Test Suite

Configure your YAML file as per your use cases using key value pairs.

In this sample YAML file, we have mentioned:

  • version of the YAML file
  • Timeouts for executing your project
  • Mode of execution is Autosplit. You can also opt for Matrix or Hybrid mode.
  • Pre and Post commands
  • Reports and Artefacts that will be generated after the completion of tests
  • and other necessary YAML Parameters
---
version: 0.1
globalTimeout: 90
testSuiteTimeout: 90
testSuiteStep: 90

runson: linux

autosplit: true
retryOnFailure: true

maxRetries: 1
concurrency: 4

env:
NUGET_PACKAGES: '/home/ltuser/.nuget/packages/'
NUGET_HTTP_CACHE_PATH: '/home/ltuser/.local/share/NuGet/v3-cache'
NUGET_PLUGINS_CACHE_PATH: '/home/ltuser/.local/share/NuGet/plugins-cache'

pre:
- dotnet restore
- dotnet list reqnroll.cloud.csproj package > packages.txt
- dotnet build -c Release

cacheKey: '{{ checksum "packages.txt" }}'

post:
- cat yaml/linux/reqnroll_hyperexecute_autosplit_sample.yaml

mergeArtifacts: true

uploadArtefacts:
- name: Execution_Report
path:
- Report/**
- Reports/**
- name: Execution_Screenshots
path:
- Screenshots/**/**
- Reports/**/Screenshots/**

testDiscovery:
type: raw
mode: dynamic
command: grep -rni 'Features' -e '@' --include=\*.feature | sed 's/.*@//'

testRunnerCommand: dotnet test --logger "console;verbosity=detailed" --filter "(Category=$test)"

jobLabel: [selenium-reqnroll, linux, autosplit]

Step 4: Execute your Test Suite

NOTE : In case of MacOS, if you get a permission denied warning while executing CLI, simply run chmod u+x ./hyperexecute to allow permission. In case you get a security popup, allow it from your System PreferencesSecurity & PrivacyGeneral tab.

Run the below command in your terminal at the root folder of the project:

./hyperexecute --config RELATIVE_PATH_OF_YOUR_YAML_FILE

OR use this command if you have not exported your username and access key in the step 2.

./hyperexecute --user undefined --key undefined --config RELATIVE_PATH_OF_YOUR_YAML_FILE 

Step 5: Monitor the Test Execution

Visit the HyperExecute Dashboard and check your Job status.

Every test run on the HyperExecute has a unique jobId associated with it. Each jobId can in turn constitute single (or multiple) groupId(s). You can visit HyperExecute Automation Dashboard for checking the status of the test execution.

You can seamlessly navigate between JobId's and taskId's. You need to click on the testID to navigate from the HyperExecute logs to the Automation Dashboard.

Step 6: Download Artifacts and Reports

HyperExecute also facilitates the provision to download the Artifacts and Reports on your local machine. Click on the corresponding button to download your generated artifacts and reports.

For any query or doubt, please feel free to contact us via 24×7 chat support or you can also drop a mail to [email protected].
Happy testing!

Test across 3000+ combinations of browsers, real devices & OS.

Book Demo

Help and Support

Related Articles