Running NX Cypress Test Cases With HyperExecute

Running NX Cypress Test Cases With HyperExecute

If you are reading this article, it is assumed that you have a working NX repo that you use to maintain your code base.

So, let's start with the second keyword in the title HyperExecute

What is HyperExecute?

HyperExecute is an AI-driven test orchestration platform provided by LambdaTest that provides features such as

  • Faster Execution
  • Parallel Processing of tests
  • Smart orchestration
  • Fast Failover
  • AI-driven RCA generation for bugs
  • Real-Time logging
  • Multi OS/Real Devices/Browser support


This might look like a sales pitch but Working as a developer on the product a little show-off acceptable I guess(wink)


Running your NX Cypress Test Cases with hyperExecute

Pre-requisite:

  1. Working NX cypress repo with test cases
  2. LambdaTest account which you can create for free on the website
  3. Curiosity

YAML

YAML(Yet Another Markup Language) is the language to Hyperexcute through which you provide commands to the platform but you don't have to worry about it as most things in YAML are human-readable words separated by spaces and tabs.



version: "0.1"
runson: win
cypress: true
concurrency: 10

pre:
  - npm install

matrix:
  browser: ["chrome-latest","firefox-latest","MicrosoftEdge-latest"] 
  test: ["app.cy.ts"]

testSuites:
  - npx nx e2e e2e --browser=$browser   --spec ./e2e/src/e2e/$test --headed --verbose --configuration=ci
cypressOps:
  runOnNx: true
         

This is a basic YAML that you will need to run your tests on HyperExecute.

Most of the things are self-explanatory and you can read more about options here

I will briefly discuss the following things here:

  1. Pre
  2. testSuites
  3. runOnNx

Pre

All the commands that are required before we can start running the NX cypress test cases will fall into this section.

In the YAML you can see that I have done a npm install to install all the required packages before we start running the tests.

testSuites

This is the command you will use to run tests. One thing to notice here is $test replacer.

$test will be replaced by app.cy.ts which we have mentioned in matrix section. We can add more tests here.

runOnNx

As mentioned in the beginning Hyperexecute can run any framework and to hint system that you are running nx cypress tests and not default cypress tests we are using two parameters

  • cypress: true
  • runOnNx: true


Now you have YAML ready and you have to command Hyperexecute to run these tests which can be done through a CLI which can be downloaded from your account.


Download CLI


Download CLI for the respective platform

Once you download the CLI, keep it in the root directory of your project and use the command visible in the above screenshot to run your tests.

This command will change automatically according to the OS, you just need to replace <your_yaml_file_name> with the path of your YAML file.

Once the command starts running, you will see the job link which you can click to track the progress.


Hope this was informative.

Tha Data Singh(Japneet)

要查看或添加评论,请登录

Japneet Singh Chawla的更多文章

  • Screen Resolution and Cypress

    Screen Resolution and Cypress

    Problem For Quality Assurance, one has to make sure that the Web Application under test run perfectly fine on different…

  • Enums in Go - IOTA

    Enums in Go - IOTA

    Yes, you read it right. Like many other languages Go support the concept of enums through the IOTA function.

社区洞察

其他会员也浏览了