Testing Project Practices

This will cover the practices you should follow when applying a testing strategy to a new project.

Things to cover:

  1. Dev intervention
  2. Dev Scenario writing (behat/BDD)
  3. Jira Project/structure
  4. Testing folder Structure

Jira Project

When starting a new testing project for any client the first thing you should do is create a new project in Jira and make sure test/testing is somewhere in the project name just to make it obvious what the project is for.

Project name example: Behat Test Suite For Magento

After you have created the new project in Jira it is time to start creating tickets for the entire testing project which should include everything you are going to test.

Creating Tickets

Before creating tickets, it might be worth working with developers to get an unsorted list of all of the scenarios that needs testing.

Issue Types used: - Epic - Task - Sub-Task

How each type should be used:

Epic - based on top level folder - second level folder

The Epic name is based upon the top level folder and then it's sub folder.

for example, given this folder strucure and feature files

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
- features
    - Checkout
        - Shipping
            - I_can_create_a_new_shipping_address.feature
            - I_can_choose_a_shipping_address.feature
        - Billing
            - I_can_create_a_new_billing_address.feature
            - I_can_choose_a_billing_address.feature
        - Payment
            - PayPal
                - I_can_pay_by_pay_pal.feature
Would mean the Epics:

  • Checkout Shipping
  • Checkout Billing
  • Checkout Payment

Task - based on Feature Description

Given a file contents on features/Checkout/Shipping/I_can_create_a_new_shipping_address.feature of

1
2
Feature: In the checkout I can create a new shipping address
...

Then the Jira Task should be called "In the checkout I can create a new shipping address" and should be in the Epic "Checkout Shipping"

Sub-Task Based on Scenario Title

Given a file contents on features/Checkout/Shipping/I_can_create_a_new_shipping_address.feature of

1
2
3
4
Feature: In the checkout I can create a new shipping address

Scenario: Should not be able to create a new address with invalid details
...

Then the Jira Sub Task should be called "Should not be able to create a new address with invalid details"

And should be a sub task of "In the checkout I can create a new shipping address"

Estimating Tickets

Estimates should be done on the Sub Task / Scenario Level

Useful bash commands

Getting all scenarios for each file

1
for f in `find . -type f -name '*.feature'`; do echo; echo $f; grep Scenario: $f; done

Getting all scenarios from specific folder

1
for f in `find . -type f -name '*.feature' -wholename '*/StatementAccount/Admin/AccountLabels/*'`; do echo; echo $f; grep Scenario: $f; done 

Grep for either or

1
egrep "Scenario:|Scenario Outline:"