Unable to run test in cypress - automation

After I successfully ran my tests in VS code for cypress I closed the VS studio code. Today when I reopened the visual studio code and tried to run any test, I am getting an error that states "Could not find a cypress configuration file in this folder". The picture is pasted below. Would you please let me know what I am missing?

According to the screen you provided, Cypress try to find config in /Users/{username}/CypressAutomation/cypress/report/html directory. It would be helpful if you add file structure to question, but I suppose that you should run it from /Users/{username}/CypressAutomation/. You need to change directory, in this case use cd ../../.. command and then try to run Cypress.

Related

Getting 'Could not find test files' Error when attempting to run TestCafe tests

I'm trying to run some TestCafe tests from our build server, but getting the following error...
"Could not find test files at the following location: "C:\Testing\TestCafe".
Check patterns for errors:
tests/my-test.ts
or launch TestCafe from a different directory."
I did have them running or able to be found on this machine previously, but others have taken over the test coding and changed the structure a bit when moving it to a Git repository. Now when I grab the tests from Git and try to run, the problem presents itself. I'm not sure if there is something in a config file that needs adjustment but don't know where to start looking.
The intention is to have it part of our CI process, but the problem is also seen when I attempt to run the tests from the command line. The build process does install TestCafe, but there is something strange around this as well.
When the build failes with the can't find tests error, if I try to run the following command in the proper location...
tescafe chrome tests/my-test.ts
... I get, 'testcafe' is not recognized as an internal or external command,
operable program or batch file.
Just can't understand why I can't get these tests running. TestCafe setup was pretty much easy previously.
ADDENDUM: I've added a screenshot of the working directory where I cd to and run the testcafe command as well as the tests subdirectory containing the test I'm trying to run.
Any help is appreciated!!
testcafe chrome tests/my-test.ts is just a template; it isn't a real path to your tests. This error means that the path that you set in CLI is wrong, and there aren't any tests. You need to:
Find out where you start CLI. Please attach a screenshot to your question.
Define an absolute path to tests or a path relative to the place where CLI was started. Please share a screenshot of your project tree where the directory with tests is open.
Also, you missed t in the tescafe chrome tests/my-test.ts command. It should be tesTcafe chrome tests/my-test.ts. That is why you get the "'tescafe' is not recognized as an internal or external command" error.
I was able to get things working by starting from scratch. I uninstalled TestCafe and cleaned the working folder. During next build it was fine. I'm sure I've tried this several times, but it just started working.
One positive that came out of it was that I discovered a typo in a test file name, which was also causing issues finding the test I was using to check testing setup.
Thanks for helping!!

I have a problem with the path when downloaded packages on visual studio code. What the way to solve this problem?

When I install any packages in terminal of VSCODE, I can't use the command of packages directly instead of I have to add the path of package executor behind each command. Example:
I have downloaded Nodemon package for my project and I use its command in terminal like this:
"C:\Users\ACER\AppData\Roaming\npm\nodemon --inspect src/index.js"
Instead of using ( _name_Package + command -> nodemon --inspect src/index.js) as usual.
I have tried many ways "add variables environment" or reinstall with different options but failed.
Please help me if you have solutions. THANK YOU !!!
Most probably C:\Users\ACER\AppData\Roaming\npm is not added to the Path environmental variable. Please try to add C:\Users\ACER\AppData\Roaming\npm. Note that the edited Path won't be available in already opened terminal sessions, so please close them and try the command after reopening the commend line. If it does not help, please try to restart the computer.

Run as Groovy Script

After years of working fine, for the last few months I've not had the ability to Run As Groovy Script.
I can select it from the menu, but nothing happens.
Today I installed the latest Eclipse and plugin in an attempt to fix, but no luck.
What went wrong? Is there a log file to check?
https://dist.springsource.org/release/GRECLIPSE/3.8.0/e4.16
The output of the launch is written to the Console view. If there was a problem launching you can check the Error Log view for an entry. The launch configuration under Run > Run Configurations... > Groovy Script may also reveal classpath or other issues.

JHipster Run Again But Failed

Yeserday I was creating jhipster and create entity (Author and Book) same as tutorial and run perfectly, but however today I run again (using gradlew bootRun) but the result is blank, the command is run without error, but the page is blank (only shows footer) . Please somebody help me to resolve my problem?
the first looking command, could not find specific ehcache for Books, Author, Author Books
after adding ehcache.xml for Book, Author, and Author.books but the result still remain blank page
Make sure that you've started grunt using grunt serve, or the equivalent command for gulp if you're using that.
Open up your web console using F12 and check for any "resource not found" errors. If you see a lot of errors, try deleting your bower_components folder then rerunning bower install.
The ehcache warnings can be safely ignored.

Running grunt from MSBuild

This thread (Problem capturing error output) gives you a taste of the problem I'm struggling with. I'm trying to run grunt from MSBuild and the grunt errors are not displayed in the Visual Studio output window. I have a .NET project in Visual Studio Express 2012 for Web. I have imported an external project into the project build file with the IMPORT tag and in the imported project I have an Exec task attempting to run grunt. I obviously want to see the error messages that grunt outputs in my Visual Studio output window without too much fuss.
I found an extremely simple workaround that at least sends the output to a text file.
grunt.cmd > grunt-output.txt
This output file is in my .NET project folder somewhere so a quick refresh and double click allows me to open the output file and see a slightly garbled version of the grunt output in Visual Studio.
As an example I'm running a lint task on the grunt.js file, which contains things which JSHint would object to. I deliberately didn't put a semi-colon after var hello and so you get the error message Missing semicolon.
From the command line I get a nicely formatted error message.
Running "lint:files" (lint) task
Linting grunt.js...ERROR
[L2:C10] Missing semicolon.
var hello
<WARN> Task "lint:files" failed. Use --force to continue. </WARN>
Aborted due to warnings.
When I run it from Visual Studio, the output file contains this cluttered format:
[4mRunning "lint:files" (lint) task[24m
Linting grunt.js...[31mERROR[39m
[31m[[39m[33mL2[39m[31m:[39m[33mC10[39m[31m][39m [33mMissing semicolon.[39m
var hello[31m[7m [27m[39m
[31m<[39m[33mWARN[39m[31m>[39m [33mTask "lint:files" failed. Use --force to continue. [39m [31m</[39m[33mWARN[39m[31m>[39m
[31mAborted due to warnings.[39m
Does anyone recognise what all those square brackets and numbers are doing, and can anyone think of a command line switch or grunt switch or node.js switch that would interpret them and turn them into formatting? The don't look like some kind of encoding, they look more like tags to suggest to the command line environment how to format the message. Please don't suggest running some kind of regular expression replace function. I want something quick and easy otherwise it would become more trouble than it's worth.
UPDATE: this link Output gets cut off if piped into another application is pointing to a problem further upstream in node dating back 10 months. While that's getting sorted out it would be nice to at least get a more readable output file.
This thread on the grunt message board Pipe-redirecting Grunt's output is broken addresses this issue perfectly and provides a quick workaround while we wait for the overall issue to get fixed. They are escape codes to colour the output and the workaround is to use the --no-color option to remove colouring.
When I run this command from MSBuild
grunt.cmd --no-color > grunt-output.txt
I get nicely formatted output with exactly the same content as the command line:
Running "lint:files" (lint) task
Linting grunt.js...ERROR
[L2:C10] Missing semicolon.
var hello
<WARN> Task "lint:files" failed. Use --force to continue. </WARN>
Aborted due to warnings.
I can live without the colour. It would be nice if this could be sent to the output window, though, because MSBuild throws what seems like an error in the build process when in fact it's just JSHint tactfully hurting my feelings about my JavaScript.
In response to "I obviously want to see the error messages that grunt outputs in my Visual Studio output window without too much fuss."
I'd have a look at VsCommandBuddy ... it helps you integrate your grunt (and any other command for that matter) right inside visual studio. Commands are configured per solution/project, and at the time of this writing are being made available via menus, toolbar, shortcuts and the quicklaunch ...
http://visualstudiogallery.msdn.microsoft.com/f5da988e-2ec1-4061-a569-46d09733c668
It's a scratch-my-own-itch project. It helps me getting thins done. In every solution I open in visual studio, I simply get presented al the external commands I put togheter for that solution / or porject.
Output goes thorugh the outputwindow as desired. The no-color option for grunt removes all the noise.
Hope it helps!!