How to use formatter method in storybook-root

Best JavaScript code snippet using storybook-root

report.js

Source:report.js Github

copy

Full Screen

1$(document).ready(function() {var formatter = new CucumberHTML.DOMFormatter($('.cucumber-report'));formatter.uri("features/ADT.feature");2formatter.feature({3 "name": "Abstract Data Types",4 "description": "",5 "keyword": "Feature"6});7formatter.scenario({8 "name": "Valid Pathnames",9 "description": "",10 "keyword": "Scenario"11});12formatter.before({13 "status": "passed"14});15formatter.before({16 "status": "passed"17});18formatter.before({19 "status": "passed"20});21formatter.before({22 "status": "passed"23});24formatter.before({25 "status": "passed"26});27formatter.before({28 "status": "passed"29});30formatter.before({31 "status": "passed"32});33formatter.step({34 "name": "pathname When processed Then valid or not",35 "rows": [36 {37 "cells": [38 "Pathname",39 "Valid",40 "Error"41 ]42 },43 {44 "cells": [45 "feature",46 "true",47 ""48 ]49 },50 {51 "cells": [52 "feature/",53 "true",54 ""55 ]56 },57 {58 "cells": [59 "feature***",60 "false",61 "BAD_PATHNAME"62 ]63 }64 ],65 "keyword": "Given "66});67formatter.match({68 "location": "StepDefinitionsADT.pathname_When_processed_Then_valid_or_not(PathnameInput\u003e)"69});70formatter.result({71 "status": "passed"72});73formatter.after({74 "status": "passed"75});76formatter.after({77 "status": "passed"78});79formatter.after({80 "status": "passed"81});82formatter.after({83 "status": "passed"84});85formatter.after({86 "status": "passed"87});88formatter.after({89 "status": "passed"90});91formatter.after({92 "status": "passed"93});94formatter.scenario({95 "name": "Adding to Pathname",96 "description": "",97 "keyword": "Scenario"98});99formatter.before({100 "status": "passed"101});102formatter.before({103 "status": "passed"104});105formatter.before({106 "status": "passed"107});108formatter.before({109 "status": "passed"110});111formatter.before({112 "status": "passed"113});114formatter.before({115 "status": "passed"116});117formatter.before({118 "status": "passed"119});120formatter.step({121 "name": "Pathname When added Then result is",122 "rows": [123 {124 "cells": [125 "Pathname",126 "Add",127 "Result"128 ]129 },130 {131 "cells": [132 "feature",133 "something",134 "feature\\something"135 ]136 },137 {138 "cells": [139 "feature\\",140 "something",141 "feature\\something"142 ]143 },144 {145 "cells": [146 "feature/",147 "/something",148 "feature\\something"149 ]150 },151 {152 "cells": [153 "feature",154 "\\something",155 "feature\\something"156 ]157 },158 {159 "cells": [160 "feature\\folder",161 "/something",162 "feature\\folder\\something"163 ]164 },165 {166 "cells": [167 "feature\\folder",168 "/something\\folder",169 "feature\\folder\\something\\folder"170 ]171 }172 ],173 "keyword": "Given "174});175formatter.match({176 "location": "StepDefinitionsADT.pathanme_When_added_Then_result_is(PathnameAddInput\u003e)"177});178formatter.result({179 "status": "passed"180});181formatter.after({182 "status": "passed"183});184formatter.after({185 "status": "passed"186});187formatter.after({188 "status": "passed"189});190formatter.after({191 "status": "passed"192});193formatter.after({194 "status": "passed"195});196formatter.after({197 "status": "passed"198});199formatter.after({200 "status": "passed"201});202formatter.scenario({203 "name": "Adding invalid to Pathname",204 "description": "",205 "keyword": "Scenario"206});207formatter.before({208 "status": "passed"209});210formatter.before({211 "status": "passed"212});213formatter.before({214 "status": "passed"215});216formatter.before({217 "status": "passed"218});219formatter.before({220 "status": "passed"221});222formatter.before({223 "status": "passed"224});225formatter.before({226 "status": "passed"227});228formatter.step({229 "name": "Pathname When added Then result is",230 "rows": [231 {232 "cells": [233 "Pathname",234 "Add",235 "Result",236 "Error"237 ]238 },239 {240 "cells": [241 "feature",242 "something****",243 "feature",244 "BAD_PATHNAME"245 ]246 }247 ],248 "keyword": "Given "249});250formatter.match({251 "location": "StepDefinitionsADT.pathanme_When_added_Then_result_is(PathnameAddInput\u003e)"252});253formatter.result({254 "status": "passed"255});256formatter.after({257 "status": "passed"258});259formatter.after({260 "status": "passed"261});262formatter.after({263 "status": "passed"264});265formatter.after({266 "status": "passed"267});268formatter.after({269 "status": "passed"270});271formatter.after({272 "status": "passed"273});274formatter.after({275 "status": "passed"276});277formatter.uri("features/CoverageHigher.feature");278formatter.feature({279 "name": "Just to make Coverage Higher",280 "description": "",281 "keyword": "Feature"282});283formatter.scenario({284 "name": "Call Methods that are not used normally",285 "description": "",286 "keyword": "Scenario"287});288formatter.before({289 "status": "passed"290});291formatter.before({292 "status": "passed"293});294formatter.before({295 "status": "passed"296});297formatter.before({298 "status": "passed"299});300formatter.before({301 "status": "passed"302});303formatter.before({304 "status": "passed"305});306formatter.before({307 "status": "passed"308});309formatter.step({310 "name": "Unused Methods",311 "keyword": "Given "312});313formatter.match({314 "location": "StepDefinitionsCoverage.unused_Methods()"315});316formatter.result({317 "status": "passed"318});319formatter.after({320 "status": "passed"321});322formatter.after({323 "status": "passed"324});325formatter.after({326 "status": "passed"327});328formatter.after({329 "status": "passed"330});331formatter.after({332 "status": "passed"333});334formatter.after({335 "status": "passed"336});337formatter.after({338 "status": "passed"339});340formatter.uri("features/LocalFunctions.feature");341formatter.feature({342 "name": "Local Functions",343 "description": "",344 "keyword": "Feature"345});346formatter.background({347 "name": "",348 "description": "",349 "keyword": "Background"350});351formatter.before({352 "status": "passed"353});354formatter.before({355 "status": "passed"356});357formatter.before({358 "status": "passed"359});360formatter.before({361 "status": "passed"362});363formatter.before({364 "status": "passed"365});366formatter.before({367 "status": "passed"368});369formatter.before({370 "status": "passed"371});372formatter.step({373 "name": "add local function:",374 "rows": [375 {376 "cells": [377 "Name"378 ]379 },380 {381 "cells": [382 "com.atddbdd.preprocessor.tests.TestFunctionReturnsZ"383 ]384 },385 {386 "cells": [387 "com.atddbdd.preprocessor.tests.TestFunctionReturnsAAA"388 ]389 },390 {391 "cells": [392 "com.atddbdd.preprocessor.tests.TestFunctionReturnsWhatIsPassed"393 ]394 }395 ],396 "keyword": "When "397});398formatter.match({399 "location": "StepDefinitions.add_local_function(NameInput\u003e)"400});401formatter.result({402 "status": "passed"403});404formatter.scenario({405 "name": "Added Local Function Returns Okay",406 "description": "",407 "keyword": "Scenario"408});409formatter.step({410 "name": "processing:",411 "keyword": "When ",412 "doc_string": {413 "value": "#define X \u003d TestFunctionReturnsZ() \nThis is X"414 }415});416formatter.match({417 "location": "StepDefinitions.processing(String)"418});419formatter.result({420 "status": "passed"421});422formatter.step({423 "name": "result is:",424 "keyword": "Then ",425 "doc_string": {426 "value": "This is Z"427 }428});429formatter.match({430 "location": "StepDefinitions.result_is(String)"431});432formatter.result({433 "status": "passed"434});435formatter.after({436 "status": "passed"437});438formatter.after({439 "status": "passed"440});441formatter.after({442 "status": "passed"443});444formatter.after({445 "status": "passed"446});447formatter.after({448 "status": "passed"449});450formatter.after({451 "status": "passed"452});453formatter.after({454 "status": "passed"455});456formatter.background({457 "name": "",458 "description": "",459 "keyword": "Background"460});461formatter.before({462 "status": "passed"463});464formatter.before({465 "status": "passed"466});467formatter.before({468 "status": "passed"469});470formatter.before({471 "status": "passed"472});473formatter.before({474 "status": "passed"475});476formatter.before({477 "status": "passed"478});479formatter.before({480 "status": "passed"481});482formatter.step({483 "name": "add local function:",484 "rows": [485 {486 "cells": [487 "Name"488 ]489 },490 {491 "cells": [492 "com.atddbdd.preprocessor.tests.TestFunctionReturnsZ"493 ]494 },495 {496 "cells": [497 "com.atddbdd.preprocessor.tests.TestFunctionReturnsAAA"498 ]499 },500 {501 "cells": [502 "com.atddbdd.preprocessor.tests.TestFunctionReturnsWhatIsPassed"503 ]504 }505 ],506 "keyword": "When "507});508formatter.match({509 "location": "StepDefinitions.add_local_function(NameInput\u003e)"510});511formatter.result({512 "status": "passed"513});514formatter.scenario({515 "name": "Local Function Returns Parameter",516 "description": "",517 "keyword": "Scenario"518});519formatter.step({520 "name": "processing:",521 "keyword": "When ",522 "doc_string": {523 "value": "#define X \u003d TestFunctionReturnsWhatIsPassed(ZZZ) \nThis is X"524 }525});526formatter.match({527 "location": "StepDefinitions.processing(String)"528});529formatter.result({530 "status": "passed"531});532formatter.step({533 "name": "result is:",534 "keyword": "Then ",535 "doc_string": {536 "value": "This is ZZZ"537 }538});539formatter.match({540 "location": "StepDefinitions.result_is(String)"541});542formatter.result({543 "status": "passed"544});545formatter.after({546 "status": "passed"547});548formatter.after({549 "status": "passed"550});551formatter.after({552 "status": "passed"553});554formatter.after({555 "status": "passed"556});557formatter.after({558 "status": "passed"559});560formatter.after({561 "status": "passed"562});563formatter.after({564 "status": "passed"565});566formatter.background({567 "name": "",568 "description": "",569 "keyword": "Background"570});571formatter.before({572 "status": "passed"573});574formatter.before({575 "status": "passed"576});577formatter.before({578 "status": "passed"579});580formatter.before({581 "status": "passed"582});583formatter.before({584 "status": "passed"585});586formatter.before({587 "status": "passed"588});589formatter.before({590 "status": "passed"591});592formatter.step({593 "name": "add local function:",594 "rows": [595 {596 "cells": [597 "Name"598 ]599 },600 {601 "cells": [602 "com.atddbdd.preprocessor.tests.TestFunctionReturnsZ"603 ]604 },605 {606 "cells": [607 "com.atddbdd.preprocessor.tests.TestFunctionReturnsAAA"608 ]609 },610 {611 "cells": [612 "com.atddbdd.preprocessor.tests.TestFunctionReturnsWhatIsPassed"613 ]614 }615 ],616 "keyword": "When "617});618formatter.match({619 "location": "StepDefinitions.add_local_function(NameInput\u003e)"620});621formatter.result({622 "status": "passed"623});624formatter.scenario({625 "name": "Local Function Not There",626 "description": "",627 "keyword": "Scenario"628});629formatter.step({630 "name": "processing:",631 "keyword": "When ",632 "doc_string": {633 "value": "#define X \u003d NotALocalFunction()\nThis is X"634 }635});636formatter.match({637 "location": "StepDefinitions.processing(String)"638});639formatter.result({640 "status": "passed"641});642formatter.step({643 "name": "result is:",644 "keyword": "Then ",645 "doc_string": {646 "value": "This is NotALocalFunction()"647 }648});649formatter.match({650 "location": "StepDefinitions.result_is(String)"651});652formatter.result({653 "status": "passed"654});655formatter.after({656 "status": "passed"657});658formatter.after({659 "status": "passed"660});661formatter.after({662 "status": "passed"663});664formatter.after({665 "status": "passed"666});667formatter.after({668 "status": "passed"669});670formatter.after({671 "status": "passed"672});673formatter.after({674 "status": "passed"675});676formatter.background({677 "name": "",678 "description": "",679 "keyword": "Background"680});681formatter.before({682 "status": "passed"683});684formatter.before({685 "status": "passed"686});687formatter.before({688 "status": "passed"689});690formatter.before({691 "status": "passed"692});693formatter.before({694 "status": "passed"695});696formatter.before({697 "status": "passed"698});699formatter.before({700 "status": "passed"701});702formatter.step({703 "name": "add local function:",704 "rows": [705 {706 "cells": [707 "Name"708 ]709 },710 {711 "cells": [712 "com.atddbdd.preprocessor.tests.TestFunctionReturnsZ"713 ]714 },715 {716 "cells": [717 "com.atddbdd.preprocessor.tests.TestFunctionReturnsAAA"718 ]719 },720 {721 "cells": [722 "com.atddbdd.preprocessor.tests.TestFunctionReturnsWhatIsPassed"723 ]724 }725 ],726 "keyword": "When "727});728formatter.match({729 "location": "StepDefinitions.add_local_function(NameInput\u003e)"730});731formatter.result({732 "status": "passed"733});734formatter.scenario({735 "name": "Difference in Days",736 "description": "",737 "keyword": "Scenario"738});739formatter.step({740 "name": "processing:",741 "keyword": "When ",742 "doc_string": {743 "value": "#define TODAY \u003d Today()\n#define THREE_DAYS_FROM_NOW \u003d TodayOffsetBy(3) \n#define DIFFERENCE \u003d DaysDifference(TODAY,THREE_DAYS_FROM_NOW) \nDifference is DIFFERENCE"744 }745});746formatter.match({747 "location": "StepDefinitions.processing(String)"748});749formatter.result({750 "status": "passed"751});752formatter.step({753 "name": "result is:",754 "keyword": "Then ",755 "doc_string": {756 "value": "Difference is 3"757 }758});759formatter.match({760 "location": "StepDefinitions.result_is(String)"761});762formatter.result({763 "status": "passed"764});765formatter.after({766 "status": "passed"767});768formatter.after({769 "status": "passed"770});771formatter.after({772 "status": "passed"773});774formatter.after({775 "status": "passed"776});777formatter.after({778 "status": "passed"779});780formatter.after({781 "status": "passed"782});783formatter.after({784 "status": "passed"785});786formatter.uri("features/Main.feature");787formatter.feature({788 "name": "Main Program",789 "description": "",790 "keyword": "Feature"791});792formatter.background({793 "name": "",794 "description": "",795 "keyword": "Background"796});797formatter.before({798 "status": "passed"799});800formatter.before({801 "status": "passed"802});803formatter.before({804 "status": "passed"805});806formatter.before({807 "status": "passed"808});809formatter.before({810 "status": "passed"811});812formatter.before({813 "status": "passed"814});815formatter.before({816 "status": "passed"817});818formatter.step({819 "name": "delete feature output",820 "keyword": "Given "821});822formatter.match({823 "location": "StepDefinitionsMain.delete_feature_output()"824});825formatter.result({826 "status": "passed"827});828formatter.scenario({829 "name": "Full Program",830 "description": "",831 "keyword": "Scenario"832});833formatter.step({834 "name": "include file TestInclude.txt exists with:",835 "keyword": "Given ",836 "doc_string": {837 "value": "#define X 1\n#define Y \u003d X + 3\n"838 }839});840formatter.match({841 "location": "StepDefinitionsMain.include_file_TestInclude_txt_exists_with(Pathname,String)"842});843formatter.result({844 "status": "passed"845});846formatter.step({847 "name": "include file TestCSV.csv exists with:",848 "keyword": "Given ",849 "doc_string": {850 "value": "FieldOne, FieldTwo\n1,2\n"851 }852});853formatter.match({854 "location": "StepDefinitionsMain.include_file_TestInclude_txt_exists_with(Pathname,String)"855});856formatter.result({857 "status": "passed"858});859formatter.step({860 "name": "feature file TestFeature.feature exists with:",861 "keyword": "Given ",862 "doc_string": {863 "value": "Feature: Test Feature\n#include \"TestInclude.txt\" \nScenario: One\nGiven value is X\nWhen processed\nThen result is Y\nScenario Outline: Two \nGiven value is \u003cFieldOne\u003e\nWhen processed \nThen result is \u003cFieldTwo\u003e \nExamples:\n#include \"TestCSV.csv\"\n"864 }865});866formatter.match({867 "location": "StepDefinitionsMain.feature_TestFeature_feature_exists_with(Pathname,String)"868});869formatter.result({870 "status": "passed"871});872formatter.step({873 "name": "main program run",874 "keyword": "When "875});876formatter.match({877 "location": "StepDefinitionsMain.main_program_run()"878});879formatter.result({880 "status": "passed"881});882formatter.step({883 "name": "feature file TestFeature.feature contains",884 "keyword": "Then ",885 "doc_string": {886 "value": "Feature: Test Feature\nScenario: One\nGiven value is 1\nWhen processed\nThen result is 4\nScenario Outline: Two \nGiven value is \u003cFieldOne\u003e\nWhen processed \nThen result is \u003cFieldTwo\u003e \nExamples:\n|FieldOne|FieldTwo|\n|1|2|\n"887 }888});889formatter.match({890 "location": "StepDefinitionsMain.feature_TestFeature_feature_contains(Pathname,String)"891});892formatter.result({893 "status": "passed"894});895formatter.after({896 "status": "passed"897});898formatter.after({899 "status": "passed"900});901formatter.after({902 "status": "passed"903});904formatter.after({905 "status": "passed"906});907formatter.after({908 "status": "passed"909});910formatter.after({911 "status": "passed"912});913formatter.after({914 "status": "passed"915});916formatter.background({917 "name": "",918 "description": "",919 "keyword": "Background"920});921formatter.before({922 "status": "passed"923});924formatter.before({925 "status": "passed"926});927formatter.before({928 "status": "passed"929});930formatter.before({931 "status": "passed"932});933formatter.before({934 "status": "passed"935});936formatter.before({937 "status": "passed"938});939formatter.before({940 "status": "passed"941});942formatter.step({943 "name": "delete feature output",944 "keyword": "Given "945});946formatter.match({947 "location": "StepDefinitionsMain.delete_feature_output()"948});949formatter.result({950 "status": "passed"951});952formatter.scenario({953 "name": "Full Program with nested features and includes",954 "description": "",955 "keyword": "Scenario"956});957formatter.step({958 "name": "include file /folder/TestInclude.txt exists with:",959 "keyword": "Given ",960 "doc_string": {961 "value": "#define X 1\n#define Y \u003d X + 3\n"962 }963});964formatter.match({965 "location": "StepDefinitionsMain.include_file_TestInclude_txt_exists_with(Pathname,String)"966});967formatter.result({968 "status": "passed"969});970formatter.step({971 "name": "feature file folder/TestFeature.feature exists with:",972 "keyword": "Given ",973 "doc_string": {974 "value": "Feature: Test Feature\n#include \"folder/TestInclude.txt\" \nGiven value is X\nWhen processed\nThen result is Y\n"975 }976});977formatter.match({978 "location": "StepDefinitionsMain.feature_TestFeature_feature_exists_with(Pathname,String)"979});980formatter.result({981 "status": "passed"982});983formatter.step({984 "name": "main program run",985 "keyword": "When "986});987formatter.match({988 "location": "StepDefinitionsMain.main_program_run()"989});990formatter.result({991 "status": "passed"992});993formatter.step({994 "name": "feature file folder/TestFeature.feature contains",995 "keyword": "Then ",996 "doc_string": {997 "value": "Feature: Test Feature\nGiven value is 1\nWhen processed\nThen result is 4\n"998 }999});1000formatter.match({1001 "location": "StepDefinitionsMain.feature_TestFeature_feature_contains(Pathname,String)"1002});1003formatter.result({1004 "status": "passed"1005});1006formatter.after({1007 "status": "passed"1008});1009formatter.after({1010 "status": "passed"1011});1012formatter.after({1013 "status": "passed"1014});1015formatter.after({1016 "status": "passed"1017});1018formatter.after({1019 "status": "passed"1020});1021formatter.after({1022 "status": "passed"1023});1024formatter.after({1025 "status": "passed"1026});1027formatter.background({1028 "name": "",1029 "description": "",1030 "keyword": "Background"1031});1032formatter.before({1033 "status": "passed"1034});1035formatter.before({1036 "status": "passed"1037});1038formatter.before({1039 "status": "passed"1040});1041formatter.before({1042 "status": "passed"1043});1044formatter.before({1045 "status": "passed"1046});1047formatter.before({1048 "status": "passed"1049});1050formatter.before({1051 "status": "passed"1052});1053formatter.step({1054 "name": "delete feature output",1055 "keyword": "Given "1056});1057formatter.match({1058 "location": "StepDefinitionsMain.delete_feature_output()"1059});1060formatter.result({1061 "status": "passed"1062});1063formatter.scenario({1064 "name": "Delete files",1065 "description": "",1066 "keyword": "Scenario"1067});1068formatter.step({1069 "name": "feature out file TestFeature.feature exists with:",1070 "keyword": "Given ",1071 "doc_string": {1072 "value": "Feature: Test Feature\nGiven value is X\n"1073 }1074});1075formatter.match({1076 "location": "StepDefinitionsMain.feature_out_exists_with(Pathname,String)"1077});1078formatter.result({1079 "status": "passed"1080});1081formatter.step({1082 "name": "feature out file foldertest/TestOneFeature.feature exists with:",1083 "keyword": "Given ",1084 "doc_string": {1085 "value": "Feature: Test One Feature\nGiven value is Y \n"1086 }1087});1088formatter.match({1089 "location": "StepDefinitionsMain.feature_out_exists_with(Pathname,String)"1090});1091formatter.result({1092 "status": "passed"1093});1094formatter.step({1095 "name": "delete feature output",1096 "keyword": "When "1097});1098formatter.match({1099 "location": "StepDefinitionsMain.delete_feature_output()"1100});1101formatter.result({1102 "status": "passed"1103});1104formatter.step({1105 "name": "feature out file foldertest/TestOneFeature.feature does not exist",1106 "keyword": "Then "1107});1108formatter.match({1109 "location": "StepDefinitionsMain.feature_file_foldertest_TestOneFeature_feature_does_not_exist(Pathname)"1110});1111formatter.result({1112 "status": "passed"1113});1114formatter.step({1115 "name": "feature out file TestFeature.feature does not exist",1116 "keyword": "Then "1117});1118formatter.match({1119 "location": "StepDefinitionsMain.feature_file_foldertest_TestOneFeature_feature_does_not_exist(Pathname)"1120});1121formatter.result({1122 "status": "passed"1123});1124formatter.after({1125 "status": "passed"1126});1127formatter.after({1128 "status": "passed"1129});1130formatter.after({1131 "status": "passed"1132});1133formatter.after({1134 "status": "passed"1135});1136formatter.after({1137 "status": "passed"1138});1139formatter.after({1140 "status": "passed"1141});1142formatter.after({1143 "status": "passed"1144});1145formatter.background({1146 "name": "",1147 "description": "",1148 "keyword": "Background"1149});1150formatter.before({1151 "status": "passed"1152});1153formatter.before({1154 "status": "passed"1155});1156formatter.before({1157 "status": "passed"1158});1159formatter.before({1160 "status": "passed"1161});1162formatter.before({1163 "status": "passed"1164});1165formatter.before({1166 "status": "passed"1167});1168formatter.before({1169 "status": "passed"1170});1171formatter.step({1172 "name": "delete feature output",1173 "keyword": "Given "1174});1175formatter.match({1176 "location": "StepDefinitionsMain.delete_feature_output()"1177});1178formatter.result({1179 "status": "passed"1180});1181formatter.scenario({1182 "name": "Configuration value settings",1183 "description": "",1184 "keyword": "Scenario"1185});1186formatter.step({1187 "name": "configuration values are:",1188 "rows": [1189 {1190 "cells": [1191 "Name",1192 "Value"1193 ]1194 },1195 {1196 "cells": [1197 "inputFeaturePath",1198 "featurein"1199 ]1200 },1201 {1202 "cells": [1203 "outputFeaturePath",1204 "featureout"1205 ]1206 },1207 {1208 "cells": [1209 "relativeIncludeDirectory",1210 "featurein"1211 ]1212 }1213 ],1214 "keyword": "Given "1215});1216formatter.match({1217 "location": "StepDefinitionsMain.configuration_values_are(ConfigurationValues\u003e)"1218});1219formatter.result({1220 "status": "passed"1221});1222formatter.step({1223 "name": "parameters are:",1224 "rows": [1225 {1226 "cells": [1227 "Argv"1228 ]1229 },1230 {1231 "cells": [1232 "-featurein"1233 ]1234 },1235 {1236 "cells": [1237 "xxx"1238 ]1239 },1240 {1241 "cells": [1242 "-featureout"1243 ]1244 },1245 {1246 "cells": [1247 "yyy"1248 ]1249 },1250 {1251 "cells": [1252 "-include"1253 ]1254 },1255 {1256 "cells": [1257 "zzz"1258 ]1259 }1260 ],1261 "keyword": "When "1262});1263formatter.match({1264 "location": "StepDefinitionsMain.parameters_are(ParameterInput\u003e)"1265});1266formatter.result({1267 "status": "passed"1268});1269formatter.step({1270 "name": "configuration values are:",1271 "rows": [1272 {1273 "cells": [1274 "Name",1275 "Value"1276 ]1277 },1278 {1279 "cells": [1280 "inputFeaturePath",1281 "xxx"1282 ]1283 },1284 {1285 "cells": [1286 "outputFeaturePath",1287 "yyy"1288 ]1289 },1290 {1291 "cells": [1292 "relativeIncludeDirectory",1293 "zzz"1294 ]1295 }1296 ],1297 "keyword": "Then "1298});1299formatter.match({1300 "location": "StepDefinitionsMain.configuration_values_are(ConfigurationValues\u003e)"1301});1302formatter.result({1303 "status": "passed"1304});1305formatter.after({1306 "status": "passed"1307});1308formatter.after({1309 "status": "passed"1310});1311formatter.after({1312 "status": "passed"1313});1314formatter.after({1315 "status": "passed"1316});1317formatter.after({1318 "status": "passed"1319});1320formatter.after({1321 "status": "passed"1322});1323formatter.after({1324 "status": "passed"1325});1326formatter.background({1327 "name": "",1328 "description": "",1329 "keyword": "Background"1330});1331formatter.before({1332 "status": "passed"1333});1334formatter.before({1335 "status": "passed"1336});1337formatter.before({1338 "status": "passed"1339});1340formatter.before({1341 "status": "passed"1342});1343formatter.before({1344 "status": "passed"1345});1346formatter.before({1347 "status": "passed"1348});1349formatter.before({1350 "status": "passed"1351});1352formatter.step({1353 "name": "delete feature output",1354 "keyword": "Given "1355});1356formatter.match({1357 "location": "StepDefinitionsMain.delete_feature_output()"1358});1359formatter.result({1360 "status": "passed"1361});1362formatter.scenario({1363 "name": "To execute command line settings in parser",1364 "description": "",1365 "keyword": "Scenario"1366});1367formatter.step({1368 "name": "executing program as:",1369 "keyword": "* ",1370 "doc_string": {1371 "value": "java -jar preprocessor.jar -featurein featurein -featureout featureout -include featurein "1372 }1373});1374formatter.match({1375 "location": "StepDefinitionsMain.executing_program_as(String)"1376});1377formatter.result({1378 "status": "passed"1379});1380formatter.after({1381 "status": "passed"1382});1383formatter.after({1384 "status": "passed"1385});1386formatter.after({1387 "status": "passed"1388});1389formatter.after({1390 "status": "passed"1391});1392formatter.after({1393 "status": "passed"1394});1395formatter.after({1396 "status": "passed"1397});1398formatter.after({1399 "status": "passed"1400});1401formatter.background({1402 "name": "",1403 "description": "",1404 "keyword": "Background"1405});1406formatter.before({1407 "status": "passed"1408});1409formatter.before({1410 "status": "passed"1411});1412formatter.before({1413 "status": "passed"1414});1415formatter.before({1416 "status": "passed"1417});1418formatter.before({1419 "status": "passed"1420});1421formatter.before({1422 "status": "passed"1423});1424formatter.before({1425 "status": "passed"1426});1427formatter.step({1428 "name": "delete feature output",1429 "keyword": "Given "1430});1431formatter.match({1432 "location": "StepDefinitionsMain.delete_feature_output()"1433});1434formatter.result({1435 "status": "passed"1436});1437formatter.scenario({1438 "name": "To execute command line settings in parser",1439 "description": "",1440 "keyword": "Scenario"1441});1442formatter.step({1443 "name": "executing program as:",1444 "keyword": "* ",1445 "doc_string": {1446 "value": "java -jar preprocessor.jar "1447 }1448});1449formatter.match({1450 "location": "StepDefinitionsMain.executing_program_as(String)"1451});1452formatter.result({1453 "status": "passed"1454});1455formatter.after({1456 "status": "passed"1457});1458formatter.after({1459 "status": "passed"1460});1461formatter.after({1462 "status": "passed"1463});1464formatter.after({1465 "status": "passed"1466});1467formatter.after({1468 "status": "passed"1469});1470formatter.after({1471 "status": "passed"1472});1473formatter.after({1474 "status": "passed"1475});1476formatter.uri("features/allaspects.feature");1477formatter.feature({1478 "name": "Multiple aspects combined in Preprocessor",1479 "description": "",1480 "keyword": "Feature"1481});1482formatter.background({1483 "name": "",1484 "description": "",1485 "keyword": "Background"1486});1487formatter.before({1488 "status": "passed"1489});1490formatter.before({1491 "status": "passed"1492});1493formatter.before({1494 "status": "passed"1495});1496formatter.before({1497 "status": "passed"1498});1499formatter.before({1500 "status": "passed"1501});1502formatter.before({1503 "status": "passed"1504});1505formatter.before({1506 "status": "passed"1507});1508formatter.step({1509 "name": "add local function:",1510 "rows": [1511 {1512 "cells": [1513 "Name"1514 ]1515 },1516 {1517 "cells": [1518 "com.atddbdd.preprocessor.tests.TestFunctionReturnsZ"1519 ]1520 },1521 {1522 "cells": [1523 "com.atddbdd.preprocessor.tests.TestFunctionReturnsAAA"1524 ]1525 },1526 {1527 "cells": [1528 "com.atddbdd.preprocessor.tests.TestFunctionReturnsWhatIsPassed"1529 ]1530 }1531 ],1532 "keyword": "When "1533});1534formatter.match({1535 "location": "StepDefinitions.add_local_function(NameInput\u003e)"1536});1537formatter.result({1538 "status": "passed"1539});1540formatter.scenario({1541 "name": "Process include with define",1542 "description": "",1543 "keyword": "Scenario"1544});1545formatter.step({1546 "name": "file SampleInclude.txt exists with:",1547 "keyword": "Given ",1548 "doc_string": {1549 "value": "#define X 14\n"1550 }1551});1552formatter.match({1553 "location": "StepDefinitions.file_exists_with(Pathname,String)"1554});1555formatter.result({1556 "status": "passed"1557});1558formatter.step({1559 "name": "processing:",1560 "keyword": "When ",1561 "doc_string": {1562 "value": "First line\n#include \"SampleInclude.txt\"\nValue is X \nLast line"1563 }1564});1565formatter.match({1566 "location": "StepDefinitions.processing(String)"1567});1568formatter.result({1569 "status": "passed"1570});1571formatter.step({1572 "name": "result is:",1573 "keyword": "Then ",1574 "doc_string": {1575 "value": "First line\nValue is 14 \nLast line"1576 }1577});1578formatter.match({1579 "location": "StepDefinitions.result_is(String)"1580});1581formatter.result({1582 "status": "passed"1583});1584formatter.after({1585 "status": "passed"1586});1587formatter.after({1588 "status": "passed"1589});1590formatter.after({1591 "status": "passed"1592});1593formatter.after({1594 "status": "passed"1595});1596formatter.after({1597 "status": "passed"1598});1599formatter.after({1600 "status": "passed"1601});1602formatter.after({1603 "status": "passed"1604});1605formatter.background({1606 "name": "",1607 "description": "",1608 "keyword": "Background"1609});1610formatter.before({1611 "status": "passed"1612});1613formatter.before({1614 "status": "passed"1615});1616formatter.before({1617 "status": "passed"1618});1619formatter.before({1620 "status": "passed"1621});1622formatter.before({1623 "status": "passed"1624});1625formatter.before({1626 "status": "passed"1627});1628formatter.before({1629 "status": "passed"1630});1631formatter.step({1632 "name": "add local function:",1633 "rows": [1634 {1635 "cells": [1636 "Name"1637 ]1638 },1639 {1640 "cells": [1641 "com.atddbdd.preprocessor.tests.TestFunctionReturnsZ"1642 ]1643 },1644 {1645 "cells": [1646 "com.atddbdd.preprocessor.tests.TestFunctionReturnsAAA"1647 ]1648 },1649 {1650 "cells": [1651 "com.atddbdd.preprocessor.tests.TestFunctionReturnsWhatIsPassed"1652 ]1653 }1654 ],1655 "keyword": "When "1656});1657formatter.match({1658 "location": "StepDefinitions.add_local_function(NameInput\u003e)"1659});1660formatter.result({1661 "status": "passed"1662});1663formatter.scenario({1664 "name": "Process define in an expression",1665 "description": "",1666 "keyword": "Scenario"1667});1668formatter.step({1669 "name": "defines set up:",1670 "rows": [1671 {1672 "cells": [1673 "Define",1674 "Value"1675 ]1676 },1677 {1678 "cells": [1679 "Y",1680 "15"1681 ]1682 },1683 {1684 "cells": [1685 "X",1686 "\u003d Y + 3"1687 ]1688 }1689 ],1690 "keyword": "Given "1691});1692formatter.match({1693 "location": "StepDefinitions.defines_set_up(DefineValues\u003e)"1694});1695formatter.result({1696 "status": "passed"1697});1698formatter.step({1699 "name": "processing defines",1700 "keyword": "When "1701});1702formatter.match({1703 "location": "StepDefinitions.processing_defines()"1704});1705formatter.result({1706 "status": "passed"1707});1708formatter.step({1709 "name": "defines are:",1710 "rows": [1711 {1712 "cells": [1713 "Define",1714 "Value"1715 ]1716 },1717 {1718 "cells": [1719 "Y",1720 "15"1721 ]1722 },1723 {1724 "cells": [1725 "X",1726 "18"1727 ]1728 }1729 ],1730 "keyword": "Then "1731});1732formatter.match({1733 "location": "StepDefinitions.defines_are(DefineValues\u003e)"1734});1735formatter.result({1736 "status": "passed"1737});1738formatter.after({1739 "status": "passed"1740});1741formatter.after({1742 "status": "passed"1743});1744formatter.after({1745 "status": "passed"1746});1747formatter.after({1748 "status": "passed"1749});1750formatter.after({1751 "status": "passed"1752});1753formatter.after({1754 "status": "passed"1755});1756formatter.after({1757 "status": "passed"1758});1759formatter.background({1760 "name": "",1761 "description": "",1762 "keyword": "Background"1763});1764formatter.before({1765 "status": "passed"1766});1767formatter.before({1768 "status": "passed"1769});1770formatter.before({1771 "status": "passed"1772});1773formatter.before({1774 "status": "passed"1775});1776formatter.before({1777 "status": "passed"1778});1779formatter.before({1780 "status": "passed"1781});1782formatter.before({1783 "status": "passed"1784});1785formatter.step({1786 "name": "add local function:",1787 "rows": [1788 {1789 "cells": [1790 "Name"1791 ]1792 },1793 {1794 "cells": [1795 "com.atddbdd.preprocessor.tests.TestFunctionReturnsZ"1796 ]1797 },1798 {1799 "cells": [1800 "com.atddbdd.preprocessor.tests.TestFunctionReturnsAAA"1801 ]1802 },1803 {1804 "cells": [1805 "com.atddbdd.preprocessor.tests.TestFunctionReturnsWhatIsPassed"1806 ]1807 }1808 ],1809 "keyword": "When "1810});1811formatter.match({1812 "location": "StepDefinitions.add_local_function(NameInput\u003e)"1813});1814formatter.result({1815 "status": "passed"1816});1817formatter.scenario({1818 "name": "Process bad expression",1819 "description": "",1820 "keyword": "Scenario"1821});1822formatter.step({1823 "name": "defines set up:",1824 "rows": [1825 {1826 "cells": [1827 "Define",1828 "Value"1829 ]1830 },1831 {1832 "cells": [1833 "Y",1834 "q17"1835 ]1836 },1837 {1838 "cells": [1839 "X",1840 "\u003d Y + 3"1841 ]1842 }1843 ],1844 "keyword": "Given "1845});1846formatter.match({1847 "location": "StepDefinitions.defines_set_up(DefineValues\u003e)"1848});1849formatter.result({1850 "status": "passed"1851});1852formatter.step({1853 "name": "processing defines",1854 "keyword": "When "1855});1856formatter.match({1857 "location": "StepDefinitions.processing_defines()"1858});1859formatter.result({1860 "status": "passed"1861});1862formatter.step({1863 "name": "defines are:",1864 "rows": [1865 {1866 "cells": [1867 "Define",1868 "Value"1869 ]1870 },1871 {1872 "cells": [1873 "Y",1874 "q17"1875 ]1876 },1877 {1878 "cells": [1879 "X",1880 "q17 + 3"1881 ]1882 }1883 ],1884 "keyword": "Then "1885});1886formatter.match({1887 "location": "StepDefinitions.defines_are(DefineValues\u003e)"1888});1889formatter.result({1890 "status": "passed"1891});1892formatter.after({1893 "status": "passed"1894});1895formatter.after({1896 "status": "passed"1897});1898formatter.after({1899 "status": "passed"1900});1901formatter.after({1902 "status": "passed"1903});1904formatter.after({1905 "status": "passed"1906});1907formatter.after({1908 "status": "passed"1909});1910formatter.after({1911 "status": "passed"1912});1913formatter.background({1914 "name": "",1915 "description": "",1916 "keyword": "Background"1917});1918formatter.before({1919 "status": "passed"1920});1921formatter.before({1922 "status": "passed"1923});1924formatter.before({1925 "status": "passed"1926});1927formatter.before({1928 "status": "passed"1929});1930formatter.before({1931 "status": "passed"1932});1933formatter.before({1934 "status": "passed"1935});1936formatter.before({1937 "status": "passed"1938});1939formatter.step({1940 "name": "add local function:",1941 "rows": [1942 {1943 "cells": [1944 "Name"1945 ]1946 },1947 {1948 "cells": [1949 "com.atddbdd.preprocessor.tests.TestFunctionReturnsZ"1950 ]1951 },1952 {1953 "cells": [1954 "com.atddbdd.preprocessor.tests.TestFunctionReturnsAAA"1955 ]1956 },1957 {1958 "cells": [1959 "com.atddbdd.preprocessor.tests.TestFunctionReturnsWhatIsPassed"1960 ]1961 }1962 ],1963 "keyword": "When "1964});1965formatter.match({1966 "location": "StepDefinitions.add_local_function(NameInput\u003e)"1967});1968formatter.result({1969 "status": "passed"1970});1971formatter.scenario({1972 "name": "Process an internal function in expression",1973 "description": "",1974 "keyword": "Scenario"1975});1976formatter.step({1977 "name": "defines set up:",1978 "rows": [1979 {1980 "cells": [1981 "Define",1982 "Value"1983 ]1984 },1985 {1986 "cells": [1987 "X",1988 "\u003d TestFunctionReturnsAAA()"1989 ]1990 },1991 {1992 "cells": [1993 "Y",1994 "\u003d TestFunctionReturnsAAA(a)"1995 ]1996 },1997 {1998 "cells": [1999 "Z",2000 "\u003d TestFunctionReturnsAAA(a,b)"2001 ]2002 }2003 ],2004 "keyword": "Given "2005});2006formatter.match({2007 "location": "StepDefinitions.defines_set_up(DefineValues\u003e)"2008});2009formatter.result({2010 "status": "passed"2011});2012formatter.step({2013 "name": "processing defines",2014 "keyword": "When "2015});2016formatter.match({2017 "location": "StepDefinitions.processing_defines()"2018});2019formatter.result({2020 "status": "passed"2021});2022formatter.step({2023 "name": "defines are:",2024 "rows": [2025 {2026 "cells": [2027 "Define",2028 "Value"2029 ]2030 },2031 {2032 "cells": [2033 "X",2034 "AAA"2035 ]2036 },2037 {2038 "cells": [2039 "Y",2040 "AAAa"2041 ]2042 },2043 {2044 "cells": [2045 "Z",2046 "AAAab"2047 ]2048 }2049 ],2050 "keyword": "Then "2051});2052formatter.match({2053 "location": "StepDefinitions.defines_are(DefineValues\u003e)"2054});2055formatter.result({2056 "status": "passed"2057});2058formatter.after({2059 "status": "passed"2060});2061formatter.after({2062 "status": "passed"2063});2064formatter.after({2065 "status": "passed"2066});2067formatter.after({2068 "status": "passed"2069});2070formatter.after({2071 "status": "passed"2072});2073formatter.after({2074 "status": "passed"2075});2076formatter.after({2077 "status": "passed"2078});2079formatter.background({2080 "name": "",2081 "description": "",2082 "keyword": "Background"2083});2084formatter.before({2085 "status": "passed"2086});2087formatter.before({2088 "status": "passed"2089});2090formatter.before({2091 "status": "passed"2092});2093formatter.before({2094 "status": "passed"2095});2096formatter.before({2097 "status": "passed"2098});2099formatter.before({2100 "status": "passed"2101});2102formatter.before({2103 "status": "passed"2104});2105formatter.step({2106 "name": "add local function:",2107 "rows": [2108 {2109 "cells": [2110 "Name"2111 ]2112 },2113 {2114 "cells": [2115 "com.atddbdd.preprocessor.tests.TestFunctionReturnsZ"2116 ]2117 },2118 {2119 "cells": [2120 "com.atddbdd.preprocessor.tests.TestFunctionReturnsAAA"2121 ]2122 },2123 {2124 "cells": [2125 "com.atddbdd.preprocessor.tests.TestFunctionReturnsWhatIsPassed"2126 ]2127 }2128 ],2129 "keyword": "When "2130});2131formatter.match({2132 "location": "StepDefinitions.add_local_function(NameInput\u003e)"2133});2134formatter.result({2135 "status": "passed"2136});2137formatter.scenario({2138 "name": "Process define within function parameter",2139 "description": "",2140 "keyword": "Scenario"2141});2142formatter.step({2143 "name": "defines set up:",2144 "rows": [2145 {2146 "cells": [2147 "Define",2148 "Value"2149 ]2150 },2151 {2152 "cells": [2153 "X",2154 "Something to append"2155 ]2156 },2157 {2158 "cells": [2159 "Y",2160 "\u003d TestFunctionReturnsAAA(X)"2161 ]2162 }2163 ],2164 "keyword": "Given "2165});2166formatter.match({2167 "location": "StepDefinitions.defines_set_up(DefineValues\u003e)"2168});2169formatter.result({2170 "status": "passed"2171});2172formatter.step({2173 "name": "processing defines",2174 "keyword": "When "2175});2176formatter.match({2177 "location": "StepDefinitions.processing_defines()"2178});2179formatter.result({2180 "status": "passed"2181});2182formatter.step({2183 "name": "defines are:",2184 "rows": [2185 {2186 "cells": [2187 "Define",2188 "Value"2189 ]2190 },2191 {2192 "cells": [2193 "X",2194 "Something to append"2195 ]2196 },2197 {2198 "cells": [2199 "Y",2200 "AAASomething to append"2201 ]2202 }2203 ],2204 "keyword": "Then "2205});2206formatter.match({2207 "location": "StepDefinitions.defines_are(DefineValues\u003e)"2208});2209formatter.result({2210 "status": "passed"2211});2212formatter.after({2213 "status": "passed"2214});2215formatter.after({2216 "status": "passed"2217});2218formatter.after({2219 "status": "passed"2220});2221formatter.after({2222 "status": "passed"2223});2224formatter.after({2225 "status": "passed"2226});2227formatter.after({2228 "status": "passed"2229});2230formatter.after({2231 "status": "passed"2232});2233formatter.background({2234 "name": "",2235 "description": "",2236 "keyword": "Background"2237});2238formatter.before({2239 "status": "passed"2240});2241formatter.before({2242 "status": "passed"2243});2244formatter.before({2245 "status": "passed"2246});2247formatter.before({2248 "status": "passed"2249});2250formatter.before({2251 "status": "passed"2252});2253formatter.before({2254 "status": "passed"2255});2256formatter.before({2257 "status": "passed"2258});2259formatter.step({2260 "name": "add local function:",2261 "rows": [2262 {2263 "cells": [2264 "Name"2265 ]2266 },2267 {2268 "cells": [2269 "com.atddbdd.preprocessor.tests.TestFunctionReturnsZ"2270 ]2271 },2272 {2273 "cells": [2274 "com.atddbdd.preprocessor.tests.TestFunctionReturnsAAA"2275 ]2276 },2277 {2278 "cells": [2279 "com.atddbdd.preprocessor.tests.TestFunctionReturnsWhatIsPassed"2280 ]2281 }2282 ],2283 "keyword": "When "2284});2285formatter.match({2286 "location": "StepDefinitions.add_local_function(NameInput\u003e)"2287});2288formatter.result({2289 "status": "passed"2290});2291formatter.scenario({2292 "name": "Process a function parameter in an expression",2293 "description": "",2294 "keyword": "Scenario"2295});2296formatter.step({2297 "name": "defines set up:",2298 "rows": [2299 {2300 "cells": [2301 "Define",2302 "Value"2303 ]2304 },2305 {2306 "cells": [2307 "Y",2308 "\u003d TestFunctionReturnsWhatIsPassed(11) + 3"2309 ]2310 }2311 ],2312 "keyword": "Given "2313});2314formatter.match({2315 "location": "StepDefinitions.defines_set_up(DefineValues\u003e)"2316});2317formatter.result({2318 "status": "passed"2319});2320formatter.step({2321 "name": "processing defines",2322 "keyword": "When "2323});2324formatter.match({2325 "location": "StepDefinitions.processing_defines()"2326});2327formatter.result({2328 "status": "passed"2329});2330formatter.step({2331 "name": "defines are:",2332 "rows": [2333 {2334 "cells": [2335 "Define",2336 "Value"2337 ]2338 },2339 {2340 "cells": [2341 "Y",2342 "14"2343 ]2344 }2345 ],2346 "keyword": "Then "2347});2348formatter.match({2349 "location": "StepDefinitions.defines_are(DefineValues\u003e)"2350});2351formatter.result({2352 "status": "passed"2353});2354formatter.after({2355 "status": "passed"2356});2357formatter.after({2358 "status": "passed"2359});2360formatter.after({2361 "status": "passed"2362});2363formatter.after({2364 "status": "passed"2365});2366formatter.after({2367 "status": "passed"2368});2369formatter.after({2370 "status": "passed"2371});2372formatter.after({2373 "status": "passed"2374});2375formatter.uri("features/csv.feature");2376formatter.feature({2377 "name": "CSV Files",2378 "description": "",2379 "keyword": "Feature"2380});2381formatter.scenario({2382 "name": "Parse a CSV file",2383 "description": "",2384 "keyword": "Scenario"2385});2386formatter.before({2387 "status": "passed"2388});2389formatter.before({2390 "status": "passed"2391});2392formatter.before({2393 "status": "passed"2394});2395formatter.before({2396 "status": "passed"2397});2398formatter.before({2399 "status": "passed"2400});2401formatter.before({2402 "status": "passed"2403});2404formatter.before({2405 "status": "passed"2406});2407formatter.step({2408 "name": "file SampleInclude.csv exists with:",2409 "keyword": "Given ",2410 "doc_string": {2411 "value": "a1,b1,c1\na2,b2,c2\n"2412 }2413});2414formatter.match({2415 "location": "StepDefinitions.file_exists_with(Pathname,String)"2416});2417formatter.result({2418 "status": "passed"2419});2420formatter.step({2421 "name": "parsing SampleInclude.csv as csv file",2422 "keyword": "When "2423});2424formatter.match({2425 "location": "StepDefinitionCSV.parsing_as_csv_file(String)"2426});2427formatter.result({2428 "status": "passed"2429});2430formatter.step({2431 "name": "parsed file is:",2432 "keyword": "Then ",2433 "doc_string": {2434 "value": "|a1|b1|c1|\n|a2|b2|c2|\n"2435 }2436});2437formatter.match({2438 "location": "StepDefinitionCSV.parsed_file_is(String)"2439});2440formatter.result({2441 "status": "passed"2442});2443formatter.after({2444 "status": "passed"2445});2446formatter.after({2447 "status": "passed"2448});2449formatter.after({2450 "status": "passed"2451});2452formatter.after({2453 "status": "passed"2454});2455formatter.after({2456 "status": "passed"2457});2458formatter.after({2459 "status": "passed"2460});2461formatter.after({2462 "status": "passed"2463});2464formatter.uri("features/define.feature");2465formatter.feature({2466 "name": "Defines in Preprocessor",2467 "description": "Notes:\nProcessing steps: \nI. Merge #include file contents with current file \nII. Recognize #defines, remove from source and make a map of them \nIII. If define replacement starts with \u003d, then\n\ta.) Replace defines within defines \n\tb.) call local functions if function () appears in replacement \n\tc.) call expression evaluator (mathematical expressions) \n\t\n\tIf defines or local functions not found, then expression remains the same \n\tIf expression cannot be evaluated, then expression remains the same ",2468 "keyword": "Feature"2469});2470formatter.scenario({2471 "name": "Intermediate Files in creating Defines",2472 "description": "",2473 "keyword": "Scenario",2474 "tags": [2475 {2476 "name": "@test"2477 }2478 ]2479});2480formatter.before({2481 "status": "passed"2482});2483formatter.before({2484 "status": "passed"2485});2486formatter.before({2487 "status": "passed"2488});2489formatter.before({2490 "status": "passed"2491});2492formatter.before({2493 "status": "passed"2494});2495formatter.before({2496 "status": "passed"2497});2498formatter.before({2499 "status": "passed"2500});2501formatter.step({2502 "name": "processing:",2503 "keyword": "When ",2504 "doc_string": {2505 "value": "First line\n#define X 12\nValue is X \nLast line"2506 }2507});2508formatter.match({2509 "location": "StepDefinitions.processing(String)"2510});2511formatter.result({2512 "status": "passed"2513});2514formatter.step({2515 "name": "defines are:",2516 "rows": [2517 {2518 "cells": [2519 "Define",2520 "Value"2521 ]2522 },2523 {2524 "cells": [2525 "X",2526 "12"2527 ]2528 }2529 ],2530 "keyword": "Then "2531});2532formatter.match({2533 "location": "StepDefinitions.defines_are(DefineValues\u003e)"2534});2535formatter.result({2536 "status": "passed"2537});2538formatter.after({2539 "status": "passed"2540});2541formatter.after({2542 "status": "passed"2543});2544formatter.after({2545 "status": "passed"2546});2547formatter.after({2548 "status": "passed"2549});2550formatter.after({2551 "status": "passed"2552});2553formatter.after({2554 "status": "passed"2555});2556formatter.after({2557 "status": "passed"2558});2559formatter.scenario({2560 "name": "No value for define results in empty string",2561 "description": "",2562 "keyword": "Scenario"2563});2564formatter.before({2565 "status": "passed"2566});2567formatter.before({2568 "status": "passed"2569});2570formatter.before({2571 "status": "passed"2572});2573formatter.before({2574 "status": "passed"2575});2576formatter.before({2577 "status": "passed"2578});2579formatter.before({2580 "status": "passed"2581});2582formatter.before({2583 "status": "passed"2584});2585formatter.step({2586 "name": "processing:",2587 "keyword": "When ",2588 "doc_string": {2589 "value": "First line\n#define X \nValue is X \nLast line"2590 }2591});2592formatter.match({2593 "location": "StepDefinitions.processing(String)"2594});2595formatter.result({2596 "status": "passed"2597});2598formatter.step({2599 "name": "defines are:",2600 "rows": [2601 {2602 "cells": [2603 "Define",2604 "Value"2605 ]2606 },2607 {2608 "cells": [2609 "X",2610 ""2611 ]2612 }2613 ],2614 "keyword": "Then "2615});2616formatter.match({2617 "location": "StepDefinitions.defines_are(DefineValues\u003e)"2618});2619formatter.result({2620 "status": "passed"2621});2622formatter.after({2623 "status": "passed"2624});2625formatter.after({2626 "status": "passed"2627});2628formatter.after({2629 "status": "passed"2630});2631formatter.after({2632 "status": "passed"2633});2634formatter.after({2635 "status": "passed"2636});2637formatter.after({2638 "status": "passed"2639});2640formatter.after({2641 "status": "passed"2642});2643formatter.scenario({2644 "name": "Allowable Defines Names",2645 "description": "",2646 "keyword": "Scenario"2647});2648formatter.before({2649 "status": "passed"2650});2651formatter.before({2652 "status": "passed"2653});2654formatter.before({2655 "status": "passed"2656});2657formatter.before({2658 "status": "passed"2659});2660formatter.before({2661 "status": "passed"2662});2663formatter.before({2664 "status": "passed"2665});2666formatter.before({2667 "status": "passed"2668});2669formatter.step({2670 "name": "processing:",2671 "keyword": "When ",2672 "doc_string": {2673 "value": "First line\n#define X 12\n#define X___123Z 13 \n#define X.Y 14 \n#define X\u0026@#$ 18 "2674 }2675});2676formatter.match({2677 "location": "StepDefinitions.processing(String)"2678});2679formatter.result({2680 "status": "passed"2681});2682formatter.step({2683 "name": "defines are:",2684 "rows": [2685 {2686 "cells": [2687 "Define",2688 "Value"2689 ]2690 },2691 {2692 "cells": [2693 "X",2694 "12"2695 ]2696 },2697 {2698 "cells": [2699 "X___123Z",2700 "13"2701 ]2702 },2703 {2704 "cells": [2705 "X.Y",2706 "14"2707 ]2708 }2709 ],2710 "keyword": "Then "2711});2712formatter.match({2713 "location": "StepDefinitions.defines_are(DefineValues\u003e)"2714});2715formatter.result({2716 "status": "passed"2717});2718formatter.after({2719 "status": "passed"2720});2721formatter.after({2722 "status": "passed"2723});2724formatter.after({2725 "status": "passed"2726});2727formatter.after({2728 "status": "passed"2729});2730formatter.after({2731 "status": "passed"2732});2733formatter.after({2734 "status": "passed"2735});2736formatter.after({2737 "status": "passed"2738});2739formatter.scenario({2740 "name": "One Define is replaced in file",2741 "description": "",2742 "keyword": "Scenario"2743});2744formatter.before({2745 "status": "passed"2746});2747formatter.before({2748 "status": "passed"2749});2750formatter.before({2751 "status": "passed"2752});2753formatter.before({2754 "status": "passed"2755});2756formatter.before({2757 "status": "passed"2758});2759formatter.before({2760 "status": "passed"2761});2762formatter.before({2763 "status": "passed"2764});2765formatter.step({2766 "name": "processing:",2767 "keyword": "When ",2768 "doc_string": {2769 "value": "First line\n#define X 12\nValue is X \nLast line"2770 }2771});2772formatter.match({2773 "location": "StepDefinitions.processing(String)"2774});2775formatter.result({2776 "status": "passed"2777});2778formatter.step({2779 "name": "result is:",2780 "keyword": "Then ",2781 "doc_string": {2782 "value": "First line\nValue is 12 \nLast line"2783 }2784});2785formatter.match({2786 "location": "StepDefinitions.result_is(String)"2787});2788formatter.result({2789 "status": "passed"2790});2791formatter.after({2792 "status": "passed"2793});2794formatter.after({2795 "status": "passed"2796});2797formatter.after({2798 "status": "passed"2799});2800formatter.after({2801 "status": "passed"2802});2803formatter.after({2804 "status": "passed"2805});2806formatter.after({2807 "status": "passed"2808});2809formatter.after({2810 "status": "passed"2811});2812formatter.scenario({2813 "name": "Defines are replaced at beginning and end of lines",2814 "description": "",2815 "keyword": "Scenario"2816});2817formatter.before({2818 "status": "passed"2819});2820formatter.before({2821 "status": "passed"2822});2823formatter.before({2824 "status": "passed"2825});2826formatter.before({2827 "status": "passed"2828});2829formatter.before({2830 "status": "passed"2831});2832formatter.before({2833 "status": "passed"2834});2835formatter.before({2836 "status": "passed"2837});2838formatter.step({2839 "name": "processing:",2840 "keyword": "When ",2841 "doc_string": {2842 "value": "X at beginning\n#define X 12\nat end X"2843 }2844});2845formatter.match({2846 "location": "StepDefinitions.processing(String)"2847});2848formatter.result({2849 "status": "passed"2850});2851formatter.step({2852 "name": "result is:",2853 "keyword": "Then ",2854 "doc_string": {2855 "value": "12 at beginning\nat end 12"2856 }2857});2858formatter.match({2859 "location": "StepDefinitions.result_is(String)"2860});2861formatter.result({2862 "status": "passed"2863});2864formatter.after({2865 "status": "passed"2866});2867formatter.after({2868 "status": "passed"2869});2870formatter.after({2871 "status": "passed"2872});2873formatter.after({2874 "status": "passed"2875});2876formatter.after({2877 "status": "passed"2878});2879formatter.after({2880 "status": "passed"2881});2882formatter.after({2883 "status": "passed"2884});2885formatter.scenario({2886 "name": "Replace Defines Using Intermediate Setup Defines",2887 "description": "",2888 "keyword": "Scenario"2889});2890formatter.before({2891 "status": "passed"2892});2893formatter.before({2894 "status": "passed"2895});2896formatter.before({2897 "status": "passed"2898});2899formatter.before({2900 "status": "passed"2901});2902formatter.before({2903 "status": "passed"2904});2905formatter.before({2906 "status": "passed"2907});2908formatter.before({2909 "status": "passed"2910});2911formatter.step({2912 "name": "defines set up:",2913 "rows": [2914 {2915 "cells": [2916 "Define",2917 "Value"2918 ]2919 },2920 {2921 "cells": [2922 "X",2923 "12"2924 ]2925 }2926 ],2927 "keyword": "Given "2928});2929formatter.match({2930 "location": "StepDefinitions.defines_set_up(DefineValues\u003e)"2931});2932formatter.result({2933 "status": "passed"2934});2935formatter.step({2936 "name": "string is replaced",2937 "keyword": "When ",2938 "doc_string": {2939 "value": "X is X is X"2940 }2941});2942formatter.match({2943 "location": "StepDefinitions.string_is_replaced(String)"2944});2945formatter.result({2946 "status": "passed"2947});2948formatter.step({2949 "name": "output string is",2950 "keyword": "Then ",2951 "doc_string": {2952 "value": "12 is 12 is 12"2953 }2954});2955formatter.match({2956 "location": "StepDefinitions.output_string_is(String)"2957});2958formatter.result({2959 "status": "passed"2960});2961formatter.after({2962 "status": "passed"2963});2964formatter.after({2965 "status": "passed"2966});2967formatter.after({2968 "status": "passed"2969});2970formatter.after({2971 "status": "passed"2972});2973formatter.after({2974 "status": "passed"2975});2976formatter.after({2977 "status": "passed"2978});2979formatter.after({2980 "status": "passed"2981});2982formatter.scenario({2983 "name": "Check that intermediate files match the setup files",2984 "description": "",2985 "keyword": "Scenario"2986});2987formatter.before({2988 "status": "passed"2989});2990formatter.before({2991 "status": "passed"2992});2993formatter.before({2994 "status": "passed"2995});2996formatter.before({2997 "status": "passed"2998});2999formatter.before({3000 "status": "passed"3001});3002formatter.before({3003 "status": "passed"3004});3005formatter.before({3006 "status": "passed"3007});3008formatter.step({3009 "name": "defines set up:",3010 "rows": [3011 {3012 "cells": [3013 "Define",3014 "Value"3015 ]3016 },3017 {3018 "cells": [3019 "X",3020 "12"3021 ]3022 },3023 {3024 "cells": [3025 "Y",3026 "15"3027 ]3028 }3029 ],3030 "keyword": "Given "3031});3032formatter.match({3033 "location": "StepDefinitions.defines_set_up(DefineValues\u003e)"3034});3035formatter.result({3036 "status": "passed"3037});3038formatter.step({3039 "name": "processing defines",3040 "keyword": "When "3041});3042formatter.match({3043 "location": "StepDefinitions.processing_defines()"3044});3045formatter.result({3046 "status": "passed"3047});3048formatter.step({3049 "name": "defines are:",3050 "rows": [3051 {3052 "cells": [3053 "Define",3054 "Value"3055 ]3056 },3057 {3058 "cells": [3059 "X",3060 "12"3061 ]3062 },3063 {3064 "cells": [3065 "Y",3066 "15"3067 ]3068 }3069 ],3070 "keyword": "Then "3071});3072formatter.match({3073 "location": "StepDefinitions.defines_are(DefineValues\u003e)"3074});3075formatter.result({3076 "status": "passed"3077});3078formatter.after({3079 "status": "passed"3080});3081formatter.after({3082 "status": "passed"3083});3084formatter.after({3085 "status": "passed"3086});3087formatter.after({3088 "status": "passed"3089});3090formatter.after({3091 "status": "passed"3092});3093formatter.after({3094 "status": "passed"3095});3096formatter.after({3097 "status": "passed"3098});3099formatter.scenario({3100 "name": "Replace Defines with Two Setup Defines",3101 "description": "",3102 "keyword": "Scenario"3103});3104formatter.before({3105 "status": "passed"3106});3107formatter.before({3108 "status": "passed"3109});3110formatter.before({3111 "status": "passed"3112});3113formatter.before({3114 "status": "passed"3115});3116formatter.before({3117 "status": "passed"3118});3119formatter.before({3120 "status": "passed"3121});3122formatter.before({3123 "status": "passed"3124});3125formatter.step({3126 "name": "defines set up:",3127 "rows": [3128 {3129 "cells": [3130 "Define",3131 "Value"3132 ]3133 },3134 {3135 "cells": [3136 "X",3137 "12"3138 ]3139 },3140 {3141 "cells": [3142 "Y",3143 "21"3144 ]3145 }3146 ],3147 "keyword": "Given "3148});3149formatter.match({3150 "location": "StepDefinitions.defines_set_up(DefineValues\u003e)"3151});3152formatter.result({3153 "status": "passed"3154});3155formatter.step({3156 "name": "string is replaced",3157 "keyword": "When ",3158 "doc_string": {3159 "value": "X is Y is X"3160 }3161});3162formatter.match({3163 "location": "StepDefinitions.string_is_replaced(String)"3164});3165formatter.result({3166 "status": "passed"3167});3168formatter.step({3169 "name": "output string is",3170 "keyword": "Then ",3171 "doc_string": {3172 "value": "12 is 21 is 12"3173 }3174});3175formatter.match({3176 "location": "StepDefinitions.output_string_is(String)"3177});3178formatter.result({3179 "status": "passed"3180});3181formatter.after({3182 "status": "passed"3183});3184formatter.after({3185 "status": "passed"3186});3187formatter.after({3188 "status": "passed"3189});3190formatter.after({3191 "status": "passed"3192});3193formatter.after({3194 "status": "passed"3195});3196formatter.after({3197 "status": "passed"3198});3199formatter.after({3200 "status": "passed"3201});3202formatter.scenario({3203 "name": "Replacement with two defines in file",3204 "description": "",3205 "keyword": "Scenario"3206});3207formatter.before({3208 "status": "passed"3209});3210formatter.before({3211 "status": "passed"3212});3213formatter.before({3214 "status": "passed"3215});3216formatter.before({3217 "status": "passed"3218});3219formatter.before({3220 "status": "passed"3221});3222formatter.before({3223 "status": "passed"3224});3225formatter.before({3226 "status": "passed"3227});3228formatter.step({3229 "name": "processing:",3230 "keyword": "When ",3231 "doc_string": {3232 "value": "First line\n#define X 12\n#define Y 14\nValue is X \nY is another value\nLast line"3233 }3234});3235formatter.match({3236 "location": "StepDefinitions.processing(String)"3237});3238formatter.result({3239 "status": "passed"3240});3241formatter.step({3242 "name": "result is:",3243 "keyword": "Then ",3244 "doc_string": {3245 "value": "First line\nValue is 12 \n14 is another value\nLast line"3246 }3247});3248formatter.match({3249 "location": "StepDefinitions.result_is(String)"3250});3251formatter.result({3252 "status": "passed"3253});3254formatter.after({3255 "status": "passed"3256});3257formatter.after({3258 "status": "passed"3259});3260formatter.after({3261 "status": "passed"3262});3263formatter.after({3264 "status": "passed"3265});3266formatter.after({3267 "status": "passed"3268});3269formatter.after({3270 "status": "passed"3271});3272formatter.after({3273 "status": "passed"3274});3275formatter.scenario({3276 "name": "Redefine in file uses last value as default configuration",3277 "description": "",3278 "keyword": "Scenario"3279});3280formatter.before({3281 "status": "passed"3282});3283formatter.before({3284 "status": "passed"3285});3286formatter.before({3287 "status": "passed"3288});3289formatter.before({3290 "status": "passed"3291});3292formatter.before({3293 "status": "passed"3294});3295formatter.before({3296 "status": "passed"3297});3298formatter.before({3299 "status": "passed"3300});3301formatter.step({3302 "name": "processing:",3303 "keyword": "When ",3304 "doc_string": {3305 "value": "First line\n#define X 12\n#define X 14\nValue is X \nLast line"3306 }3307});3308formatter.match({3309 "location": "StepDefinitions.processing(String)"3310});3311formatter.result({3312 "status": "passed"3313});3314formatter.step({3315 "name": "result is:",3316 "keyword": "Then ",3317 "doc_string": {3318 "value": "First line\nValue is 14 \nLast line"3319 }3320});3321formatter.match({3322 "location": "StepDefinitions.result_is(String)"3323});3324formatter.result({3325 "status": "passed"3326});3327formatter.after({3328 "status": "passed"3329});3330formatter.after({3331 "status": "passed"3332});3333formatter.after({3334 "status": "passed"3335});3336formatter.after({3337 "status": "passed"3338});3339formatter.after({3340 "status": "passed"3341});3342formatter.after({3343 "status": "passed"3344});3345formatter.after({3346 "status": "passed"3347});3348formatter.scenario({3349 "name": "Process one expression",3350 "description": "",3351 "keyword": "Scenario"3352});3353formatter.before({3354 "status": "passed"3355});3356formatter.before({3357 "status": "passed"3358});3359formatter.before({3360 "status": "passed"3361});3362formatter.before({3363 "status": "passed"3364});3365formatter.before({3366 "status": "passed"3367});3368formatter.before({3369 "status": "passed"3370});3371formatter.before({3372 "status": "passed"3373});3374formatter.step({3375 "name": "processing:",3376 "keyword": "When ",3377 "doc_string": {3378 "value": "First line\n#define X \u003d 12 + 3\nValue is X end\nLast line"3379 }3380});3381formatter.match({3382 "location": "StepDefinitions.processing(String)"3383});3384formatter.result({3385 "status": "passed"3386});3387formatter.step({3388 "name": "result is:",3389 "keyword": "Then ",3390 "doc_string": {3391 "value": "First line\nValue is 15 end\nLast line"3392 }3393});3394formatter.match({3395 "location": "StepDefinitions.result_is(String)"3396});3397formatter.result({3398 "status": "passed"3399});3400formatter.after({3401 "status": "passed"3402});3403formatter.after({3404 "status": "passed"3405});3406formatter.after({3407 "status": "passed"3408});3409formatter.after({3410 "status": "passed"3411});3412formatter.after({3413 "status": "passed"3414});3415formatter.after({3416 "status": "passed"3417});3418formatter.after({3419 "status": "passed"3420});3421formatter.scenario({3422 "name": "Process define using another define in expression",3423 "description": "",3424 "keyword": "Scenario"3425});3426formatter.before({3427 "status": "passed"3428});3429formatter.before({3430 "status": "passed"3431});3432formatter.before({3433 "status": "passed"3434});3435formatter.before({3436 "status": "passed"3437});3438formatter.before({3439 "status": "passed"3440});3441formatter.before({3442 "status": "passed"3443});3444formatter.before({3445 "status": "passed"3446});3447formatter.step({3448 "name": "defines set up:",3449 "rows": [3450 {3451 "cells": [3452 "Define",3453 "Value"3454 ]3455 },3456 {3457 "cells": [3458 "X",3459 "12"3460 ]3461 },3462 {3463 "cells": [3464 "Y",3465 "\u003d X"3466 ]3467 }3468 ],3469 "keyword": "Given "3470});3471formatter.match({3472 "location": "StepDefinitions.defines_set_up(DefineValues\u003e)"3473});3474formatter.result({3475 "status": "passed"3476});3477formatter.step({3478 "name": "processing defines",3479 "keyword": "When "3480});3481formatter.match({3482 "location": "StepDefinitions.processing_defines()"3483});3484formatter.result({3485 "status": "passed"3486});3487formatter.step({3488 "name": "defines are:",3489 "rows": [3490 {3491 "cells": [3492 "Define",3493 "Value"3494 ]3495 },3496 {3497 "cells": [3498 "X",3499 "12"3500 ]3501 },3502 {3503 "cells": [3504 "Y",3505 "12"3506 ]3507 }3508 ],3509 "keyword": "Then "3510});3511formatter.match({3512 "location": "StepDefinitions.defines_are(DefineValues\u003e)"3513});3514formatter.result({3515 "status": "passed"3516});3517formatter.after({3518 "status": "passed"3519});3520formatter.after({3521 "status": "passed"3522});3523formatter.after({3524 "status": "passed"3525});3526formatter.after({3527 "status": "passed"3528});3529formatter.after({3530 "status": "passed"3531});3532formatter.after({3533 "status": "passed"3534});3535formatter.after({3536 "status": "passed"3537});3538formatter.scenario({3539 "name": "Process Define with Redefine Not Allowed",3540 "description": "",3541 "keyword": "Scenario"3542});3543formatter.before({3544 "status": "passed"3545});3546formatter.before({3547 "status": "passed"3548});3549formatter.before({3550 "status": "passed"3551});3552formatter.before({3553 "status": "passed"3554});3555formatter.before({3556 "status": "passed"3557});3558formatter.before({3559 "status": "passed"3560});3561formatter.before({3562 "status": "passed"3563});3564formatter.step({3565 "name": "redefine is false",3566 "keyword": "Given "3567});3568formatter.match({3569 "location": "StepDefinitions.redefine_is(boolean)"3570});3571formatter.result({3572 "status": "passed"3573});3574formatter.step({3575 "name": "defines set up:",3576 "rows": [3577 {3578 "cells": [3579 "Define",3580 "Value"3581 ]3582 },3583 {3584 "cells": [3585 "X",3586 "12"3587 ]3588 },3589 {3590 "cells": [3591 "X",3592 "14"3593 ]3594 }3595 ],3596 "keyword": "Given "3597});3598formatter.match({3599 "location": "StepDefinitions.defines_set_up(DefineValues\u003e)"3600});3601formatter.result({3602 "status": "passed"3603});3604formatter.step({3605 "name": "processing defines",3606 "keyword": "When "3607});3608formatter.match({3609 "location": "StepDefinitions.processing_defines()"3610});3611formatter.result({3612 "status": "passed"3613});3614formatter.step({3615 "name": "defines are:",3616 "rows": [3617 {3618 "cells": [3619 "Define",3620 "Value"3621 ]3622 },3623 {3624 "cells": [3625 "X",3626 "12"3627 ]3628 }3629 ],3630 "keyword": "Then "3631});3632formatter.match({3633 "location": "StepDefinitions.defines_are(DefineValues\u003e)"3634});3635formatter.result({3636 "status": "passed"3637});3638formatter.step({3639 "name": "error reported as DUPLICATE_DEFINE",3640 "keyword": "Then "3641});3642formatter.match({3643 "location": "StepDefinitionsLogging.error_reported_as(String)"3644});3645formatter.result({3646 "status": "passed"3647});3648formatter.after({3649 "status": "passed"3650});3651formatter.after({3652 "status": "passed"3653});3654formatter.after({3655 "status": "passed"3656});3657formatter.after({3658 "status": "passed"3659});3660formatter.after({3661 "status": "passed"3662});3663formatter.after({3664 "status": "passed"3665});3666formatter.after({3667 "status": "passed"3668});3669formatter.scenario({3670 "name": "Process Define with Redefine Allowed",3671 "description": "",3672 "keyword": "Scenario"3673});3674formatter.before({3675 "status": "passed"3676});3677formatter.before({3678 "status": "passed"3679});3680formatter.before({3681 "status": "passed"3682});3683formatter.before({3684 "status": "passed"3685});3686formatter.before({3687 "status": "passed"3688});3689formatter.before({3690 "status": "passed"3691});3692formatter.before({3693 "status": "passed"3694});3695formatter.step({3696 "name": "redefine is true",3697 "keyword": "Given "3698});3699formatter.match({3700 "location": "StepDefinitions.redefine_is(boolean)"3701});3702formatter.result({3703 "status": "passed"3704});3705formatter.step({3706 "name": "defines set up:",3707 "rows": [3708 {3709 "cells": [3710 "Define",3711 "Value"3712 ]3713 },3714 {3715 "cells": [3716 "X",3717 "12"3718 ]3719 },3720 {3721 "cells": [3722 "X",3723 "14"3724 ]3725 }3726 ],3727 "keyword": "Given "3728});3729formatter.match({3730 "location": "StepDefinitions.defines_set_up(DefineValues\u003e)"3731});3732formatter.result({3733 "status": "passed"3734});3735formatter.step({3736 "name": "processing defines",3737 "keyword": "When "3738});3739formatter.match({3740 "location": "StepDefinitions.processing_defines()"3741});3742formatter.result({3743 "status": "passed"3744});3745formatter.step({3746 "name": "defines are:",3747 "rows": [3748 {3749 "cells": [3750 "Define",3751 "Value"3752 ]3753 },3754 {3755 "cells": [3756 "X",3757 "14"3758 ]3759 }3760 ],3761 "keyword": "Then "3762});3763formatter.match({3764 "location": "StepDefinitions.defines_are(DefineValues\u003e)"3765});3766formatter.result({3767 "status": "passed"3768});3769formatter.after({3770 "status": "passed"3771});3772formatter.after({3773 "status": "passed"3774});3775formatter.after({3776 "status": "passed"3777});3778formatter.after({3779 "status": "passed"3780});3781formatter.after({3782 "status": "passed"3783});3784formatter.after({3785 "status": "passed"3786});3787formatter.after({3788 "status": "passed"3789});3790formatter.scenario({3791 "name": "Process Define with Forward Defines and show define not replaced",3792 "description": "",3793 "keyword": "Scenario"3794});3795formatter.before({3796 "status": "passed"3797});3798formatter.before({3799 "status": "passed"3800});3801formatter.before({3802 "status": "passed"3803});3804formatter.before({3805 "status": "passed"3806});3807formatter.before({3808 "status": "passed"3809});3810formatter.before({3811 "status": "passed"3812});3813formatter.before({3814 "status": "passed"3815});3816formatter.step({3817 "name": "defines set up:",3818 "rows": [3819 {3820 "cells": [3821 "Define",3822 "Value"3823 ]3824 },3825 {3826 "cells": [3827 "X",3828 "\u003d Y"3829 ]3830 },3831 {3832 "cells": [3833 "Y",3834 "14"3835 ]3836 }3837 ],3838 "keyword": "Given "3839});3840formatter.match({3841 "location": "StepDefinitions.defines_set_up(DefineValues\u003e)"3842});3843formatter.result({3844 "status": "passed"3845});3846formatter.step({3847 "name": "processing defines",3848 "keyword": "When "3849});3850formatter.match({3851 "location": "StepDefinitions.processing_defines()"3852});3853formatter.result({3854 "status": "passed"3855});3856formatter.step({3857 "name": "defines are:",3858 "rows": [3859 {3860 "cells": [3861 "Define",3862 "Value"3863 ]3864 },3865 {3866 "cells": [3867 "X",3868 "Y"3869 ]3870 },3871 {3872 "cells": [3873 "Y",3874 "14"3875 ]3876 }3877 ],3878 "keyword": "Then "3879});3880formatter.match({3881 "location": "StepDefinitions.defines_are(DefineValues\u003e)"3882});3883formatter.result({3884 "status": "passed"3885});3886formatter.after({3887 "status": "passed"3888});3889formatter.after({3890 "status": "passed"3891});3892formatter.after({3893 "status": "passed"3894});3895formatter.after({3896 "status": "passed"3897});3898formatter.after({3899 "status": "passed"3900});3901formatter.after({3902 "status": "passed"3903});3904formatter.after({3905 "status": "passed"3906});3907formatter.scenario({3908 "name": "Process define using itself as value",3909 "description": "",3910 "keyword": "Scenario"3911});3912formatter.before({3913 "status": "passed"3914});3915formatter.before({3916 "status": "passed"3917});3918formatter.before({3919 "status": "passed"3920});3921formatter.before({3922 "status": "passed"3923});3924formatter.before({3925 "status": "passed"3926});3927formatter.before({3928 "status": "passed"3929});3930formatter.before({3931 "status": "passed"3932});3933formatter.step({3934 "name": "defines set up:",3935 "rows": [3936 {3937 "cells": [3938 "Define",3939 "Value"3940 ]3941 },3942 {3943 "cells": [3944 "Y",3945 "\u003d Y"3946 ]3947 }3948 ],3949 "keyword": "Given "3950});3951formatter.match({3952 "location": "StepDefinitions.defines_set_up(DefineValues\u003e)"3953});3954formatter.result({3955 "status": "passed"3956});3957formatter.step({3958 "name": "processing defines",3959 "keyword": "When "3960});3961formatter.match({3962 "location": "StepDefinitions.processing_defines()"3963});3964formatter.result({3965 "status": "passed"3966});3967formatter.step({3968 "name": "defines are:",3969 "rows": [3970 {3971 "cells": [3972 "Define",3973 "Value"3974 ]3975 },3976 {3977 "cells": [3978 "Y",3979 "Y"3980 ]3981 }3982 ],3983 "keyword": "Then "3984});3985formatter.match({3986 "location": "StepDefinitions.defines_are(DefineValues\u003e)"3987});3988formatter.result({3989 "status": "passed"3990});3991formatter.step({3992 "name": "error reported as DEFINE_USED_IN_DEFINE",3993 "keyword": "Then "3994});3995formatter.match({3996 "location": "StepDefinitionsLogging.error_reported_as(String)"3997});3998formatter.result({3999 "status": "passed"4000});4001formatter.after({4002 "status": "passed"4003});4004formatter.after({4005 "status": "passed"4006});4007formatter.after({4008 "status": "passed"4009});4010formatter.after({4011 "status": "passed"4012});4013formatter.after({4014 "status": "passed"4015});4016formatter.after({4017 "status": "passed"4018});4019formatter.after({4020 "status": "passed"4021});4022formatter.uri("features/definegroup.feature");4023formatter.feature({4024 "name": "Multi Defines in Preprocessor",4025 "description": "",4026 "keyword": "Feature"4027});4028formatter.scenario({4029 "name": "Intermediate Files in creating Defines",4030 "description": "",4031 "keyword": "Scenario",4032 "tags": [4033 {4034 "name": "@test"4035 }4036 ]4037});4038formatter.before({4039 "status": "passed"4040});4041formatter.before({4042 "status": "passed"4043});4044formatter.before({4045 "status": "passed"4046});4047formatter.before({4048 "status": "passed"4049});4050formatter.before({4051 "status": "passed"4052});4053formatter.before({4054 "status": "passed"4055});4056formatter.before({4057 "status": "passed"4058});4059formatter.step({4060 "name": "processing:",4061 "keyword": "When ",4062 "doc_string": {4063 "value": "First line\n#define\n|X|12|\n|Y|10| \nValue is X \nLast line"4064 }4065});4066formatter.match({4067 "location": "StepDefinitions.processing(String)"4068});4069formatter.result({4070 "status": "passed"4071});4072formatter.step({4073 "name": "defines are:",4074 "rows": [4075 {4076 "cells": [4077 "Define",4078 "Value"4079 ]4080 },4081 {4082 "cells": [4083 "X",4084 "12"4085 ]4086 },4087 {4088 "cells": [4089 "Y",4090 "10"4091 ]4092 }4093 ],4094 "keyword": "Then "4095});4096formatter.match({4097 "location": "StepDefinitions.defines_are(DefineValues\u003e)"4098});4099formatter.result({4100 "status": "passed"4101});4102formatter.after({4103 "status": "passed"4104});4105formatter.after({4106 "status": "passed"4107});4108formatter.after({4109 "status": "passed"4110});4111formatter.after({4112 "status": "passed"4113});4114formatter.after({4115 "status": "passed"4116});4117formatter.after({4118 "status": "passed"4119});4120formatter.after({4121 "status": "passed"4122});4123formatter.scenario({4124 "name": "No value for define results in empty string",4125 "description": "",4126 "keyword": "Scenario",4127 "tags": [4128 {4129 "name": "@test"4130 }4131 ]4132});4133formatter.before({4134 "status": "passed"4135});4136formatter.before({4137 "status": "passed"4138});4139formatter.before({4140 "status": "passed"4141});4142formatter.before({4143 "status": "passed"4144});4145formatter.before({4146 "status": "passed"4147});4148formatter.before({4149 "status": "passed"4150});4151formatter.before({4152 "status": "passed"4153});4154formatter.step({4155 "name": "processing:",4156 "keyword": "When ",4157 "doc_string": {4158 "value": "First line\n#define\n|X||\nValue is X \nLast line"4159 }4160});4161formatter.match({4162 "location": "StepDefinitions.processing(String)"4163});4164formatter.result({4165 "status": "passed"4166});4167formatter.step({4168 "name": "defines are:",4169 "rows": [4170 {4171 "cells": [4172 "Define",4173 "Value"4174 ]4175 },4176 {4177 "cells": [4178 "X",4179 ""4180 ]4181 }4182 ],4183 "keyword": "Then "4184});4185formatter.match({4186 "location": "StepDefinitions.defines_are(DefineValues\u003e)"4187});4188formatter.result({4189 "status": "passed"4190});4191formatter.after({4192 "status": "passed"4193});4194formatter.after({4195 "status": "passed"4196});4197formatter.after({4198 "status": "passed"4199});4200formatter.after({4201 "status": "passed"4202});4203formatter.after({4204 "status": "passed"4205});4206formatter.after({4207 "status": "passed"4208});4209formatter.after({4210 "status": "passed"4211});4212formatter.scenario({4213 "name": "Two defines are replaced in file",4214 "description": "",4215 "keyword": "Scenario",4216 "tags": [4217 {4218 "name": "@test"4219 }4220 ]4221});4222formatter.before({4223 "status": "passed"4224});4225formatter.before({4226 "status": "passed"4227});4228formatter.before({4229 "status": "passed"4230});4231formatter.before({4232 "status": "passed"4233});4234formatter.before({4235 "status": "passed"4236});4237formatter.before({4238 "status": "passed"4239});4240formatter.before({4241 "status": "passed"4242});4243formatter.step({4244 "name": "processing:",4245 "keyword": "When ",4246 "doc_string": {4247 "value": "First line\n#define\n|X|12|\n|Y|10| \nValue is X\nValue is Y\nLast line"4248 }4249});4250formatter.match({4251 "location": "StepDefinitions.processing(String)"4252});4253formatter.result({4254 "status": "passed"4255});4256formatter.step({4257 "name": "result is:",4258 "keyword": "Then ",4259 "doc_string": {4260 "value": "First line\nValue is 12\nValue is 10\nLast line"4261 }4262});4263formatter.match({4264 "location": "StepDefinitions.result_is(String)"4265});4266formatter.result({4267 "status": "passed"4268});4269formatter.after({4270 "status": "passed"4271});4272formatter.after({4273 "status": "passed"4274});4275formatter.after({4276 "status": "passed"4277});4278formatter.after({4279 "status": "passed"4280});4281formatter.after({4282 "status": "passed"4283});4284formatter.after({4285 "status": "passed"4286});4287formatter.after({4288 "status": "passed"4289});4290formatter.uri("features/expression.feature");4291formatter.feature({4292 "name": "Expressions in Preprocessor",4293 "description": "",4294 "keyword": "Feature"4295});4296formatter.scenario({4297 "name": "Calculate Expression",4298 "description": "",4299 "keyword": "Scenario"4300});4301formatter.before({4302 "status": "passed"4303});4304formatter.before({4305 "status": "passed"4306});4307formatter.before({4308 "status": "passed"4309});4310formatter.before({4311 "status": "passed"4312});4313formatter.before({4314 "status": "passed"4315});4316formatter.before({4317 "status": "passed"4318});4319formatter.before({4320 "status": "passed"4321});4322formatter.step({4323 "name": "expression \"1 + 2\"",4324 "keyword": "Given "4325});4326formatter.match({4327 "location": "StepDefintionsExpressionCalculator.expression(String)"4328});4329formatter.result({4330 "status": "passed"4331});4332formatter.step({4333 "name": "evaluated",4334 "keyword": "When "4335});4336formatter.match({4337 "location": "StepDefintionsExpressionCalculator.evaluated()"4338});4339formatter.result({4340 "status": "passed"4341});4342formatter.step({4343 "name": "result is \"3\"",4344 "keyword": "Then "4345});4346formatter.match({4347 "location": "StepDefintionsExpressionCalculator.result_is(String)"4348});4349formatter.result({4350 "status": "passed"4351});4352formatter.step({4353 "name": "expression \"1.1 + 2.3\"",4354 "keyword": "Given "4355});4356formatter.match({4357 "location": "StepDefintionsExpressionCalculator.expression(String)"4358});4359formatter.result({4360 "status": "passed"4361});4362formatter.step({4363 "name": "evaluated",4364 "keyword": "When "4365});4366formatter.match({4367 "location": "StepDefintionsExpressionCalculator.evaluated()"4368});4369formatter.result({4370 "status": "passed"4371});4372formatter.step({4373 "name": "result is \"3.4\"",4374 "keyword": "Then "4375});4376formatter.match({4377 "location": "StepDefintionsExpressionCalculator.result_is(String)"4378});4379formatter.result({4380 "status": "passed"4381});4382formatter.after({4383 "status": "passed"4384});4385formatter.after({4386 "status": "passed"4387});4388formatter.after({4389 "status": "passed"4390});4391formatter.after({4392 "status": "passed"4393});4394formatter.after({4395 "status": "passed"4396});4397formatter.after({4398 "status": "passed"4399});4400formatter.after({4401 "status": "passed"4402});4403formatter.scenario({4404 "name": "Expression in defines",4405 "description": "",4406 "keyword": "Scenario"4407});4408formatter.before({4409 "status": "passed"4410});4411formatter.before({4412 "status": "passed"4413});4414formatter.before({4415 "status": "passed"4416});4417formatter.before({4418 "status": "passed"4419});4420formatter.before({4421 "status": "passed"4422});4423formatter.before({4424 "status": "passed"4425});4426formatter.before({4427 "status": "passed"4428});4429formatter.step({4430 "name": "processing:",4431 "keyword": "When ",4432 "doc_string": {4433 "value": "#define X 1\n#define Y \u003d X + 3\nFeature: Test Feature\nScenario: One\nGiven value is X\nWhen processed\nThen result is Y"4434 }4435});4436formatter.match({4437 "location": "StepDefinitions.processing(String)"4438});4439formatter.result({4440 "status": "passed"4441});4442formatter.step({4443 "name": "result is:",4444 "keyword": "Then ",4445 "doc_string": {4446 "value": "Feature: Test Feature\nScenario: One\nGiven value is 1\nWhen processed\nThen result is 4"4447 }4448});4449formatter.match({4450 "location": "StepDefinitions.result_is(String)"4451});4452formatter.result({4453 "status": "passed"4454});4455formatter.after({4456 "status": "passed"4457});4458formatter.after({4459 "status": "passed"4460});4461formatter.after({4462 "status": "passed"4463});4464formatter.after({4465 "status": "passed"4466});4467formatter.after({4468 "status": "passed"4469});4470formatter.after({4471 "status": "passed"4472});4473formatter.after({4474 "status": "passed"4475});4476formatter.scenario({4477 "name": "Bad Expression in defines",4478 "description": "",4479 "keyword": "Scenario"4480});4481formatter.before({4482 "status": "passed"4483});4484formatter.before({4485 "status": "passed"4486});4487formatter.before({4488 "status": "passed"4489});4490formatter.before({4491 "status": "passed"4492});4493formatter.before({4494 "status": "passed"4495});4496formatter.before({4497 "status": "passed"4498});4499formatter.before({4500 "status": "passed"4501});4502formatter.step({4503 "name": "processing:",4504 "keyword": "When ",4505 "doc_string": {4506 "value": "#define X 1\n#define Y \u003d X \u0026* 3\nFeature: Test Feature\nScenario: One\nGiven value is X\nWhen processed\nThen result is Y"4507 }4508});4509formatter.match({4510 "location": "StepDefinitions.processing(String)"4511});4512formatter.result({4513 "status": "passed"4514});4515formatter.step({4516 "name": "result is:",4517 "keyword": "Then ",4518 "doc_string": {4519 "value": "Feature: Test Feature\nScenario: One\nGiven value is 1\nWhen processed\nThen result is 1 \u0026* 3"4520 }4521});4522formatter.match({4523 "location": "StepDefinitions.result_is(String)"4524});4525formatter.result({4526 "status": "passed"4527});4528formatter.step({4529 "name": "error reported as CANNOT_EVALUATE",4530 "keyword": "Then "4531});4532formatter.match({4533 "location": "StepDefinitionsLogging.error_reported_as(String)"4534});4535formatter.result({4536 "status": "passed"4537});4538formatter.after({4539 "status": "passed"4540});4541formatter.after({4542 "status": "passed"4543});4544formatter.after({4545 "status": "passed"4546});4547formatter.after({4548 "status": "passed"4549});4550formatter.after({4551 "status": "passed"4552});4553formatter.after({4554 "status": "passed"4555});4556formatter.after({4557 "status": "passed"4558});4559formatter.scenario({4560 "name": "Difference in Days",4561 "description": "",4562 "keyword": "Scenario"4563});4564formatter.before({4565 "status": "passed"4566});4567formatter.before({4568 "status": "passed"4569});4570formatter.before({4571 "status": "passed"4572});4573formatter.before({4574 "status": "passed"4575});4576formatter.before({4577 "status": "passed"4578});4579formatter.before({4580 "status": "passed"4581});4582formatter.before({4583 "status": "passed"4584});4585formatter.step({4586 "name": "processing:",4587 "keyword": "When ",4588 "doc_string": {4589 "value": "#define TODAY \u003d Today()\n#define THREE_DAYS_FROM_NOW \u003d TodayOffsetBy(3) \n#define DIFFERENCE \u003d DaysDifference(TODAY,THREE_DAYS_FROM_NOW) \nDifference is DIFFERENCE"4590 }4591});4592formatter.match({4593 "location": "StepDefinitions.processing(String)"4594});4595formatter.result({4596 "status": "passed"4597});4598formatter.step({4599 "name": "result is:",4600 "keyword": "Then ",4601 "doc_string": {4602 "value": "Difference is 3"4603 }4604});4605formatter.match({4606 "location": "StepDefinitions.result_is(String)"4607});4608formatter.result({4609 "status": "passed"4610});4611formatter.after({4612 "status": "passed"4613});4614formatter.after({4615 "status": "passed"4616});4617formatter.after({4618 "status": "passed"4619});4620formatter.after({4621 "status": "passed"4622});4623formatter.after({4624 "status": "passed"4625});4626formatter.after({4627 "status": "passed"4628});4629formatter.after({4630 "status": "passed"4631});4632formatter.uri("features/fileoperations.feature");4633formatter.feature({4634 "name": "FileOperations",4635 "description": "",4636 "keyword": "Feature"4637});4638formatter.scenario({4639 "name": "Write to file in directory that doesn\u0027t exist",4640 "description": "",4641 "keyword": "Scenario"4642});4643formatter.before({4644 "status": "passed"4645});4646formatter.before({4647 "status": "passed"4648});4649formatter.before({4650 "status": "passed"4651});4652formatter.before({4653 "status": "passed"4654});4655formatter.before({4656 "status": "passed"4657});4658formatter.before({4659 "status": "passed"4660});4661formatter.before({4662 "status": "passed"4663});4664formatter.step({4665 "name": "writing to xerefewedfes/ewrted",4666 "keyword": "When "4667});4668formatter.match({4669 "location": "StepDefinitionsFileOperations.writing_to(String)"4670});4671formatter.result({4672 "status": "passed"4673});4674formatter.step({4675 "name": "error reported as UNABLE_TO_WRITE_TO",4676 "keyword": "Then "4677});4678formatter.match({4679 "location": "StepDefinitionsLogging.error_reported_as(String)"4680});4681formatter.result({4682 "status": "passed"4683});4684formatter.after({4685 "status": "passed"4686});4687formatter.after({4688 "status": "passed"4689});4690formatter.after({4691 "status": "passed"4692});4693formatter.after({4694 "status": "passed"4695});4696formatter.after({4697 "status": "passed"4698});4699formatter.after({4700 "status": "passed"4701});4702formatter.after({4703 "status": "passed"4704});4705formatter.scenario({4706 "name": "Read from file that doesn\u0027t exist",4707 "description": "",4708 "keyword": "Scenario"4709});4710formatter.before({4711 "status": "passed"4712});4713formatter.before({4714 "status": "passed"4715});4716formatter.before({4717 "status": "passed"4718});4719formatter.before({4720 "status": "passed"4721});4722formatter.before({4723 "status": "passed"4724});4725formatter.before({4726 "status": "passed"4727});4728formatter.before({4729 "status": "passed"4730});4731formatter.step({4732 "name": "reading to xerefewedfes/ewrted",4733 "keyword": "When "4734});4735formatter.match({4736 "location": "StepDefinitionsFileOperations.reading_to(String)"4737});4738formatter.result({4739 "status": "passed"4740});4741formatter.step({4742 "name": "error reported as UNABLE_TO_READ",4743 "keyword": "Then "4744});4745formatter.match({4746 "location": "StepDefinitionsLogging.error_reported_as(String)"4747});4748formatter.result({4749 "status": "passed"4750});4751formatter.after({4752 "status": "passed"4753});4754formatter.after({4755 "status": "passed"4756});4757formatter.after({4758 "status": "passed"4759});4760formatter.after({4761 "status": "passed"4762});4763formatter.after({4764 "status": "passed"4765});4766formatter.after({4767 "status": "passed"4768});4769formatter.after({4770 "status": "passed"4771});4772formatter.scenario({4773 "name": "Read from csv file that doesn\u0027t exist",4774 "description": "",4775 "keyword": "Scenario"4776});4777formatter.before({4778 "status": "passed"4779});4780formatter.before({4781 "status": "passed"4782});4783formatter.before({4784 "status": "passed"4785});4786formatter.before({4787 "status": "passed"4788});4789formatter.before({4790 "status": "passed"4791});4792formatter.before({4793 "status": "passed"4794});4795formatter.before({4796 "status": "passed"4797});4798formatter.step({4799 "name": "reading from csv file xerefewedfes/ewrted.csv",4800 "keyword": "When "4801});4802formatter.match({4803 "location": "StepDefinitionsFileOperations.reading_from_csv_file(String)"4804});4805formatter.result({4806 "status": "passed"4807});4808formatter.step({4809 "name": "error reported as UNABLE_TO_READ",4810 "keyword": "Then "4811});4812formatter.match({4813 "location": "StepDefinitionsLogging.error_reported_as(String)"4814});4815formatter.result({4816 "status": "passed"4817});4818formatter.after({4819 "status": "passed"4820});4821formatter.after({4822 "status": "passed"4823});4824formatter.after({4825 "status": "passed"4826});4827formatter.after({4828 "status": "passed"4829});4830formatter.after({4831 "status": "passed"4832});4833formatter.after({4834 "status": "passed"4835});4836formatter.after({4837 "status": "passed"4838});4839formatter.uri("features/include.feature");4840formatter.feature({4841 "name": "Include Files in Preprocessor",4842 "description": "",4843 "keyword": "Feature"4844});4845formatter.scenario({4846 "name": "Process a simple include",4847 "description": "",4848 "keyword": "Scenario"4849});4850formatter.before({4851 "status": "passed"4852});4853formatter.before({4854 "status": "passed"4855});4856formatter.before({4857 "status": "passed"4858});4859formatter.before({4860 "status": "passed"4861});4862formatter.before({4863 "status": "passed"4864});4865formatter.before({4866 "status": "passed"4867});4868formatter.before({4869 "status": "passed"4870});4871formatter.step({4872 "name": "file SampleInclude.txt exists with:",4873 "keyword": "Given ",4874 "doc_string": {4875 "value": "Something to include\n"4876 }4877});4878formatter.match({4879 "location": "StepDefinitions.file_exists_with(Pathname,String)"4880});4881formatter.result({4882 "status": "passed"4883});4884formatter.step({4885 "name": "processing:",4886 "keyword": "When ",4887 "doc_string": {4888 "value": "First line\n#include \"SampleInclude.txt\" \nLast line"4889 }4890});4891formatter.match({4892 "location": "StepDefinitions.processing(String)"4893});4894formatter.result({4895 "status": "passed"4896});4897formatter.step({4898 "name": "result is:",4899 "keyword": "Then ",4900 "doc_string": {4901 "value": "First line\nSomething to include\nLast line"4902 }4903});4904formatter.match({4905 "location": "StepDefinitions.result_is(String)"4906});4907formatter.result({4908 "status": "passed"4909});4910formatter.after({4911 "status": "passed"4912});4913formatter.after({4914 "status": "passed"4915});4916formatter.after({4917 "status": "passed"4918});4919formatter.after({4920 "status": "passed"4921});4922formatter.after({4923 "status": "passed"4924});4925formatter.after({4926 "status": "passed"4927});4928formatter.after({4929 "status": "passed"4930});4931formatter.scenario({4932 "name": "Process two include files",4933 "description": "",4934 "keyword": "Scenario"4935});4936formatter.before({4937 "status": "passed"4938});4939formatter.before({4940 "status": "passed"4941});4942formatter.before({4943 "status": "passed"4944});4945formatter.before({4946 "status": "passed"4947});4948formatter.before({4949 "status": "passed"4950});4951formatter.before({4952 "status": "passed"4953});4954formatter.before({4955 "status": "passed"4956});4957formatter.step({4958 "name": "file SampleInclude.txt exists with:",4959 "keyword": "Given ",4960 "doc_string": {4961 "value": "Something to include\n"4962 }4963});4964formatter.match({4965 "location": "StepDefinitions.file_exists_with(Pathname,String)"4966});4967formatter.result({4968 "status": "passed"4969});4970formatter.step({4971 "name": "file SampleIncludeOther.txt exists with:",4972 "keyword": "Given ",4973 "doc_string": {4974 "value": "Other to include\n"4975 }4976});4977formatter.match({4978 "location": "StepDefinitions.file_exists_with(Pathname,String)"4979});4980formatter.result({4981 "status": "passed"4982});4983formatter.step({4984 "name": "processing:",4985 "keyword": "When ",4986 "doc_string": {4987 "value": "First line\n#include \"SampleInclude.txt\"\n#include \"SampleIncludeOther.txt\"\nLast line"4988 }4989});4990formatter.match({4991 "location": "StepDefinitions.processing(String)"4992});4993formatter.result({4994 "status": "passed"4995});4996formatter.step({4997 "name": "result is:",4998 "keyword": "Then ",4999 "doc_string": {5000 "value": "First line\nSomething to include\nOther to include\nLast line"5001 }5002});5003formatter.match({5004 "location": "StepDefinitions.result_is(String)"5005});5006formatter.result({5007 "status": "passed"5008});5009formatter.after({5010 "status": "passed"5011});5012formatter.after({5013 "status": "passed"5014});5015formatter.after({5016 "status": "passed"5017});5018formatter.after({5019 "status": "passed"5020});5021formatter.after({5022 "status": "passed"5023});5024formatter.after({5025 "status": "passed"5026});5027formatter.after({5028 "status": "passed"5029});5030formatter.scenario({5031 "name": "Process nested includes",5032 "description": "",5033 "keyword": "Scenario"5034});5035formatter.before({5036 "status": "passed"5037});5038formatter.before({5039 "status": "passed"5040});5041formatter.before({5042 "status": "passed"5043});5044formatter.before({5045 "status": "passed"5046});5047formatter.before({5048 "status": "passed"5049});5050formatter.before({5051 "status": "passed"5052});5053formatter.before({5054 "status": "passed"5055});5056formatter.step({5057 "name": "file SampleInclude.txt exists with:",5058 "keyword": "Given ",5059 "doc_string": {5060 "value": "Something to include\n#include \"SampleIncludeOther.txt\"\n"5061 }5062});5063formatter.match({5064 "location": "StepDefinitions.file_exists_with(Pathname,String)"5065});5066formatter.result({5067 "status": "passed"5068});5069formatter.step({5070 "name": "file SampleIncludeOther.txt exists with:",5071 "keyword": "Given ",5072 "doc_string": {5073 "value": "Other to include\n"5074 }5075});5076formatter.match({5077 "location": "StepDefinitions.file_exists_with(Pathname,String)"5078});5079formatter.result({5080 "status": "passed"5081});5082formatter.step({5083 "name": "processing:",5084 "keyword": "When ",5085 "doc_string": {5086 "value": "First line\n#include \"SampleInclude.txt\"\nLast line"5087 }5088});5089formatter.match({5090 "location": "StepDefinitions.processing(String)"5091});5092formatter.result({5093 "status": "passed"5094});5095formatter.step({5096 "name": "result is:",5097 "keyword": "Then ",5098 "doc_string": {5099 "value": "First line\nSomething to include\nOther to include\nLast line"5100 }5101});5102formatter.match({5103 "location": "StepDefinitions.result_is(String)"5104});5105formatter.result({5106 "status": "passed"5107});5108formatter.after({5109 "status": "passed"5110});5111formatter.after({5112 "status": "passed"5113});5114formatter.after({5115 "status": "passed"5116});5117formatter.after({5118 "status": "passed"5119});5120formatter.after({5121 "status": "passed"5122});5123formatter.after({5124 "status": "passed"5125});5126formatter.after({5127 "status": "passed"5128});5129formatter.scenario({5130 "name": "CSV File",5131 "description": "",5132 "keyword": "Scenario"5133});5134formatter.before({5135 "status": "passed"5136});5137formatter.before({5138 "status": "passed"5139});5140formatter.before({5141 "status": "passed"5142});5143formatter.before({5144 "status": "passed"5145});5146formatter.before({5147 "status": "passed"5148});5149formatter.before({5150 "status": "passed"5151});5152formatter.before({5153 "status": "passed"5154});5155formatter.step({5156 "name": "include file TestCSV.csv exists with:",5157 "keyword": "Given ",5158 "doc_string": {5159 "value": "FieldOne, FieldTwo\n1,2\n"5160 }5161});5162formatter.match({5163 "location": "StepDefinitionsMain.include_file_TestInclude_txt_exists_with(Pathname,String)"5164});5165formatter.result({5166 "status": "passed"5167});5168formatter.step({5169 "name": "processing:",5170 "keyword": "When ",5171 "doc_string": {5172 "value": "Feature: Test Feature\nScenario Outline: Two \nGiven value is \u003cFieldOne\u003e\nWhen processed \nThen result is \u003cFieldTwo\u003e \nExamples:\n#include \"TestCSV.csv\"\n"5173 }5174});5175formatter.match({5176 "location": "StepDefinitions.processing(String)"5177});5178formatter.result({5179 "status": "passed"5180});5181formatter.step({5182 "name": "result is:",5183 "keyword": "Then ",5184 "doc_string": {5185 "value": "Feature: Test Feature\nScenario Outline: Two \nGiven value is \u003cFieldOne\u003e\nWhen processed \nThen result is \u003cFieldTwo\u003e \nExamples:\n|FieldOne|FieldTwo|\n|1|2|\n"5186 }5187});5188formatter.match({5189 "location": "StepDefinitions.result_is(String)"5190});5191formatter.result({5192 "status": "passed"5193});5194formatter.after({5195 "status": "passed"5196});5197formatter.after({5198 "status": "passed"5199});5200formatter.after({5201 "status": "passed"5202});5203formatter.after({5204 "status": "passed"5205});5206formatter.after({5207 "status": "passed"5208});5209formatter.after({5210 "status": "passed"5211});5212formatter.after({5213 "status": "passed"5214});5215formatter.scenario({5216 "name": "A nested include that exceeds recursion limit",5217 "description": "",5218 "keyword": "Scenario"5219});5220formatter.before({5221 "status": "passed"5222});5223formatter.before({5224 "status": "passed"5225});5226formatter.before({5227 "status": "passed"5228});5229formatter.before({5230 "status": "passed"5231});5232formatter.before({5233 "status": "passed"5234});5235formatter.before({5236 "status": "passed"5237});5238formatter.before({5239 "status": "passed"5240});5241formatter.step({5242 "name": "file SampleIncludeRecursive.txt exists with:",5243 "keyword": "Given ",5244 "doc_string": {5245 "value": "Something to include\n#include \"SampleIncludeRecursive.txt\"\n"5246 }5247});5248formatter.match({5249 "location": "StepDefinitions.file_exists_with(Pathname,String)"5250});5251formatter.result({5252 "status": "passed"5253});5254formatter.step({5255 "name": "processing:",5256 "keyword": "When ",5257 "doc_string": {5258 "value": "First line\n#include \"SampleIncludeRecursive.txt\"\nLast line"5259 }5260});5261formatter.match({5262 "location": "StepDefinitions.processing(String)"5263});5264formatter.result({5265 "status": "passed"5266});5267formatter.step({5268 "name": "result is:",5269 "keyword": "Then ",5270 "doc_string": {5271 "value": "First line\nSomething to include\nSomething to include\nSomething to include\nSomething to include\nSomething to include\nSomething to include\nSomething to include\nSomething to include\nSomething to include\nSomething to include\n#include \"SampleIncludeRecursive.txt\"\nLast line"5272 }5273});5274formatter.match({5275 "location": "StepDefinitions.result_is(String)"5276});5277formatter.result({5278 "status": "passed"5279});5280formatter.after({5281 "status": "passed"5282});5283formatter.after({5284 "status": "passed"5285});5286formatter.after({5287 "status": "passed"5288});5289formatter.after({5290 "status": "passed"5291});5292formatter.after({5293 "status": "passed"5294});5295formatter.after({5296 "status": "passed"5297});5298formatter.after({5299 "status": "passed"5300});5301formatter.scenario({5302 "name": "Process include that does not exist",5303 "description": "",5304 "keyword": "Scenario"5305});5306formatter.before({5307 "status": "passed"5308});5309formatter.before({5310 "status": "passed"5311});5312formatter.before({5313 "status": "passed"5314});5315formatter.before({5316 "status": "passed"5317});5318formatter.before({5319 "status": "passed"5320});5321formatter.before({5322 "status": "passed"5323});5324formatter.before({5325 "status": "passed"5326});5327formatter.step({5328 "name": "processing:",5329 "keyword": "When ",5330 "doc_string": {5331 "value": "First line\n#include \"IncludeThatDoesNotExist.txt\" \nLast line"5332 }5333});5334formatter.match({5335 "location": "StepDefinitions.processing(String)"5336});5337formatter.result({5338 "status": "passed"5339});5340formatter.step({5341 "name": "result is:",5342 "keyword": "Then ",5343 "doc_string": {5344 "value": "First line\nINCLUDE NOT FOUND\nLast line"5345 }5346});5347formatter.match({5348 "location": "StepDefinitions.result_is(String)"5349});5350formatter.result({5351 "status": "passed"5352});5353formatter.step({5354 "name": "error reported as CANNOT_READ_INCLUDE",5355 "keyword": "Then "5356});5357formatter.match({5358 "location": "StepDefinitionsLogging.error_reported_as(String)"5359});5360formatter.result({5361 "status": "passed"5362});5363formatter.after({5364 "status": "passed"5365});5366formatter.after({5367 "status": "passed"5368});5369formatter.after({5370 "status": "passed"5371});5372formatter.after({5373 "status": "passed"5374});5375formatter.after({5376 "status": "passed"5377});5378formatter.after({5379 "status": "passed"5380});5381formatter.after({5382 "status": "passed"5383});5384formatter.scenario({5385 "name": "Process include line without a filename",5386 "description": "",5387 "keyword": "Scenario"5388});5389formatter.before({5390 "status": "passed"5391});5392formatter.before({5393 "status": "passed"5394});5395formatter.before({5396 "status": "passed"5397});5398formatter.before({5399 "status": "passed"5400});5401formatter.before({5402 "status": "passed"5403});5404formatter.before({5405 "status": "passed"5406});5407formatter.before({5408 "status": "passed"5409});5410formatter.step({5411 "name": "processing:",5412 "keyword": "When ",5413 "doc_string": {5414 "value": "First line\n#include \nLast line"5415 }5416});5417formatter.match({5418 "location": "StepDefinitions.processing(String)"5419});5420formatter.result({5421 "status": "passed"5422});5423formatter.step({5424 "name": "result is:",5425 "keyword": "Then ",5426 "doc_string": {5427 "value": "First line\nINCLUDE NOT FOUND\nLast line"5428 }5429});5430formatter.match({5431 "location": "StepDefinitions.result_is(String)"5432});5433formatter.result({5434 "status": "passed"5435});5436formatter.step({5437 "name": "error reported as NO_INCLUDE_FILENAME_FOR_LINE",5438 "keyword": "Then "5439});5440formatter.match({5441 "location": "StepDefinitionsLogging.error_reported_as(String)"5442});5443formatter.result({5444 "status": "passed"5445});5446formatter.after({5447 "status": "passed"5448});5449formatter.after({5450 "status": "passed"5451});5452formatter.after({5453 "status": "passed"5454});5455formatter.after({5456 "status": "passed"5457});5458formatter.after({5459 "status": "passed"5460});5461formatter.after({5462 "status": "passed"5463});5464formatter.after({5465 "status": "passed"5466});5467formatter.uri("features/logging.feature");5468formatter.feature({5469 "name": "Logging",5470 "description": "",5471 "keyword": "Feature"5472});5473formatter.scenario({5474 "name": "Attempt to read error that does not exist",5475 "description": "",5476 "keyword": "Scenario"5477});5478formatter.before({5479 "status": "passed"5480});5481formatter.before({5482 "status": "passed"5483});5484formatter.before({5485 "status": "passed"5486});5487formatter.before({5488 "status": "passed"5489});5490formatter.before({5491 "status": "passed"5492});5493formatter.before({5494 "status": "passed"5495});5496formatter.before({5497 "status": "passed"5498});5499formatter.step({5500 "name": "check for error reported as XXXXX",5501 "keyword": "Then "5502});5503formatter.match({5504 "location": "StepDefinitionsLogging.check_for_error_reported_as(String)"5505});5506formatter.result({5507 "status": "passed"5508});5509formatter.step({5510 "name": "error reported as ILLEGAL_ARGUMENT",5511 "keyword": "Then "5512});5513formatter.match({5514 "location": "StepDefinitionsLogging.error_reported_as(String)"5515});5516formatter.result({5517 "status": "passed"5518});5519formatter.after({5520 "status": "passed"5521});5522formatter.after({5523 "status": "passed"5524});5525formatter.after({5526 "status": "passed"5527});5528formatter.after({5529 "status": "passed"5530});5531formatter.after({5532 "status": "passed"5533});5534formatter.after({5535 "status": "passed"5536});5537formatter.after({5538 "status": "passed"5539});...

Full Screen

Full Screen

htmllib.py

Source:htmllib.py Github

copy

Full Screen

1"""HTML 2.0 parser.23See the HTML 2.0 specification:4http://www.w3.org/hypertext/WWW/MarkUp/html-spec/html-spec_toc.html5"""67from warnings import warnpy3k8warnpy3k("the htmllib module has been removed in Python 3.0",9 stacklevel=2)10del warnpy3k1112import sgmllib1314from formatter import AS_IS1516__all__ = ["HTMLParser", "HTMLParseError"]171819class HTMLParseError(sgmllib.SGMLParseError):20 """Error raised when an HTML document can't be parsed."""212223class HTMLParser(sgmllib.SGMLParser):24 """This is the basic HTML parser class.2526 It supports all entity names required by the XHTML 1.0 Recommendation.27 It also defines handlers for all HTML 2.0 and many HTML 3.0 and 3.228 elements.2930 """3132 from htmlentitydefs import entitydefs3334 def __init__(self, formatter, verbose=0):35 """Creates an instance of the HTMLParser class.3637 The formatter parameter is the formatter instance associated with38 the parser.3940 """41 sgmllib.SGMLParser.__init__(self, verbose)42 self.formatter = formatter4344 def error(self, message):45 raise HTMLParseError(message)4647 def reset(self):48 sgmllib.SGMLParser.reset(self)49 self.savedata = None50 self.isindex = 051 self.title = None52 self.base = None53 self.anchor = None54 self.anchorlist = []55 self.nofill = 056 self.list_stack = []5758 # ------ Methods used internally; some may be overridden5960 # --- Formatter interface, taking care of 'savedata' mode;61 # shouldn't need to be overridden6263 def handle_data(self, data):64 if self.savedata is not None:65 self.savedata = self.savedata + data66 else:67 if self.nofill:68 self.formatter.add_literal_data(data)69 else:70 self.formatter.add_flowing_data(data)7172 # --- Hooks to save data; shouldn't need to be overridden7374 def save_bgn(self):75 """Begins saving character data in a buffer instead of sending it76 to the formatter object.7778 Retrieve the stored data via the save_end() method. Use of the79 save_bgn() / save_end() pair may not be nested.8081 """82 self.savedata = ''8384 def save_end(self):85 """Ends buffering character data and returns all data saved since86 the preceding call to the save_bgn() method.8788 If the nofill flag is false, whitespace is collapsed to single89 spaces. A call to this method without a preceding call to the90 save_bgn() method will raise a TypeError exception.9192 """93 data = self.savedata94 self.savedata = None95 if not self.nofill:96 data = ' '.join(data.split())97 return data9899 # --- Hooks for anchors; should probably be overridden100101 def anchor_bgn(self, href, name, type):102 """This method is called at the start of an anchor region.103104 The arguments correspond to the attributes of the <A> tag with105 the same names. The default implementation maintains a list of106 hyperlinks (defined by the HREF attribute for <A> tags) within107 the document. The list of hyperlinks is available as the data108 attribute anchorlist.109110 """111 self.anchor = href112 if self.anchor:113 self.anchorlist.append(href)114115 def anchor_end(self):116 """This method is called at the end of an anchor region.117118 The default implementation adds a textual footnote marker using an119 index into the list of hyperlinks created by the anchor_bgn()method.120121 """122 if self.anchor:123 self.handle_data("[%d]" % len(self.anchorlist))124 self.anchor = None125126 # --- Hook for images; should probably be overridden127128 def handle_image(self, src, alt, *args):129 """This method is called to handle images.130131 The default implementation simply passes the alt value to the132 handle_data() method.133134 """135 self.handle_data(alt)136137 # --------- Top level elememts138139 def start_html(self, attrs): pass140 def end_html(self): pass141142 def start_head(self, attrs): pass143 def end_head(self): pass144145 def start_body(self, attrs): pass146 def end_body(self): pass147148 # ------ Head elements149150 def start_title(self, attrs):151 self.save_bgn()152153 def end_title(self):154 self.title = self.save_end()155156 def do_base(self, attrs):157 for a, v in attrs:158 if a == 'href':159 self.base = v160161 def do_isindex(self, attrs):162 self.isindex = 1163164 def do_link(self, attrs):165 pass166167 def do_meta(self, attrs):168 pass169170 def do_nextid(self, attrs): # Deprecated171 pass172173 # ------ Body elements174175 # --- Headings176177 def start_h1(self, attrs):178 self.formatter.end_paragraph(1)179 self.formatter.push_font(('h1', 0, 1, 0))180181 def end_h1(self):182 self.formatter.end_paragraph(1)183 self.formatter.pop_font()184185 def start_h2(self, attrs):186 self.formatter.end_paragraph(1)187 self.formatter.push_font(('h2', 0, 1, 0))188189 def end_h2(self):190 self.formatter.end_paragraph(1)191 self.formatter.pop_font()192193 def start_h3(self, attrs):194 self.formatter.end_paragraph(1)195 self.formatter.push_font(('h3', 0, 1, 0))196197 def end_h3(self):198 self.formatter.end_paragraph(1)199 self.formatter.pop_font()200201 def start_h4(self, attrs):202 self.formatter.end_paragraph(1)203 self.formatter.push_font(('h4', 0, 1, 0))204205 def end_h4(self):206 self.formatter.end_paragraph(1)207 self.formatter.pop_font()208209 def start_h5(self, attrs):210 self.formatter.end_paragraph(1)211 self.formatter.push_font(('h5', 0, 1, 0))212213 def end_h5(self):214 self.formatter.end_paragraph(1)215 self.formatter.pop_font()216217 def start_h6(self, attrs):218 self.formatter.end_paragraph(1)219 self.formatter.push_font(('h6', 0, 1, 0))220221 def end_h6(self):222 self.formatter.end_paragraph(1)223 self.formatter.pop_font()224225 # --- Block Structuring Elements226227 def do_p(self, attrs):228 self.formatter.end_paragraph(1)229230 def start_pre(self, attrs):231 self.formatter.end_paragraph(1)232 self.formatter.push_font((AS_IS, AS_IS, AS_IS, 1))233 self.nofill = self.nofill + 1234235 def end_pre(self):236 self.formatter.end_paragraph(1)237 self.formatter.pop_font()238 self.nofill = max(0, self.nofill - 1)239240 def start_xmp(self, attrs):241 self.start_pre(attrs)242 self.setliteral('xmp') # Tell SGML parser243244 def end_xmp(self):245 self.end_pre()246247 def start_listing(self, attrs):248 self.start_pre(attrs)249 self.setliteral('listing') # Tell SGML parser250251 def end_listing(self):252 self.end_pre()253254 def start_address(self, attrs):255 self.formatter.end_paragraph(0)256 self.formatter.push_font((AS_IS, 1, AS_IS, AS_IS))257258 def end_address(self):259 self.formatter.end_paragraph(0)260 self.formatter.pop_font()261262 def start_blockquote(self, attrs):263 self.formatter.end_paragraph(1)264 self.formatter.push_margin('blockquote')265266 def end_blockquote(self):267 self.formatter.end_paragraph(1)268 self.formatter.pop_margin()269270 # --- List Elements271272 def start_ul(self, attrs):273 self.formatter.end_paragraph(not self.list_stack)274 self.formatter.push_margin('ul')275 self.list_stack.append(['ul', '*', 0])276277 def end_ul(self):278 if self.list_stack: del self.list_stack[-1]279 self.formatter.end_paragraph(not self.list_stack)280 self.formatter.pop_margin()281282 def do_li(self, attrs):283 self.formatter.end_paragraph(0)284 if self.list_stack:285 [dummy, label, counter] = top = self.list_stack[-1]286 top[2] = counter = counter+1287 else:288 label, counter = '*', 0289 self.formatter.add_label_data(label, counter)290291 def start_ol(self, attrs):292 self.formatter.end_paragraph(not self.list_stack)293 self.formatter.push_margin('ol')294 label = '1.'295 for a, v in attrs:296 if a == 'type':297 if len(v) == 1: v = v + '.'298 label = v299 self.list_stack.append(['ol', label, 0])300301 def end_ol(self):302 if self.list_stack: del self.list_stack[-1]303 self.formatter.end_paragraph(not self.list_stack)304 self.formatter.pop_margin()305306 def start_menu(self, attrs):307 self.start_ul(attrs)308309 def end_menu(self):310 self.end_ul()311312 def start_dir(self, attrs):313 self.start_ul(attrs)314315 def end_dir(self):316 self.end_ul()317318 def start_dl(self, attrs):319 self.formatter.end_paragraph(1)320 self.list_stack.append(['dl', '', 0])321322 def end_dl(self):323 self.ddpop(1)324 if self.list_stack: del self.list_stack[-1]325326 def do_dt(self, attrs):327 self.ddpop()328329 def do_dd(self, attrs):330 self.ddpop()331 self.formatter.push_margin('dd')332 self.list_stack.append(['dd', '', 0])333334 def ddpop(self, bl=0):335 self.formatter.end_paragraph(bl)336 if self.list_stack:337 if self.list_stack[-1][0] == 'dd':338 del self.list_stack[-1]339 self.formatter.pop_margin()340341 # --- Phrase Markup342343 # Idiomatic Elements344345 def start_cite(self, attrs): self.start_i(attrs)346 def end_cite(self): self.end_i()347348 def start_code(self, attrs): self.start_tt(attrs)349 def end_code(self): self.end_tt()350351 def start_em(self, attrs): self.start_i(attrs)352 def end_em(self): self.end_i()353354 def start_kbd(self, attrs): self.start_tt(attrs)355 def end_kbd(self): self.end_tt()356357 def start_samp(self, attrs): self.start_tt(attrs)358 def end_samp(self): self.end_tt()359360 def start_strong(self, attrs): self.start_b(attrs)361 def end_strong(self): self.end_b()362363 def start_var(self, attrs): self.start_i(attrs)364 def end_var(self): self.end_i()365366 # Typographic Elements367368 def start_i(self, attrs):369 self.formatter.push_font((AS_IS, 1, AS_IS, AS_IS))370 def end_i(self):371 self.formatter.pop_font()372373 def start_b(self, attrs):374 self.formatter.push_font((AS_IS, AS_IS, 1, AS_IS))375 def end_b(self):376 self.formatter.pop_font()377378 def start_tt(self, attrs):379 self.formatter.push_font((AS_IS, AS_IS, AS_IS, 1))380 def end_tt(self):381 self.formatter.pop_font()382383 def start_a(self, attrs):384 href = ''385 name = ''386 type = ''387 for attrname, value in attrs:388 value = value.strip()389 if attrname == 'href':390 href = value391 if attrname == 'name':392 name = value393 if attrname == 'type':394 type = value.lower()395 self.anchor_bgn(href, name, type)396397 def end_a(self):398 self.anchor_end()399400 # --- Line Break401402 def do_br(self, attrs):403 self.formatter.add_line_break()404405 # --- Horizontal Rule406407 def do_hr(self, attrs):408 self.formatter.add_hor_rule()409410 # --- Image411412 def do_img(self, attrs):413 align = ''414 alt = '(image)'415 ismap = ''416 src = ''417 width = 0418 height = 0419 for attrname, value in attrs:420 if attrname == 'align':421 align = value422 if attrname == 'alt':423 alt = value424 if attrname == 'ismap':425 ismap = value426 if attrname == 'src':427 src = value428 if attrname == 'width':429 try: width = int(value)430 except ValueError: pass431 if attrname == 'height':432 try: height = int(value)433 except ValueError: pass434 self.handle_image(src, alt, ismap, align, width, height)435436 # --- Really Old Unofficial Deprecated Stuff437438 def do_plaintext(self, attrs):439 self.start_pre(attrs)440 self.setnomoretags() # Tell SGML parser441442 # --- Unhandled tags443444 def unknown_starttag(self, tag, attrs):445 pass446447 def unknown_endtag(self, tag):448 pass449450451def test(args = None):452 import sys, formatter453454 if not args:455 args = sys.argv[1:]456457 silent = args and args[0] == '-s'458 if silent:459 del args[0]460461 if args:462 file = args[0]463 else:464 file = 'test.html'465466 if file == '-':467 f = sys.stdin468 else:469 try:470 f = open(file, 'r')471 except IOError, msg:472 print file, ":", msg473 sys.exit(1)474475 data = f.read()476477 if f is not sys.stdin:478 f.close()479480 if silent:481 f = formatter.NullFormatter()482 else:483 f = formatter.AbstractFormatter(formatter.DumbWriter())484485 p = HTMLParser(f)486 p.feed(data)487 p.close()488489490if __name__ == '__main__': ...

Full Screen

Full Screen

_mapping.py

Source:_mapping.py Github

copy

Full Screen

1# -*- coding: utf-8 -*-2"""3 pygments.formatters._mapping4 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~5 Formatter mapping defintions. This file is generated by itself. Everytime6 you change something on a builtin formatter defintion, run this script from7 the formatters folder to update it.8 Do not alter the FORMATTERS dictionary by hand.9 :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.10 :license: BSD, see LICENSE for details.11"""12# start13from pygments.formatters.bbcode import BBCodeFormatter14from pygments.formatters.html import HtmlFormatter15from pygments.formatters.img import BmpImageFormatter16from pygments.formatters.img import GifImageFormatter17from pygments.formatters.img import ImageFormatter18from pygments.formatters.img import JpgImageFormatter19from pygments.formatters.latex import LatexFormatter20from pygments.formatters.other import NullFormatter21from pygments.formatters.other import RawTokenFormatter22from pygments.formatters.rtf import RtfFormatter23from pygments.formatters.svg import SvgFormatter24from pygments.formatters.terminal import TerminalFormatter25from pygments.formatters.terminal256 import Terminal256Formatter26FORMATTERS = {27 BBCodeFormatter: ('BBCode', ('bbcode', 'bb'), (), 'Format tokens with BBcodes. These formatting codes are used by many bulletin boards, so you can highlight your sourcecode with pygments before posting it there.'),28 BmpImageFormatter: ('img_bmp', ('bmp', 'bitmap'), ('*.bmp',), 'Create a bitmap image from source code. This uses the Python Imaging Library to generate a pixmap from the source code.'),29 GifImageFormatter: ('img_gif', ('gif',), ('*.gif',), 'Create a GIF image from source code. This uses the Python Imaging Library to generate a pixmap from the source code.'),30 HtmlFormatter: ('HTML', ('html',), ('*.html', '*.htm'), "Format tokens as HTML 4 ``<span>`` tags within a ``<pre>`` tag, wrapped in a ``<div>`` tag. The ``<div>``'s CSS class can be set by the `cssclass` option."),31 ImageFormatter: ('img', ('img', 'IMG', 'png'), ('*.png',), 'Create a PNG image from source code. This uses the Python Imaging Library to generate a pixmap from the source code.'),32 JpgImageFormatter: ('img_jpg', ('jpg', 'jpeg'), ('*.jpg',), 'Create a JPEG image from source code. This uses the Python Imaging Library to generate a pixmap from the source code.'),33 LatexFormatter: ('LaTeX', ('latex', 'tex'), ('*.tex',), 'Format tokens as LaTeX code. This needs the `fancyvrb` and `color` standard packages.'),34 NullFormatter: ('Text only', ('text', 'null'), ('*.txt',), 'Output the text unchanged without any formatting.'),35 RawTokenFormatter: ('Raw tokens', ('raw', 'tokens'), ('*.raw',), 'Format tokens as a raw representation for storing token streams.'),36 RtfFormatter: ('RTF', ('rtf',), ('*.rtf',), 'Format tokens as RTF markup. This formatter automatically outputs full RTF documents with color information and other useful stuff. Perfect for Copy and Paste into Microsoft\xc2\xae Word\xc2\xae documents.'),37 SvgFormatter: ('SVG', ('svg',), ('*.svg',), 'Format tokens as an SVG graphics file. This formatter is still experimental. Each line of code is a ``<text>`` element with explicit ``x`` and ``y`` coordinates containing ``<tspan>`` elements with the individual token styles.'),38 Terminal256Formatter: ('Terminal256', ('terminal256', 'console256', '256'), (), 'Format tokens with ANSI color sequences, for output in a 256-color terminal or console. Like in `TerminalFormatter` color sequences are terminated at newlines, so that paging the output works correctly.'),39 TerminalFormatter: ('Terminal', ('terminal', 'console'), (), 'Format tokens with ANSI color sequences, for output in a text console. Color sequences are terminated at newlines, so that paging the output works correctly.')40}41if __name__ == '__main__':42 import sys43 import os44 # lookup formatters45 found_formatters = []46 imports = []47 sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', '..'))48 from pygments.util import docstring_headline49 for filename in os.listdir('.'):50 if filename.endswith('.py') and not filename.startswith('_'):51 module_name = 'pygments.formatters.%s' % filename[:-3]52 print module_name53 module = __import__(module_name, None, None, [''])54 for formatter_name in module.__all__:55 imports.append((module_name, formatter_name))56 formatter = getattr(module, formatter_name)57 found_formatters.append(58 '%s: %r' % (formatter_name,59 (formatter.name,60 tuple(formatter.aliases),61 tuple(formatter.filenames),62 docstring_headline(formatter))))63 # sort them, that should make the diff files for svn smaller64 found_formatters.sort()65 imports.sort()66 # extract useful sourcecode from this file67 f = open(__file__)68 try:69 content = f.read()70 finally:71 f.close()72 header = content[:content.find('# start')]73 footer = content[content.find("if __name__ == '__main__':"):]74 # write new file75 f = open(__file__, 'w')76 f.write(header)77 f.write('# start\n')78 f.write('\n'.join(['from %s import %s' % imp for imp in imports]))79 f.write('\n\n')80 f.write('FORMATTERS = {\n %s\n}\n\n' % ',\n '.join(found_formatters))81 f.write(footer)...

Full Screen

Full Screen

safehtmlformatter_test.js

Source:safehtmlformatter_test.js Github

copy

Full Screen

1// Copyright 2016 The Closure Library Authors. All Rights Reserved.2//3// Licensed under the Apache License, Version 2.0 (the "License");4// you may not use this file except in compliance with the License.5// You may obtain a copy of the License at6//7// http://www.apache.org/licenses/LICENSE-2.08//9// Unless required by applicable law or agreed to in writing, software10// distributed under the License is distributed on an "AS-IS" BASIS,11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.12// See the License for the specific language governing permissions and13// limitations under the License.14goog.module('goog.html.safeHtmlFormatterTest');15goog.setTestOnly();16const PropertyReplacer = goog.require('goog.testing.PropertyReplacer');17const SafeHtml = goog.require('goog.html.SafeHtml');18const SafeHtmlFormatter = goog.require('goog.html.SafeHtmlFormatter');19const SafeUrl = goog.require('goog.html.SafeUrl');20const googString = goog.require('goog.string');21const testSuite = goog.require('goog.testing.testSuite');22let stubs;23function assertSameHtml(expected, html) {24 assertEquals(expected, SafeHtml.unwrap(html));25}26testSuite({27 setUp() {28 stubs = new PropertyReplacer();29 },30 tearDown() {31 stubs.reset();32 },33 testFormat() {34 const formatter = new SafeHtmlFormatter();35 assertSameHtml(36 'a <b class="bold">&lt;bold&gt;</b> statement',37 formatter.format(googString.subs(38 'a %s<bold>%s %s', formatter.startTag('b', {'class': 'bold'}),39 formatter.endTag('b'), formatter.text('statement'))));40 },41 testFormatWithGetMsg() {42 const formatter = new SafeHtmlFormatter();43 assertSameHtml(44 'a <b class="bold">&lt;bold&gt;</b> statement',45 formatter.format(goog.getMsg('a {$startBold}<bold>{$endBold} {$type}', {46 'startBold': formatter.startTag('b', {'class': 'bold'}),47 'endBold': formatter.endTag('b'),48 'type': formatter.text('statement'),49 })));50 },51 testFormatWithGetMsgAndSafeValues() {52 const formatter = new SafeHtmlFormatter();53 assertSameHtml(54 'start <a href="about:invalid#zClosurez">bbb</a>' +55 ' <a href="about:blank">ccc</a> end',56 formatter.format(goog.getMsg(57 'start {$startA1}bbb{$endA1} {$startA2}ccc{$endA2} end', {58 'startA1':59 formatter.startTag('a', {'href': 'javascript:alert(1)'}),60 'endA1': formatter.endTag('a'),61 'startA2': formatter.startTag('a', {'href': SafeUrl.ABOUT_BLANK}),62 'endA2': formatter.endTag('a'),63 })));64 },65 testFormatWithText() {66 const formatter = new SafeHtmlFormatter();67 // Escapes format.68 assertSameHtml('dinner &lt;3', formatter.format('dinner <3'));69 // Escapes .text().70 assertSameHtml(71 'dinner &lt;3', formatter.format(formatter.text('dinner <3')));72 },73 testFormatWithSafeHtml() {74 const formatter = new SafeHtmlFormatter();75 assertSameHtml(76 'User input: <b>abc</b>',77 formatter.format(78 'User input: ' +79 formatter.safeHtml(SafeHtml.create('b', {}, 'abc'))));80 },81 testFormatWithInternalMarkers() {82 const formatter = new SafeHtmlFormatter();83 // Immunity against something looking like our marker.84 assertSameHtml(85 '{SafeHtmlFormatter:abc}', formatter.format('{SafeHtmlFormatter:abc}'));86 assertSameHtml(87 '{SafeHtmlFormatter:<br>}',88 formatter.format(89 '{SafeHtmlFormatter:' + formatter.startTag('br') + '}'));90 // If an attacker steals our random marker and we format his input using91 // .text() then we will get back his input (the random marker), not the tag.92 const br = formatter.startTag('br');93 const attackerInput = br;94 assertSameHtml(95 googString.htmlEscape(attackerInput) + '<br>',96 formatter.format(formatter.text(attackerInput) + br));97 },98 testInvalidTag() {99 assertThrows(() => {100 formatter.startTag('a onclick="alert(1);"');101 });102 assertThrows(() => {103 formatter.startTag('a', {'onclick': 'alert(1);'});104 });105 assertThrows(() => {106 formatter.startTag('script');107 });108 assertThrows(() => {109 formatter.endTag('script');110 });111 },112 testFormatBalancingTags() {113 const formatter = new SafeHtmlFormatter();114 // Void tags are OK.115 formatter.format(formatter.startTag('br'));116 // Balanced tags are OK.117 formatter.format(formatter.startTag('b') + formatter.endTag('b'));118 // Order of calling startTag and endTag doesn't matter.119 const endTag = formatter.endTag('b');120 const startTag = formatter.startTag('b');121 formatter.format(startTag + endTag);122 // Unbalanced tags throw.123 assertThrows(() => {124 formatter.format(formatter.endTag('b') + formatter.startTag('b'));125 });126 // Unclosed tags throw.127 assertThrows(() => {128 formatter.format(formatter.startTag('b'));129 });130 // Unopened tags throw.131 assertThrows(() => {132 formatter.format(formatter.endTag('b'));133 });134 },135 testDetectDoubleEscaping() {136 stubs.set(googString, 'DETECT_DOUBLE_ESCAPING', true);137 stubs.set(googString, 'ALL_RE_', /[\x00&<>"'e]/);138 const formatter = new SafeHtmlFormatter();139 assertSameHtml('t&#101;st', formatter.format(formatter.text('test')));140 },...

Full Screen

Full Screen

__init__.py

Source:__init__.py Github

copy

Full Screen

1# -*- coding: utf-8 -*-2"""3 pygments.formatters4 ~~~~~~~~~~~~~~~~~~~5 Pygments formatters.6 :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.7 :license: BSD, see LICENSE for details.8"""9import os.path10import fnmatch11from pygments.formatters._mapping import FORMATTERS12from pygments.plugin import find_plugin_formatters13from pygments.util import ClassNotFound14ns = globals()15for fcls in FORMATTERS:16 ns[fcls.__name__] = fcls17del fcls18__all__ = ['get_formatter_by_name', 'get_formatter_for_filename',19 'get_all_formatters'] + [cls.__name__ for cls in FORMATTERS]20_formatter_alias_cache = {}21_formatter_filename_cache = []22def _init_formatter_cache():23 if _formatter_alias_cache:24 return25 for cls in get_all_formatters():26 for alias in cls.aliases:27 _formatter_alias_cache[alias] = cls28 for fn in cls.filenames:29 _formatter_filename_cache.append((fn, cls))30def find_formatter_class(name):31 _init_formatter_cache()32 cls = _formatter_alias_cache.get(name, None)33 return cls34def get_formatter_by_name(name, **options):35 _init_formatter_cache()36 cls = _formatter_alias_cache.get(name, None)37 if not cls:38 raise ClassNotFound("No formatter found for name %r" % name)39 return cls(**options)40def get_formatter_for_filename(fn, **options):41 _init_formatter_cache()42 fn = os.path.basename(fn)43 for pattern, cls in _formatter_filename_cache:44 if fnmatch.fnmatch(fn, pattern):45 return cls(**options)46 raise ClassNotFound("No formatter found for file name %r" % fn)47def get_all_formatters():48 """Return a generator for all formatters."""49 for formatter in FORMATTERS:50 yield formatter51 for _, formatter in find_plugin_formatters():...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1import { formatter } from 'storybook-root-decorator';2import { storiesOf } from '@storybook/react';3storiesOf('Button', module)4 .addDecorator(formatter)5 .add('with text', () => <Button>Hello Button</Button>)6 .add('with some emoji', () => (7 ));8This package works with the [storybook-addon-jsx](

Full Screen

Using AI Code Generation

copy

Full Screen

1import { formatter } from 'storybook-root-decorator';2import { addDecorator } from '@storybook/react';3import { withInfo } from '@storybook/addon-info';4import { withKnobs } from '@storybook/addon-knobs';5import { configure, setAddon } from '@storybook/react';6import JSXAddon from 'storybook-addon-jsx';7import rootDecorator from 'storybook-root-decorator';8import { setOptions } from '@storybook/addon-options';9import { setDefaults } from '@storybook/addon-info';10import { setDefaults } from '@storybook/addon-info';11import { setDefaults } from '@storybook/addon-info';12import { setDefaults } from '@storybook/addon-info';13import { setDefaults } from '@storybook/addon-info';14import { setDefaults } from '@storybook/addon-info';15import { setDefaults } from '@storybook/addon-info';16import { setDefaults } from '@storybook/addon-info';17import { setDefaults } from '@storybook/addon-info';18import { addDecorator } from '@storybook/react';19import { withInfo } from '@storybook/addon-info';

Full Screen

Using AI Code Generation

copy

Full Screen

1import { formatter } from 'storybook-root-decorator';2import { rootDecorator } from 'storybook-root-decorator';3export default {4};5export default {6};7import { addDecorator } from '@storybook/react';8import { rootDecorator } from 'storybook-root-decorator';9addDecorator(rootDecorator);10import { addDecorator } from '@storybook/react-native';11import { rootDecorator } from 'storybook-root-decorator';12addDecorator(rootDecorator);13import { addDecorator } from '@storybook/react';14import { rootDecorator } from 'storybook-root-decorator';15import { ThemeProvider } from 'styled-components';16import theme from '../src/theme';17addDecorator(rootDecorator);18addDecorator(story => <ThemeProvider theme={theme}>{story()}</ThemeProvider>);19import { addDecorator } from '@storybook/react';20import { rootDecorator } from 'storybook-root-decorator';21import { ThemeProvider } from 'emotion-theming';22import theme from '../src/theme';23addDecorator(rootDecorator);24addDecorator(story => <ThemeProvider theme={theme}>{story()}</ThemeProvider>);25import { addDecorator } from '@storybook/react';26import { rootDecorator } from 'storybook-root-decorator';27import { ThemeProvider } from '@material-ui/core/styles';28import theme from '../src/theme';29addDecorator(rootDecorator);30addDecorator(story => <ThemeProvider theme={theme}>{story()}</ThemeProvider>);31## Usage with Material UI (React Native)32import { addDecorator } from '@storybook/react-native';33import { root

Full Screen

Using AI Code Generation

copy

Full Screen

1import { formatter } from 'storybook-root-decorator';2import { storiesOf } from '@storybook/react';3import { withKnobs, text } from '@storybook/addon-knobs';4storiesOf('Test', module)5 .addDecorator(withKnobs)6 .addDecorator(formatter)7 .add('with text', () => <div>{text('text', 'Hello World')}</div>);8import { storiesOf } from '@storybook/react';9import { withThemeProvider } from 'storybook-root-decorator';10storiesOf('Test', module)11 .addDecorator(withThemeProvider)12 .add('with text', () => <div>Hello World</div>);13import { storiesOf } from '@storybook/react';14import { withRouter } from 'storybook-root-decorator';15storiesOf('Test', module)16 .addDecorator(withRouter)17 .add('with text', () => <div>Hello World</div>);18import { storiesOf } from '@storybook/react';19import { withRedux } from 'storybook-root-decorator';20storiesOf('Test', module)21 .addDecorator(withRedux)22 .add('with text', () => <div>Hello World</div>);23import { storiesOf } from '@storybook/react';24import { withRoot } from 'storybook-root-decorator';25storiesOf('Test', module)26 .addDecorator(withRoot)27 .add('with text', () => <div>Hello World</div>);

Full Screen

Using AI Code Generation

copy

Full Screen

1import { formatter } from 'storybook-root-decorator';2import { addDecorator } from '@storybook/react';3import { withInfo } from '@storybook/addon-info';4import { withKnobs } from '@storybook/addon-knobs';5import { withOptions } from '@storybook/addon-options';6import { withNotes } from '@storybook/addon-notes';7import { withA11y } from '@storybook/addon-a11y';8import { withViewport } from '@storybook/addon-viewport';9import { withConsole } from '@storybook/addon-console';10import { withBackgrounds } from '@storybook/addon-backgrounds';11import { withTests } from '@storybook/addon-jest';12import { withLinks } from '@storybook/addon-links';13import { withGraphQL } from 'storybook-addon-graphql';14import { withPropsTable } from 'storybook-addon-react-docgen';15import { withTests } from '@storybook/addon-jest';16import { withTests } from '@storybook/addon-jest';17import { withTests } from '@storybook/addon-jest';18import { withTests } from '@storybook/addon-jest';19import { withTests } from '@storybook/addon-jest';

Full Screen

Using AI Code Generation

copy

Full Screen

1import { formatter } from 'storybook-root-decorator';2storiesOf('MyComponent', module)3 .addDecorator(formatter)4 .add('default', () => <MyComponent />)5import { addDecorator } from '@storybook/react';6import { formatter } from 'storybook-root-decorator';7addDecorator(formatter);8import { storiesOf } from '@storybook/react';9storiesOf('MyComponent', module).add('default', () => <MyComponent />);10import { addDecorator } from '@storybook/react';11import { formatter } from 'storybook-root-decorator';12addDecorator(formatter);13import { Story } from '@storybook/react';14export const Default = () => <MyComponent />;15export default {16};17import { addDecorator } from '@storybook/react';18import { formatter } from 'storybook-root-decorator';19addDecorator(formatter);20import { Story } from '@storybook/react';21export const Default: Story = () => <MyComponent />;22export default {23};24import { addDecorator } from '@storybook/react';25import { formatter } from 'storybook-root-decorator';26addDecorator(formatter);27import { Meta, Story } from '@storybook/addon-docs/blocks';28import MyComponent from './test';29<Meta title="MyComponent" component={MyComponent} />

Full Screen

Using AI Code Generation

copy

Full Screen

1import { formatter } from 'storybook-root-decorator';2addDecorator(formatter);3addDecorator(formatter({4 boxShadow: '0 2px 8px rgba(0, 0, 0, 0.15)',5}));6| boxShadow | string | 0 2px 8px rgba(0, 0, 0, 0.15) | The box shadow of the story |7MIT © [kamleshchandnani](

Full Screen

Using AI Code Generation

copy

Full Screen

1import { formatter } from 'storybook-root-decorator';2const FormattedComponent = formatter(FormComponent, { label: 'Form' });3import { FormattedComponent } from './test';4storiesOf('Form', module).add('Default', () => <FormattedComponent />);5import initStoryshots from '@storybook/addon-storyshots';6import { formatter } from 'storybook-root-decorator';7initStoryshots({ storyKindRegex: /^FormattedComponent$/, renderer: formatter });8formatter(Component, options);9| options | Object | No | {} | Options to be passed to root decorator |10| theme | Object | {} | Theme for the root decorator |11MIT © [Siddharth Kshetrapal](

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run storybook-root automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful