This Polarion extension is designed to integrate BDD process into Polarion. It provides the almost same functionality as Xray plugin for Jira:
- Cucumber feature tracked as WorkItem attachment and can be edited using Gherkin editor
- Cucumber features can be downloaded as .zip file according to provided criteria
- Execution results can be imported as Test Run into Polarion
This extension can be produced using maven:
mvn clean package
To install the extension to Polarion ch.sbb.polarion.extension.cucumber-<version>.jar
should be copied to <polarion_home>/polarion/extensions/ch.sbb.polarion.extension.cucumber/eclipse/plugins
It can be done manually or automated using maven build:
mvn clean install -P install-to-local-polarion
For automated installation with maven env variable POLARION_HOME
should be defined and point to folder where Polarion is installed.
Changes only take effect after restart of Polarion.
- Open a project which Test Case pages should display the editor
- On the top of the project's navigation pane click β (Actions) β π§ Administration. Project's administration page will be opened.
- On the administration's navigation pane select Work Items β Form Configuration.
- On the form configuration page you will see 2 sections: Form Filters and Form Layouts.
- In the table of Form Layouts section find line Test Case and click π Edit
- In opened Form Layout Configuration editor find a line with code:
β¦ <field id="description"/> β¦
- Insert following new line after it:
β¦ <extension id="cucumber" label="Cucumber Test"/> β¦
- Save changes by clicking πΎ Save
By default, Test Run's UI doesn't display its description (as a custom field). To enable displaying description following needs to be done:
- Open a project which Test Run Templates needs to be modified.
- In Navigation, click Test Runs. The Test Runs page opens. The top section of the page displays a table of existing Test Runs.
- On the right hand side of the toolbar of the Test Runs page, click Manage Templates. The table of Test Runs is replaced by a table of Test Run Templates.
- Select a template you want to modify.
- On the toolbar of the detail pane, click β (Actions) β Customize Test Run Page.
- You will see a warning block containing text:
This is a Test Run template, you cannot execute this test. Please create a Test Run first using this template
- Click β (Pencil) to edit code of this block, on the right hand side of the page you will see following lines of code:
#if($testRun.fields().isTemplate().get()) $widgetContext.renderWarning("<b>This is a Test Run template</b>, you cannot execute this test. Please create a Test Run first using this template") #end #if($testRun.fields().records().is().empty() && $testRun.fields().selectTestCasesBy().optionId().equals("manualSelection")) $widgetContext.renderInfo("Select the test cases you want to plan for execution by clicking Operations > Select Test Cases.") #end
- Add new lines:
β¦ #if(!$testRun.fields().description().is().empty()) $testRun.fields.description.render().withText() #end
- Save template by clicking πΎ
- Create an enum containing all acceptable
components
names for selected project:- go to
Project Administration -> Work Items -> Enumerations
- use Work Item Type:
--Unspecific--
, Enumeration:Custom
+ provide own name e.g.components
- fill all possible values of this enum, e.g.
TA-Adapter
,DailyTrainDataCalculator
,ItisGateway
, etc - save enum configuration
- go to
- Create a custom field for selected project:
- go to
Project Administration -> Testing -> Test Run Custom Fields
- use ID:
components
, Name:Components
, Type: Enum (+ select enum name created on step 1) and enable'Multi'
checkbox - save configuration
- go to
- Customize Test Run Report to show Components field:
- Test Runs -> on the right hand side of the toolbar of the Test Runs page, click Manage Templates and select a template you want to modify
- Place where it is needed widget "Script - Block" and put following code inside:
#if(!$testRun.fields().get("components").is().empty()) <h2>Components</h2> $testRun.fields().get("components").render() #end
- click 'Save'
- Now 'Components' field would appear on detail page if the field was sent during importing test results
- Create a custom field for selected project :
- go to
Project Administration -> Testing -> Test Run Custom Fields
- use ID:
plans
, Name:Test Plan
, Type:Rich Text (multi-line)
- save configuration
- go to
- Customize Test Run Report to show
Test Plan
field:- Test Runs -> on the right hand side of the toolbar of the Test Runs page, click Manage Templates and select a template you want to modify
- Place where it is needed widget "Script - Block" and put following code inside:
#if(!$testRun.fields().get("plans").is().empty()) <h2>Test plan</h2> $testRun.fields().get("plans").render() #end
- click 'Save'
- Now 'Test Plan' field would appear on Test Run detail page if the field was sent by maven-plugin. Also if current project contains some plan(s) with the id equal to given value - the value will be transformaed into a link to certain plan.
- Customize Plan to show links to Test Runs:
- go to
Administration -> Plans -> Plan Custom Fields
and create custom field using ID:testRunLinks
, Name:Test Run Links
, Type:Rich Text (multi-line)
- go to
Plans
-> select any plan and click β ->Customize Plan Report -> Customize Shared Report
- Place where it is needed widget "Script - Block" and put following code inside:
#if(!$plan.fields().get("testRunLinks").is().empty()) <h2>Test runs</h2> $plan.fields().get("testRunLinks").render() #end
- click 'Save'
- Now 'Test Runs' field should contain links to the Test Runs which had created references to current plan on step 2.
- go to
- Create an enum containing all acceptable team names for selected project:
- go to
Administration -> Work Items -> Enumerations
- use Work Item Type:
--Unspecific--
, Enumeration:Custom
+ provide own name e.g.team_sbb
- fill all possible values of this enum, e.g.
Adler
,Otter
,Orca
, etc - save enum configuration
- go to
- Create a custom field which will keep the value (this step can be made in global configuration, but global fields will be visible only if the local configuration for test runs is deleted https://community.sw.siemens.com/s/question/0D54O00007Fh7iLSAR/do-global-test-run-custom-fields-work-locally):
- go to
Administration -> Testing -> Test Run Custom Fields
- use ID:
team-sbb
, Name:Team-SBB
, Type:Enum
(+ select enum name created on step 1)
- go to
- Customize Test Run Report to show Team-SBB field:
- Test Runs -> on the right hand side of the toolbar of the Test Runs page, click Manage Templates and select a template you want to modify
- Place where it is needed widget "Script - Block" and put following code inside:
#if(!$testRun.fields().get("teamSBB").is().empty()) <h2>Team-SBB</h2> $testRun.fields().get("teamSBB").render() #end
- click 'Save'
- Now 'Team-SBB' field would appear on detail page if the field was sent by maven-plugin