[{"data":1,"prerenderedAt":496},["ShallowReactive",2],{"docs-/docs/guides/writing-tests":3},{"id":4,"title":5,"body":6,"description":488,"extension":489,"meta":490,"navigation":491,"path":492,"seo":493,"stem":494,"__hash__":495},"docs/docs/guides/writing-tests.md","Writing Tests",{"type":7,"value":8,"toc":478},"minimark",[9,13,22,27,87,148,151,155,178,213,217,223,238,244,268,272,275,325,329,334,354,359,379,384,399,403,423,426,433,437,447,451,474],[10,11,5],"h1",{"id":12},"writing-tests",[14,15,16,17,21],"p",{},"TestFlowKit scenarios live in ",[18,19,20],"code",{},".feature"," files written in Gherkin — plain English with a fixed structure. No coding required.",[23,24,26],"h2",{"id":25},"basic-structure","Basic structure",[28,29,34],"pre",{"className":30,"code":31,"language":32,"meta":33,"style":33},"language-gherkin shiki shiki-themes github-light github-dark","Feature: Login\n\n  Scenario: Successful login\n    Given the user goes to the \"login\" page\n    When the user enters \"john@example.com\" into the \"email\" field\n    And the user enters \"mypassword\" into the \"password\" field\n    And the user clicks the \"login\" button\n    Then the page title should be \"Dashboard\"\n","gherkin","",[18,35,36,44,51,57,63,69,75,81],{"__ignoreMap":33},[37,38,41],"span",{"class":39,"line":40},"line",1,[37,42,43],{},"Feature: Login\n",[37,45,47],{"class":39,"line":46},2,[37,48,50],{"emptyLinePlaceholder":49},true,"\n",[37,52,54],{"class":39,"line":53},3,[37,55,56],{},"  Scenario: Successful login\n",[37,58,60],{"class":39,"line":59},4,[37,61,62],{},"    Given the user goes to the \"login\" page\n",[37,64,66],{"class":39,"line":65},5,[37,67,68],{},"    When the user enters \"john@example.com\" into the \"email\" field\n",[37,70,72],{"class":39,"line":71},6,[37,73,74],{},"    And the user enters \"mypassword\" into the \"password\" field\n",[37,76,78],{"class":39,"line":77},7,[37,79,80],{},"    And the user clicks the \"login\" button\n",[37,82,84],{"class":39,"line":83},8,[37,85,86],{},"    Then the page title should be \"Dashboard\"\n",[88,89,90,103],"table",{},[91,92,93],"thead",{},[94,95,96,100],"tr",{},[97,98,99],"th",{},"Keyword",[97,101,102],{},"Role",[104,105,106,118,128,138],"tbody",{},[94,107,108,115],{},[109,110,111],"td",{},[112,113,114],"strong",{},"Feature",[109,116,117],{},"What you're testing",[94,119,120,125],{},[109,121,122],{},[112,123,124],{},"Background",[109,126,127],{},"Steps run before every scenario in the file",[94,129,130,135],{},[109,131,132],{},[112,133,134],{},"Scenario",[109,136,137],{},"One test case",[94,139,140,145],{},[109,141,142],{},[112,143,144],{},"Given / When / Then / And / But",[109,146,147],{},"Steps (interchangeable — use for readability)",[14,149,150],{},"TestFlowKit matches steps by their text, not the keyword.",[23,152,154],{"id":153},"writing-a-good-scenario","Writing a good scenario",[156,157,158,162,165,168],"ol",{},[159,160,161],"li",{},"Name the scenario clearly — what behavior and outcome?",[159,163,164],{},"Write steps as you'd explain them to a colleague",[159,166,167],{},"Keep one behavior per scenario",[159,169,170,171,174,175],{},"Use tags to group tests: ",[18,172,173],{},"@smoke",", ",[18,176,177],{},"@regression",[28,179,183],{"className":180,"code":181,"language":182,"meta":33,"style":33},"language-bash shiki shiki-themes github-light github-dark","tkit run --tags @smoke\ntkit run --tags \"@login and not @slow\"\n","bash",[18,184,185,202],{"__ignoreMap":33},[37,186,187,191,195,199],{"class":39,"line":40},[37,188,190],{"class":189},"sScJk","tkit",[37,192,194],{"class":193},"sZZnC"," run",[37,196,198],{"class":197},"sj4cs"," --tags",[37,200,201],{"class":193}," @smoke\n",[37,203,204,206,208,210],{"class":39,"line":46},[37,205,190],{"class":189},[37,207,194],{"class":193},[37,209,198],{"class":197},[37,211,212],{"class":193}," \"@login and not @slow\"\n",[23,214,216],{"id":215},"data-in-steps","Data in steps",[14,218,219,222],{},[112,220,221],{},"Tables"," — key/value pairs:",[28,224,226],{"className":30,"code":225,"language":32,"meta":33,"style":33},"And I set the following path parameters:\n  | id | 123 |\n",[18,227,228,233],{"__ignoreMap":33},[37,229,230],{"class":39,"line":40},[37,231,232],{},"And I set the following path parameters:\n",[37,234,235],{"class":39,"line":46},[37,236,237],{},"  | id | 123 |\n",[14,239,240,243],{},[112,241,242],{},"Doc strings"," — multi-line text:",[28,245,247],{"className":30,"code":246,"language":32,"meta":33,"style":33},"And I set the request body to:\n  \"\"\"\n  { \"name\": \"John\", \"email\": \"john@example.com\" }\n  \"\"\"\n",[18,248,249,254,259,264],{"__ignoreMap":33},[37,250,251],{"class":39,"line":40},[37,252,253],{},"And I set the request body to:\n",[37,255,256],{"class":39,"line":46},[37,257,258],{},"  \"\"\"\n",[37,260,261],{"class":39,"line":53},[37,262,263],{},"  { \"name\": \"John\", \"email\": \"john@example.com\" }\n",[37,265,266],{"class":39,"line":59},[37,267,258],{},[23,269,271],{"id":270},"scenario-outline","Scenario Outline",[14,273,274],{},"Run the same steps with different data:",[28,276,278],{"className":30,"code":277,"language":32,"meta":33,"style":33},"Scenario Outline: Login attempts\n  When the user enters \"\u003Cemail>\" into the \"email\" field\n  And the user enters \"\u003Cpassword>\" into the \"password\" field\n  Then the \"\u003Cresult>\" should be visible\n\n  Examples:\n    | email             | password | result        |\n    | valid@example.com | correct  | dashboard     |\n    | bad@example.com   | wrong    | error_message |\n",[18,279,280,285,290,295,300,304,309,314,319],{"__ignoreMap":33},[37,281,282],{"class":39,"line":40},[37,283,284],{},"Scenario Outline: Login attempts\n",[37,286,287],{"class":39,"line":46},[37,288,289],{},"  When the user enters \"\u003Cemail>\" into the \"email\" field\n",[37,291,292],{"class":39,"line":53},[37,293,294],{},"  And the user enters \"\u003Cpassword>\" into the \"password\" field\n",[37,296,297],{"class":39,"line":59},[37,298,299],{},"  Then the \"\u003Cresult>\" should be visible\n",[37,301,302],{"class":39,"line":65},[37,303,50],{"emptyLinePlaceholder":49},[37,305,306],{"class":39,"line":71},[37,307,308],{},"  Examples:\n",[37,310,311],{"class":39,"line":77},[37,312,313],{},"    | email             | password | result        |\n",[37,315,316],{"class":39,"line":83},[37,317,318],{},"    | valid@example.com | correct  | dashboard     |\n",[37,320,322],{"class":39,"line":321},9,[37,323,324],{},"    | bad@example.com   | wrong    | error_message |\n",[23,326,328],{"id":327},"common-patterns","Common patterns",[14,330,331],{},[112,332,333],{},"Navigation:",[28,335,337],{"className":30,"code":336,"language":32,"meta":33,"style":33},"Given the user goes to the \"home\" page\nWhen the user clicks the \"about\" link\nThen the current URL should contain \"/about\"\n",[18,338,339,344,349],{"__ignoreMap":33},[37,340,341],{"class":39,"line":40},[37,342,343],{},"Given the user goes to the \"home\" page\n",[37,345,346],{"class":39,"line":46},[37,347,348],{},"When the user clicks the \"about\" link\n",[37,350,351],{"class":39,"line":53},[37,352,353],{},"Then the current URL should contain \"/about\"\n",[14,355,356],{},[112,357,358],{},"Forms:",[28,360,362],{"className":30,"code":361,"language":32,"meta":33,"style":33},"When the user enters \"Jane Doe\" into the \"name\" field\nAnd the user clicks the \"submit\" button\nThen the \"success_message\" should be visible\n",[18,363,364,369,374],{"__ignoreMap":33},[37,365,366],{"class":39,"line":40},[37,367,368],{},"When the user enters \"Jane Doe\" into the \"name\" field\n",[37,370,371],{"class":39,"line":46},[37,372,373],{},"And the user clicks the \"submit\" button\n",[37,375,376],{"class":39,"line":53},[37,377,378],{},"Then the \"success_message\" should be visible\n",[14,380,381],{},[112,382,383],{},"Visibility:",[28,385,387],{"className":30,"code":386,"language":32,"meta":33,"style":33},"Then the \"sidebar\" should be visible\nAnd the \"login_button\" should not be visible\n",[18,388,389,394],{"__ignoreMap":33},[37,390,391],{"class":39,"line":40},[37,392,393],{},"Then the \"sidebar\" should be visible\n",[37,395,396],{"class":39,"line":46},[37,397,398],{},"And the \"login_button\" should not be visible\n",[23,400,402],{"id":401},"what-developers-set-up-for-you","What developers set up for you",[404,405,406,412],"ul",{},[159,407,408,411],{},[112,409,410],{},"testflowkit.yml"," — Page URLs, element selectors, API definitions",[159,413,414,417,418,422],{},[112,415,416],{},"Macros"," — Reusable login/setup flows (",[419,420,416],"a",{"href":421},"/docs/patterns/macros",")",[14,424,425],{},"When a test fails, share the scenario name, error message, and what you expected.",[14,427,428,429,432],{},"Use ",[419,430,431],{"href":421},"macros"," to hide repetitive setup steps.",[23,434,436],{"id":435},"step-catalog","Step catalog",[14,438,439,440,446],{},"Browse the ",[112,441,442],{},[419,443,445],{"href":444},"/sentences","Step Definitions catalog"," for every available sentence — searchable by keyword and category.",[23,448,450],{"id":449},"next-steps","Next Steps",[404,452,453,460,467],{},[159,454,455,459],{},[419,456,458],{"href":457},"/docs/guides/frontend-testing","Frontend Testing"," — UI testing guide",[159,461,462,466],{},[419,463,465],{"href":464},"/docs/patterns/variables","Variables"," — Dynamic test data",[159,468,469,473],{},[419,470,472],{"href":471},"/docs/troubleshooting/common-issues","Common Issues"," — Troubleshooting",[475,476,477],"style",{},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}",{"title":33,"searchDepth":46,"depth":46,"links":479},[480,481,482,483,484,485,486,487],{"id":25,"depth":46,"text":26},{"id":153,"depth":46,"text":154},{"id":215,"depth":46,"text":216},{"id":270,"depth":46,"text":271},{"id":327,"depth":46,"text":328},{"id":401,"depth":46,"text":402},{"id":435,"depth":46,"text":436},{"id":449,"depth":46,"text":450},"Gherkin syntax and patterns for writing TestFlowKit scenarios","md",{},{"title":5},"/docs/guides/writing-tests",{"title":5,"description":488},"docs/guides/writing-tests","b3r9NHHQZSxWa1g2s5m0HixsbSv2IX-bPGkkiRli_Co",1781768344326]