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

Query : How to retrieve System and environment info details #401

Closed
MadhuQAAutomation opened this issue Mar 11, 2024 · 5 comments
Closed

Comments

@MadhuQAAutomation
Copy link

Hi Prashant - Is there a way to access the system and environment variables that are displayed in courgette html report through 'CourgetteTestStatistics' or 'CourgetteRunInfo' from the Courgette runner class.?

@prashant-ramcharan
Copy link
Owner

Hello, which data from the Courgette html report do you need to access from the Courgette runner?

You won't be able to access Courgette generated system properties via your Courgette runner because these properties are only generated during the test. However you should be able to access these properties in the tests.

@MadhuQAAutomation
Copy link
Author

Hello Prashant - I would need to retrieve the fields in the Run Information and Environment Information sections.

@prashant-ramcharan
Copy link
Owner

prashant-ramcharan commented Mar 14, 2024

The fields in the run information are basically the same information you already have in your Courgette runner.

If you passing system properties or setting environment variables before the tests run then you will already have access to this using System.getProperties() and System.getenv() in the Courgette runner.

@prashant-ramcharan
Copy link
Owner

You should have access to the data using CourgetteRunInfo class in your runner.

        @CourgetteBeforeAll
        public static void beforeRun() {
                System.out.println("Session: " + CourgetteRunInfo.sessionId());
                System.out.println("Environment info: " + CourgetteRunInfo.courgetteOptions().environmentInfo());
                System.out.println("Cucumber tags: " + Arrays.toString(CourgetteRunInfo.courgetteOptions().cucumberOptions().tags()));
        }

@MadhuQAAutomation
Copy link
Author

Thanks!. I will try this..

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