Running NX Cypress Test Cases With HyperExecute
Japneet Singh Chawla
Crafting solutions through technology | The Data Singh | Supercharge your software testing with KaneAI + Hyperexecute Cloud
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
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:
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:
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
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.
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)