Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

running the cypress via node in C# giving error "Could not find Cypress test run results" #184

Open
arunvenkat1911 opened this issue Nov 14, 2023 · 1 comment

Comments

@arunvenkat1911
Copy link

Hi,

I am trying to run the cypress from C# using the node package "Jering.Javascript.NodeJS"

When I run the cypress from cmd directly, it is running fine and giving results.

but when I run from c#, I am getting the below error.
{"status":"failed","failures":1,"message":"Could not find Cypress test run results"}

C# code:
using Jering.Javascript.NodeJS;

string result = await StaticNodeJSService.InvokeFromFileAsync(@"E:\Samples\Cypress\E2E\e2e-run-tests.js");

JS code:
E:\Samples\Cypress\E2E\e2e-run-tests.js file code:

const cypress = require('cypress')
module.exports = async function(callback){
let result = "";

await cypress
.run({
spec: 'Test1.cy.js',
})
.then(testResults => {
result = testResults;
})
.catch((err) => {
callback(err);
})
return result;
}

Test1.cy.js file code:
describe('empty spec', () => {
it('passes', () => {
cy.visit('https://example.cypress.io/')
cy.contains('type').click()
})
})

Please suggest the possible solution

@JeremyTCD
Copy link
Member

{"status":"failed","failures":1,"message":"Could not find Cypress test run results"}

This means this library is working, you'll need to look into your Cypress setup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants