{"id":86,"date":"2023-09-28T20:38:25","date_gmt":"2023-09-28T20:38:25","guid":{"rendered":"https:\/\/yascribe.com\/?page_id=86"},"modified":"2023-10-06T12:23:49","modified_gmt":"2023-10-06T12:23:49","slug":"how-to-write-a-test-plan","status":"publish","type":"page","link":"https:\/\/yascribe.com\/index.php\/how-to-write-a-test-plan\/","title":{"rendered":"How to write a test plan"},"content":{"rendered":"\n<h3 class=\"wp-block-heading\"><a href=\"https:\/\/cucumber.io\/docs\/gherkin\/reference\/\">Gherkin<\/a>&nbsp;and <code>.feature<\/code> file<\/h3>\n\n\n\n<div class=\"wp-block-group is-layout-constrained wp-block-group-is-layout-constrained\">\n<p>yascribe uses the&nbsp;<a href=\"https:\/\/cucumber.io\/docs\/gherkin\/reference\/\">Gherkin<\/a>&nbsp;format and the <code>.feature<\/code> file of the<br>Behaviour Driven Development approach.<\/p>\n\n\n\n<p>A test plan is defined in the&nbsp;<code>.feature<\/code>&nbsp;file as follows :<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>the test plan is the unique&nbsp;<code>Feature&nbsp;<\/code>of the&nbsp;.feature&nbsp;file<\/li>\n\n\n\n<li>scenarios of the test plan are defined by&nbsp;<code>Scenario&nbsp;<\/code>blocks of the unique&nbsp;<code>Feature<\/code><\/li>\n\n\n\n<li>scenarios will be run sequentially in their order inside the&nbsp;<code>Feature<\/code><\/li>\n\n\n\n<li>actions and assertions of a scenario are defined by steps of the&nbsp;<code>Scenario&nbsp;<\/code>block<\/li>\n\n\n\n<li>steps will be run sequentially in their order inside the parent&nbsp;<code>Scenario<\/code><\/li>\n<\/ul>\n\n\n\n<p>Create in your test project a&nbsp;<code>.feature<\/code>&nbsp;file where you write scenarios of your test plan. Here is an example :<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><em><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">Feature:<\/mark> Consulting yascribe documentation \n\n  <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">Scenario:<\/mark> Go to yascribe site\n    <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">When <\/mark>I navigate to \"https:\/\/yascribe.com\/\"\n    <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">Then <\/mark>\"A codeless testing tool\" is displayed\n\n  <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">Scenario:<\/mark> Displaying \"How to write a test plan\" page\n    <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">When <\/mark>I click on \"Documentation\"\n    <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">And <\/mark>I click on \"Writing a test plan\"\n    <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">Then <\/mark>\"How to write a test plan\" is displayed<\/em><\/code><\/pre>\n<\/div>\n\n\n\n<div class=\"wp-block-group is-layout-constrained wp-block-group-is-layout-constrained\">\n<h4 class=\"wp-block-heading\">Step Action<\/h4>\n\n\n\n<p>A step action is a single action. It begins by one of the keywords&nbsp;<code>When<\/code>,&nbsp;<code>And<\/code>,&nbsp;<code>*<\/code> followed by the phrase that defines the action. For example :<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><em><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">When <\/mark>I enter \"Paris\" into \"Destination\"<\/em><\/code><\/pre>\n\n\n\n<p>By default, yascribe understands basic pre-learned actions (like&nbsp;<code>enter<\/code>) that are listed in the&nbsp;&#8220;<a href=\"https:\/\/yascribe.com\/index.php\/actions\">Actions<\/a>&#8221; documentation.<\/p>\n\n\n\n<p>But yascribe can learn new actions and new phrases thanks to the self-learning mechanism described in the&nbsp;&#8220;<a href=\"https:\/\/yascribe.com\/index.php\/self-learning\">Self-learning<\/a>&#8221; documentation.<\/p>\n<\/div>\n\n\n\n<div class=\"wp-block-group is-layout-constrained wp-block-group-is-layout-constrained\">\n<h4 class=\"wp-block-heading\">Step Assertion<\/h4>\n\n\n\n<p>A step assertion is a single assertion. It begins by one of the keywords `Given`, `Then`, `But`, `*` followed by the phrase that defines the assertion. For example :<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><em><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">Then <\/mark>\"Welcome in Paris\" is displayed<\/em><\/code><\/pre>\n\n\n\n<p>The passive and active forms of the verb can be used. The active the sentence above is : <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><em><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">Then <\/mark>the page displays \"Welcome in Paris\"<\/em><\/code><\/pre>\n\n\n\n<p>The negative form is also available : <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><em><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">Then <\/mark>\"Welcome in Tokyo\"<\/em> is not displayed<\/code><\/pre>\n\n\n\n<p>By default, yascribe understands basic pre-learned assertions (like&nbsp;<code>display<\/code>) that are listed in the &#8220;<a href=\"https:\/\/yascribe.com\/index.php\/assertions\">Assertions<\/a>&#8221; documentation.<\/p>\n\n\n\n<p>But yascribe can learn new assertions and new phrases thanks to the self-learning mechanism described&nbsp;in the&nbsp;&#8220;<a href=\"https:\/\/yascribe.com\/index.php\/self-learning\">Self-learning<\/a>&#8221; documentation.<\/p>\n<\/div>\n\n\n\n<div class=\"wp-block-group is-layout-constrained wp-block-group-is-layout-constrained\">\n<h4 class=\"wp-block-heading\">Specify a value in a phrase<\/h4>\n\n\n\n<p>A value in a phrase must be double-quoted. For example: <code>\"Paris\"<\/code>.<\/p>\n<\/div>\n\n\n\n<div class=\"wp-block-group is-layout-constrained wp-block-group-is-layout-constrained\">\n<h4 class=\"wp-block-heading\">Specify an element in a phrase<\/h4>\n\n\n\n<p>An element is identified by its double-quoted value and by its type. For example the following \u201cOpen file\u201d button :<\/p>\n\n\n\n<figure class=\"wp-block-image size-full wp-duotone-default-filter\"><img loading=\"lazy\" decoding=\"async\" width=\"118\" height=\"49\" src=\"https:\/\/yascribe.com\/wp-content\/uploads\/2023\/09\/open-file-button.png\" alt=\"\" class=\"wp-image-87\"\/><\/figure>\n\n\n\n<p>To click on the button, the following phrases can be used : <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><em><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">When <\/mark>I click on \"Open file\"<\/em><\/code><\/pre>\n\n\n\n<p>or with the button type :<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><em><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">When <\/mark>I click on \"Open file\"<\/em> button<\/code><\/pre>\n\n\n\n<p>The double-quoted value that identifies the button is the label \u201cOpen file\u201d. Some time an element has not any displayed label, in this case a html attribute (aria label or id for example) of the element will be used instead of the label.<\/p>\n\n\n\n<p>The type&nbsp;of the button can be specified to differentiate the \u201cOpen file\u201d button from another element that has the same label \u201cOpen file\u201d.<\/p>\n\n\n\n<p>The default pre-learned element types are listed in the &#8220;<a href=\"https:\/\/yascribe.com\/index.php\/elements\">Element types<\/a>&#8221; documentation.<\/p>\n\n\n\n<p>Adding the group of the element is another manner to differentiate an element from others. For example :<\/p>\n\n\n\n<figure class=\"wp-block-image size-full wp-duotone-default-filter\"><img loading=\"lazy\" decoding=\"async\" width=\"444\" height=\"136\" src=\"https:\/\/yascribe.com\/wp-content\/uploads\/2023\/09\/button-group-1.png\" alt=\"\" class=\"wp-image-111\" srcset=\"https:\/\/yascribe.com\/wp-content\/uploads\/2023\/09\/button-group-1.png 444w, https:\/\/yascribe.com\/wp-content\/uploads\/2023\/09\/button-group-1-300x92.png 300w\" sizes=\"auto, (max-width: 444px) 100vw, 444px\" \/><\/figure>\n\n\n\n<p>To click on the &#8220;Bold&#8221; button of the second group, the following phrase will be used : <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><em><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-primary-color\">When <\/mark>I click on \"Bold\" of \"Legacy appearance\"<\/em><\/code><\/pre>\n\n\n\n<p><\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Gherkin&nbsp;and .feature file yascribe uses the&nbsp;Gherkin&nbsp;format and the .feature file of theBehaviour Driven Development approach. A test plan is defined in the&nbsp;.feature&nbsp;file as follows : Create in your test project a&nbsp;.feature&nbsp;file where you write scenarios of your test plan. Here is an example : Step Action A step action is a single action. It begins [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-86","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/yascribe.com\/index.php\/wp-json\/wp\/v2\/pages\/86","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/yascribe.com\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/yascribe.com\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/yascribe.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/yascribe.com\/index.php\/wp-json\/wp\/v2\/comments?post=86"}],"version-history":[{"count":24,"href":"https:\/\/yascribe.com\/index.php\/wp-json\/wp\/v2\/pages\/86\/revisions"}],"predecessor-version":[{"id":256,"href":"https:\/\/yascribe.com\/index.php\/wp-json\/wp\/v2\/pages\/86\/revisions\/256"}],"wp:attachment":[{"href":"https:\/\/yascribe.com\/index.php\/wp-json\/wp\/v2\/media?parent=86"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}