Syntax

Tip: Click the eyeball icon () in code blocks to toggle the visibility of the hidden lines.

Click here to view Example tests for the following syntax.

Qase ID


  @Q-1
  Scenario: Scenario with OLD Qase ID tag
    Given I have a step

  @QaseID=2
  Scenario: Scenario with NEW Qase ID tag
    Given I have a step

  @QaseID=3,4,5
  Scenario: Scenario with MULTIPLE Qase ID tag
    Given I have a step

Qase Title


The @QaseTitle method is used to set the title of a test case, both when creating a new test case from the result, and when updating the title of an existing test case - if used with @QaseID.

   Ensure there are no spaces in the title text.
  @QaseTitle=This_title_will_appear_in_Qase
  Scenario: Scenario with Qase title tag
    Given I have a step

To update a Qase test case’s title from code, you must enable “Update test cases” in your project’s run settings.

If you don’t explicitly set a title using the @QaseTitle method, the title specified in the Scenario function will be used for new test cases.

However, if the @QaseTitle method is defined, it always takes precedence and overrides the title from the Scneario description.

Fields


Currently, you can define description, pre & post conditions, and other fields like severity, priority, layer with this method, allowing you to specify and maintain the context of the case, all directly from within your code.

  @QaseFields={"description":"In_BDD,_stories_guide_the_way."}
  Scenario: Scenario with Qase Description
    Given I have a step

  @QaseFields={"preconditions":"Features_speak_what_users_say."}
  Scenario: Scenario with Qase Precondition
    Given I have a step

  @QaseFields={"postconditions":"Tests_bring_life_to_code_each_day."}
  Scenario: Scenario with Qase Postcondition
    Given I have a step

  @QaseFields={"severity":"blocker"}
  Scenario: Scenario with Field: Severity - blocker
    Given I have a step

  @QaseFields={"layer":"e2e"}
  Scenario: Scenario with Field: Layer - e2e
    Given I have a step

  @QaseFields={"priority":"high"}
  Scenario: Scenario with Field: Priority - high
    Given I have a step

Attach


This method can help attach one, or more files to the test’s result. You can also add the file’s contents, directly from code. For example:

  Scenario: Scenario with attachment for a step
    Given I have a step with attachment

     ./step_definitions/syntaxSteps.js: The step definition shall contain the attachment. 
    
     Given("I have a step with attachment", function () {
       console.log("Test passed");
       this.attach("I'm an attachment", "text/plain");
     });

Ignore


If this method is added, the reporter will exclude the test’s result from the report sent to Qase. While the test will still executed by CucumberJS, its result will not be considered by the reporter.

  @QaseIgnore
  Scenario: This scenario is run by CucumberJS but is not reported to Qase.
    Given I have a step