Can circleci yaml file echo the test suite that has failed? - cypress

I am using CircleCI to run my Cypress tests and i'd love it if when a test suite failed (there are 2 in there currently) it would echo which one failed, I am using a slack integration so would be great to know which one failed. Is this possible? I have tried a few things like adding an echo command in but nothing appears to be working. Thanks

Related

Cypress run some of tests in parallel

I have done lot of research of running some tests in parallel and some in series. Still, not have any great options for doing that. We'll have 4 virtual machines to done this. All tose vm's has own docker for application with own database as well. I have few tests which need to be run at the same machine.
I'll thinking can there be given some tags or something which can be configured so that spesified tags will run on VM 1 example?
Found solution by plugin named Cypress grep, link is below. With it you can write tags to tests like this:
it('works', { tags: '#smoke' }, () => ...)
run all tests tagged #smoke
$ npx cypress run --env grepTags=#smoke
run all tests except tagged #smoke
$ npx cypress run --env grepTags=-#smoke
Install instructions and usage: https://www.npmjs.com/package/#cypress/grep
Work the way as the Robot Framework tags.

Cypress test tool fails to load, with error 'watching config files Error: UNKNOWN'

I'm working with the Cypress test suite and am rolling it out across our development team. We all run on virtual machines that are, in principle, identical; in practice the machines are re-built once a month so in the meantime developers are free to download and install anything they require so the machines can get messy.
I have a git repository with the cypress code. The primary development environment is dotnet, so the cypress tests are the only node.js code being worked on. I have had a number of developers able to set up the cypress tests on their vms by following the steps of
install latest node.js (16.17.1)
clone from git
run 'npm install' to get the relevant libraries. package.json refers to Cypress 10.10.0
All works fine and they can run the cypress desktop tool and run tests okay. However, I have one developer whose machine is not playing ball. After running the above, when attempting to run cypress the tool displays the not-very-useful error of 'Warning:Unexpected Internal Error. We encountered an unexpected internal error. Please check GitHub or open a new issue if you don't see one already with the details below:'
There are, unfortunately, no details below.
I have been able to run the cypress desktop tool from cmd.exe with DEBUG=cypress:* set on and got a decent amount of debug output. Comparing a working machine to the non-working machine I can see the difference in the output starts at an error message as follows
2022-10-17T00:12:58.883Z cypress:lifecycle:ProjectConfigManager error watching config files Error: UNKNOWN: unknown error, watch
at FSEvent.FSWatcher._handle.onchange (node:internal/fs/watchers:204:21)
{
errno: -4094,
syscall: 'watch',
code: 'UNKNOWN',
filename: null
}
I've hit the googles but not got much information on what this is referring to - I assume there's some configuration file that's not set up on this specific developer's machine.
Has anyone else come across this error before, and if so have you any suggestions where I can look to hunt down the issue?

Disable Logging test results at Cypress

I run my tests in the docker container and I would not want to see the logs about the results of the tests (since I run several instances of cypress and logs are mixed). Is there any way to turn off logging?
I have read documentation but i haven't found anything.
As per this github issue: https://github.com/cypress-io/cypress/issues/2071.
That issue was resolved at the 4.9.0 release of Cypress.
You can now run your Cypress tests with the --quiet flag. e g.:
cypress run --quiet

Nightwatch.js execute scenarios with specific tags

I'm trying run some specific scenarios using tags but I'm unable to finsh some documentation regarding that. What I want to do is run all scenarios that are marked with a specific tag. Look at the example provided on the github but it doesn't say much. What I want to do is:
#onlyone
Scenario: a random feature
Given: something
When: I do something
Then only this test should be ran
So what I want to do is run the following command nightwatch --tag #onlyone only the scenarios with that tag should be ran.
Found the appropiate documentation, Nightwatch Documentation it was an error on my part.
For me, it has been enough to run it from the command line without previous configuration.
Try this:
npm run test -- --tags #my-tag
or
npm run test:run -- --tags #my-tag
Hope this will work for you!

How to run Jmeter tests from bamboo?

How to run the Jmeter tests from bamboo?
I tried in Jenkins which has the 'Execute windows batch command' option and I just pasted these lines and worked fine
jmeter -n -t C:\apache-jmeter-2.13\apache-jmeter-2.13\bin\test.jmx
I need to work the same with bamboo as well. So I tried with the script task, selected Inline and in the script body I pasted the above lines
It failed with this error
/opt/bamboo/current/temp/TEST-NEW-NEW-33-ScriptBuildTask-6294682377804302931.sh: line 2: C:Jmeterapache-jmeter-2.13bin: command not found
/opt/bamboo/current/temp/TEST-NEW-NEW-33-ScriptBuildTask-6294682377804302931.sh: line 3: jmeter: command not found
I tried with the Command task also in bamboo but no luck.
I'm struggling how to run Jmeter tests from bamboo? Anyone please advise. I see that we can do it with maven I believe, but I don't know much about it, but if anyone has step by step instructions that I can follow that helps as well.
Thanks in advance
Define the jmeter executable as a remote capabiliety.
Then add a new command to your task and select jmeter as executable. Add your arguments and you are done.
It looks like that you need to either need to escape backslashes like:
C:\\apache-jmeter-2.13\\apache-jmeter-2.13\\bin\\test.jmx
or change them to forward slashes as:
C:/apache-jmeter-2.13/apache-jmeter-2.13/bin/test.jmx
Other options on how to kick off a JMeter test from Bamboo build step are:
bamboo-jmeter-plugin
JMeter Ant Task
JMeter Maven Plugin
existing JMeter tests can be executed from Java code, moreover, it is possible to create a JMeter test purely in Java.
See 5 Ways To Launch a JMeter Test without Using the JMeter GUI guide for detailed information on aforementioned options.
I assume your Bamboo is in a linux environment.
From Bamboo on Linux, create a new task and select script:
cd /<your path>/apache-jmeter-2.13/bin
./jmeter -n -t <your path>/test.jmx
If Windows, set environment variable JMETER_HOME to C:\apache-jmeter-2.13\apache-jmeter-2.13\ and then on Bamboo's command line:
cd C:\apache-jmeter-2.13\apache-jmeter-2.13\bin\
jmeter -n -t test.jmx

Resources