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

How to send cypress-terminal-report logs to report portal #209

Open
shiglikiran opened this issue Oct 23, 2024 · 2 comments
Open

How to send cypress-terminal-report logs to report portal #209

shiglikiran opened this issue Oct 23, 2024 · 2 comments
Labels
help wanted Extra attention is needed

Comments

@shiglikiran
Copy link

shiglikiran commented Oct 23, 2024

Hello,

we use cypress (latest version) to run UI automated tests in Github which is then configured with Report portal to view test results. I am able to print logs using cypress-terminal-report in the console; however just wanted to know if there's any way to push these logs to report portal as well.

Thanks!

@shiglikiran shiglikiran added the help wanted Extra attention is needed label Oct 23, 2024
@AmsterGet AmsterGet transferred this issue from reportportal/reportportal Oct 24, 2024
@AmsterGet
Copy link
Member

Hello @shiglikiran !
By default, agent-js-cypress captures all logs coming from the cy.log command.
In addition you can use agent commands for additional log reporting.
According to the cypress-terminal-report documentation, it outputs more detailed information, and currently agent-js-cypress does not catch such a dataset.
So there is no built-in option to support this, but you could try extending the agent's capabilities to do so.

@KiranShigli
Copy link

@AmsterGet Many thanks for taking a look at this. However, I'm aware of these agent commands from Cypress but there's no examples around how to use these commands and push them to report portal. If you could provide any leads that would be helpful. Below is exercept from config just in case if it helps

 if (process.env.CI) {
    config.reporter = '../../node_modules/@reportportal/agent-js-cypress'
    config.reporterOptions = {
      skippedIssue: false,
      endpoint: Constants.reportPortalEndpoint,
      apiKey: process.env.RP_API_KEY,
      launchId: JSON.parse(process.env.LAUNCH_INFO)[clientId],
      project: Constants.testProject,
      debug: true,
    }
  }
module.exports = defineConfig({
  e2e: {
    numTestsKeptInMemory: process.env.CI ? 0 : 50,
    experimentalMemoryManagement: true,
    setupNodeEvents,
    specPattern: sharding(
      'cypress/e2e/features/',
      `${process.env.SPEC_NAME || '*.feature'}`,
    ),
    excludeSpecPattern: [],
    baseUrl: 'http://to-be-replaced-from-sys-env',
    userAgent: process.env.ENVIRONMENT === 'prod' ? 'SCM EPAM Testing' : null,
    supportFile: 'cypress/support/e2e_cucumber.ts',
    video: false,
    chromeWebSecurity: false,
     experimentalInteractiveRunEvents: true,
    retries: {
      // Default is 0
      runMode: 1, // Configure retry attempts for `cypress run`
      openMode: 0, // Configure retry attempts for `cypress open`
    },
    env: {
      rpEnable: true,
      tags: process.env.TAGS,
    },
    reporterOptions: {
      debug: true,
    },
  },
  video: false,
  filterSpecs: true,  
})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants