feature files - abeedal/Abeedal GitHub Wiki

Generating feature files

Before the implementation of the the Zephyr scale test management tool in Jira all A/C were created as tests and added to a feature file within the automation framework, these test were then tagged as technical debt (INT_TODO) and the team then created the appropriate code(step Definitions) for the tests to execute and tagged the scenarios accordingly as per the Automation Tagging Strategy.

This meant that there were a lot of scenarios that the automation framework needed to parse but never run

With the implementation of Zephyr scale, we will be able to refine our process for creating feature files and better manage the scenarios that are included in them so that there will be no manual or technical debt scenarios in the framework.

Identifying Technical debt There will now be 2 clear forms of technical debt going forward

Unrecognised technical debt: these are test scenarios that are still in Draft / Ready status that have yet to be evaluated for suitability for automation, see the Reviewing test cases for automation process to see how these will be managed

Recognised technical debt: these are test scenarios that have been through the review process and now carry the status of ‘Automation Candidate’

This process purely focuses on how we manage recognised technical debt and generate the appropriate Feature files to enable automated test execution within the test framework

Exporting scenarios for automation Within Zephyr scale test scenarios will still be grouped by feature as per the Test case folder structure and naming conventions. This is designed to fully replicate the structure of the automation project code(repo) base so that we can easily map automated test back to the relevant feature/scenario in zephyr scale.

Once we have identified a feature in Zephyr scale that has one or more scenarios that fall into the recognised technical debt and we are ready to begin automating those scenarios we need to export those cases into a feature file and add it to our repo for development; this is something we can do directly from Zephyr scale.

Steps to Export scenarios as feature files Select the Feature folder in the test structure to see the related tests

Select the Filter option to show

Select Add Criteria

Select Status from the Add Criteria drop down

In the newly added criteria , select ‘Automation candidate’

This will filter the displayed list for the selected list show only test scenarios with a status of automation candidates.

At this point you can select one or more scenarios, which will enable some extra actions on the view

Select More -/- Export feature files (BDD - Gherkin)

This will down load a zip file that will contain a .feature file for each selected test.

Open the relevant automation repo and create a new .feature file that matches the name of the feature folder in Zephyr scale

Add a Feature: header in the new .feautre file in the repo and add the scenario description, this should be in the objective field of any of the tests exported

Copy and paste the scenarios from each of the feature files in the zip into the new .feature file in the repo, making sure to exclude the pre-populated Feature header and to include the @testcase-ID tag

Save the .feature and you are ready to begin automation

Aligning scenarios in scale with Automation There are a number of tasks that we will need to complete in order to ensure that the scenarios in scale match those in the framework.

Test Step updates It is often the case that the steps of a scenario will change from when they are created in scale to what is finally used in automation to allow for common language use or to make automation easier to complete.

When this occurs you must update the original scenario in scale to do this we do the following

Open the original test in Scale

Select the New version Button

Confirm new version in the pop up dialog

Select the test script Tab and update the BDD Gherkin

Click Save

Add new test cases Often when completing automation we find that we can add extra tests that will increase coverage and help us better judge the quality of the application under test. In this case we must ensure that the new test cases is added to the appropriate feature folder and is linked to the appropriate story. there are 2 ways this can be done

Manually: follow the steps here: New test case using the form

On execution: When tests are executed via Jenkins we utilise the zephyr scale plugin which can be configured to add new tests to the project when they are run as part of an automated test cycle

There is a known issue with wdio and cucumber where the test output is not correctly formatted and therefore not parsed as expected. So right now we are unable to update/record testsd in Zephyr scale via method 2.

Update the scenario status Once a test has been automated, reviewed and is successfully executing in an automation suite then we must update the scenario status to be ‘Automated’ within zephyr scale. this enables us to calculate our automation coverage and measure that against manual coverage and technical debt.

To update the status of a test in Zephyr Scale:

Open the test record (ensuring you are looking at the latest version)

Select the Details Tab

Select the Status Drop down (will be showing as Automation candidate)

select Automated

Save the test

Add label