question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

testrail-integration package and preprocessor

See original GitHub issue

I’m trying to determine if there is a way to use the testrail-integration package along with cypress-cucumber-preprocessor.

Test code to reproduce

const runid = 1;
const version = 'Build 1.3.4';
const options = {
  username: 'username@org.com',
  password: 'pwd',
  url: 'https://blahblah.testrail.io/'
};
const testrail = new CucumberRailClient(options);

After(async () => {
  const scenario = cy.state('ctx').currentTest;
  try {
    await testrail.updateTestRailResults(scenario, runid, version);
  } catch (err) {
    cy.log(`Error ${err}`);
  }
});

As far as I can tell, the currentTest object contains just the title and nothing else, whereas the updateTestRailResults method would need a Scenario object also containing tags etc. Is there a way to obtain this inside the steps?

Thanks a lot.

Versions

  • Cypress version: 8.7.0
  • Preprocessor version: 4.0.1
  • Node version: 16.13.0

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
badeballcommented, May 4, 2022

Right, I would solve this by post-processing the JSON output in a script ran after Cypress.

0reactions
LoukasKonstantinoucommented, May 4, 2022

That is a good shout and certainly cleaner code, but how would I get the tag of each scenario in an after:spec plugin, so I can associate each test with its result?

Right now I’m using window.testState.pickle because I’m inside that test.

Read more comments on GitHub >

github_iconTop Results From Across the Web

cypress-testrail-reporter - npm package - Snyk
A Testrail reporter for cypress including TestRail API basic library For more information about how to use this package see README.
Read more >
testrail-integration - npm
Start using testrail-integration in your project by running `npm i ... TypeScript icon, indicating that this package has built-in type ...
Read more >
TestRail - Quick Guide - Tutorialspoint
TestRail tool create, centralize, organize and manage test cases very effectively and efficiently. Easily import test cases from excel and other management tool ......
Read more >
Visual Studio Online Test Management with TestRail
Integrate our test case management solution TestRail with VSO · Manage test cases, plans, and runs · Start test runs and capture test...
Read more >
Plugins - Cypress Documentation
Cypress preprocessor for extracting tests from Markdown files ... Uses evanw/esbuild to bundle your specs. ... #mock#recording#http#integration test ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found