|
| 1 | +--- |
| 2 | +id: custom-speclow-report |
| 3 | +title: Custom Specflow Report |
| 4 | +sidebar_label: Custom Specflow |
| 5 | +description: Custom specflow report |
| 6 | +keywords: |
| 7 | + - LambdaTest Hyperexecute |
| 8 | + - LambdaTest Hyperexecute help |
| 9 | + - LambdaTest Hyperexecute documentation |
| 10 | +url: https://www.lambdatest.com/support/docs/custom-speclow-report/ |
| 11 | +site_name: LambdaTest |
| 12 | +slug: custom-speclow-report/ |
| 13 | +--- |
| 14 | + |
| 15 | +<script type="application/ld+json" |
| 16 | + dangerouslySetInnerHTML={{ __html: JSON.stringify({ |
| 17 | + "@context": "https://schema.org", |
| 18 | + "@type": "BreadcrumbList", |
| 19 | + "itemListElement": [{ |
| 20 | + "@type": "ListItem", |
| 21 | + "position": 1, |
| 22 | + "name": "Home", |
| 23 | + "item": "https://www.lambdatest.com" |
| 24 | + },{ |
| 25 | + "@type": "ListItem", |
| 26 | + "position": 2, |
| 27 | + "name": "Support", |
| 28 | + "item": "https://www.lambdatest.com/support/docs/" |
| 29 | + },{ |
| 30 | + "@type": "ListItem", |
| 31 | + "position": 3, |
| 32 | + "name": "HyperExecute Custom Specflow Report", |
| 33 | + "item": "https://www.lambdatest.com/support/docs/custom-speclow-report/" |
| 34 | + }] |
| 35 | + }) |
| 36 | + }} |
| 37 | +></script> |
| 38 | +This guide provides step-by-step instructions on how to generate a custom SpecFlow report in LambdaTest HyperExecute. By following the specified changes in the YAML file and modifying the test script, users can receive detailed test reports via email. |
| 39 | + |
| 40 | +## Prerequisites |
| 41 | +- A valid LambdaTest account. |
| 42 | +- A configured HyperExecute environment. |
| 43 | +- A SpecFlow-based test suite. |
| 44 | + |
| 45 | +## Configuration Changes |
| 46 | +To enable custom SpecFlow reporting, make the following changes to your YAML configuration file and test script. |
| 47 | + |
| 48 | +### Step 1: Modify the YAML Configuration File |
| 49 | +Add the following settings in your YAML file to enable reporting and configure partial reports: |
| 50 | + |
| 51 | +```yaml |
| 52 | +report: true |
| 53 | +partialReports: |
| 54 | + location: YOUR_REPORTS_LOCATION |
| 55 | + type: xml |
| 56 | + frameworkName: specflow-custom |
| 57 | + email: |
| 58 | + to: [YOUR_EMAIL_ID] |
| 59 | + metaInfo: [ "project-name:YOUR_CUSTOM_PROJECT_NAME", "project-env: YOUR_CUSTOM_PROJECT_ENV" ] |
| 60 | +``` |
| 61 | +
|
| 62 | +Explanation: |
| 63 | +- `report: true` → Enables the reporting feature. |
| 64 | +- `partialReports.location` → Specifies the directory where the partial reports will be stored. |
| 65 | +- `partialReports.type: xml` → Configures the report format as XML. |
| 66 | +- `partialReports.frameworkName: specflow-custom` → Sets the framework name. |
| 67 | +- `email.to` → Defines the recipient email address where the reports will be sent. |
| 68 | +- `email.metaInfo` → Adds metadata, including project name and environment details, to the report. |
| 69 | + |
| 70 | +### Step 2: Modify the Test Script |
| 71 | +Add the following capability in your test script to ensure the correct execution status is recorded: |
| 72 | + |
| 73 | +`((IJavaScriptExecutor)driver).ExecuteScript($"lambda-info=suitename:YOUR_SUITE_NAME:passed");` |
| 74 | + |
| 75 | +Explanation: |
| 76 | +- This script sends test execution information (suite name and status) to LambdaTest. |
| 77 | +- Replace `YOUR_SUITE_NAME` with the appropriate suite name. |
| 78 | +- The passed status can be dynamically changed based on the test result. |
| 79 | + |
| 80 | +### Step 3: Report Generation and Email Notification |
| 81 | +Once the tests are executed, the custom SpecFlow report will be generated and sent to the configured email address. The report will include: |
| 82 | + |
| 83 | +- Tag-based test summaries and details. |
| 84 | +- Suite-based test summaries and details. |
| 85 | +- Number of tests passed, failed, skipped, or with other statuses. |
| 86 | +- Meta information such as project name and environment. |
| 87 | + |
| 88 | +<img loading="lazy" src={require('../assets/images/hyperexecute/knowledge-base/reports/custom-specflow.png').default} alt="Image" className="doc_img"/> |
0 commit comments