From 6df1a052514aa652af9eeb91fd2b8ecbfd4c6121 Mon Sep 17 00:00:00 2001 From: Jon Samwell Date: Sun, 22 Sep 2019 11:57:38 +1000 Subject: [PATCH] feat(flutter): ensured flutter build warnings are not writted to stderr and cause test run to fail --- CHANGELOG.md | 4 ++++ README.md | 7 ++++++- example/report.json | 2 +- lib/src/flutter/flutter_run_process_handler.dart | 12 ++++++++++-- pubspec.lock | 2 +- pubspec.yaml | 4 ++-- 6 files changed, 24 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3b693f1..ebef769 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## [1.1.1] - 20/09/2019 +* Updated to latest Gherkin library +* Ensured Gradle build warnings do not output to `stderr` and cause tests runs to fail just because of build warnings + ## [1.1.0] - 20/09/2019 * Updated to latest Gherkin lib which implements langauges - features can now be written in different languages / dialects! See https://cucumber.io/docs/gherkin/reference/#overview for supported dialects. * Ensured the hook to take a screenshot `AttachScreenhotOnFailedStepHook` works for steps that error or timeout as well as fail. diff --git a/README.md b/README.md index 20ecda2..40dc385 100644 --- a/README.md +++ b/README.md @@ -631,11 +631,16 @@ import 'package:gherkin/gherkin.dart'; class GivenIAddTheUsers extends Given1 { @override Future executeStep(Table dataTable) async { - // TODO: implement executeStep for (var row in dataTable.rows) { // do something with row row.columns.forEach((columnValue) => print(columnValue)); } + + // or get the table as a map (column values keyed by the header) + final columns = dataTable.asMap(); + final personOne = columns.elementAt(0); + final personOneName = personOne["Firstname"]; + print('Name of first user: `$personOneName`'); } @override diff --git a/example/report.json b/example/report.json index 5ed2f3d..27af685 100644 --- a/example/report.json +++ b/example/report.json @@ -1 +1 @@ -[{"description":"","id":"counter","keyword":"Feature","line":1,"name":"Counter","uri":".\\test_driver\\features\\counter_increases.feature","elements":[{"keyword":"Scenario","type":"scenario","id":"counter;counter increases when the button is pressed","name":"Counter increases when the button is pressed","description":"","line":5,"tags":[{"line":4,"name":"@smoke"}],"steps":[{"keyword":"Given ","name":"I pick the colour red","line":6,"match":{"location":".\\test_driver\\features\\counter_increases.feature:6"},"result":{"status":"passed","duration":1000000}},{"keyword":"Given ","name":"I expect the \"counter\" to be \"0\"","line":7,"match":{"location":".\\test_driver\\features\\counter_increases.feature:7"},"result":{"status":"passed","duration":26000000}},{"keyword":"When ","name":"I tap the \"increment\" button 10 times","line":8,"match":{"location":".\\test_driver\\features\\counter_increases.feature:8"},"result":{"status":"passed","duration":2290000000}},{"keyword":"Then ","name":"I expect the \"counter\" to be \"10\"","line":9,"match":{"location":".\\test_driver\\features\\counter_increases.feature:9"},"result":{"status":"passed","duration":6000000}}]}]},{"description":"","id":"startup","keyword":"Feature","line":1,"name":"Startup","uri":".\\test_driver\\features\\app_restart.feature","elements":[{"keyword":"Scenario","type":"scenario","id":"startup;counter should reset when app is restarted","name":"counter should reset when app is restarted","description":"","line":3,"steps":[{"keyword":"Given ","name":"I expect the \"counter\" to be \"0\"","line":4,"match":{"location":".\\test_driver\\features\\app_restart.feature:4"},"result":{"status":"passed","duration":18000000}},{"keyword":"When ","name":"I tap the \"increment\" button","line":5,"match":{"location":".\\test_driver\\features\\app_restart.feature:5"},"result":{"status":"passed","duration":289000000}},{"keyword":"Then ","name":"I expect the \"counter\" to be \"1\"","line":6,"match":{"location":".\\test_driver\\features\\app_restart.feature:6"},"result":{"status":"passed","duration":7000000}},{"keyword":"When ","name":"I restart the app","line":7,"match":{"location":".\\test_driver\\features\\app_restart.feature:7"},"result":{"status":"passed","duration":2099000000}},{"keyword":"Then ","name":"I expect the \"counter\" to be \"0\"","line":8,"match":{"location":".\\test_driver\\features\\app_restart.feature:8"},"result":{"status":"passed","duration":15000000}}]}]},{"description":"","id":"counter","keyword":"Feature","line":2,"name":"Counter","uri":".\\test_driver\\features\\counter_increases_french.feature","elements":[{"keyword":"Scenario","type":"scenario","id":"counter;counter increases when the button is pressed","name":"Counter increases when the button is pressed","description":"","line":6,"tags":[{"line":5,"name":"@smoke"}],"steps":[{"keyword":"Etant ","name":"donné que I pick the colour red","line":7,"match":{"location":".\\test_driver\\features\\counter_increases_french.feature:7"},"result":{"status":"passed","duration":0}},{"keyword":"Et ","name":"I expect the \"counter\" to be \"0\"","line":8,"match":{"location":".\\test_driver\\features\\counter_increases_french.feature:8"},"result":{"status":"passed","duration":15000000}},{"keyword":"Quand ","name":"I tap the \"increment\" button 10 times","line":9,"match":{"location":".\\test_driver\\features\\counter_increases_french.feature:9"},"result":{"status":"passed","duration":2309000000}},{"keyword":"Alors ","name":"I expect the \"counter\" to be \"10\"","line":10,"match":{"location":".\\test_driver\\features\\counter_increases_french.feature:10"},"result":{"status":"passed","duration":8000000}}]}]},{"description":"","id":"counter","keyword":"Feature","line":1,"name":"Counter","uri":".\\test_driver\\features\\sub-features\\counter_increases.feature","elements":[{"keyword":"Scenario","type":"scenario","id":"counter;counter increases when the button is pressed","name":"Counter increases when the button is pressed","description":"","line":5,"tags":[{"line":4,"name":"@perf"}],"steps":[{"keyword":"Given ","name":"I expect the \"counter\" to be \"0\"","line":6,"match":{"location":".\\test_driver\\features\\sub-features\\counter_increases.feature:6"},"result":{"status":"passed","duration":16000000}},{"keyword":"When ","name":"I tap the \"increment\" button 20 times","line":7,"match":{"location":".\\test_driver\\features\\sub-features\\counter_increases.feature:7"},"result":{"status":"passed","duration":4486000000}},{"keyword":"Then ","name":"I expect the \"counter\" to be \"20\"","line":8,"match":{"location":".\\test_driver\\features\\sub-features\\counter_increases.feature:8"},"result":{"status":"passed","duration":5000000}}]}]},{"description":"","id":"counter","keyword":"Feature","line":1,"name":"Counter","uri":".\\test_driver\\features\\counter_increases_scenerio_outline_example.feature","elements":[{"keyword":"Scenario Outline","type":"scenario","id":"counter;null (example 1)","name":"null (Example 1)","description":"","line":5,"tags":[{"line":4,"name":"@scenario_outline"}],"steps":[{"keyword":"Given ","name":"I pick the colour red","line":6,"match":{"location":".\\test_driver\\features\\counter_increases_scenerio_outline_example.feature:6"},"result":{"status":"passed","duration":0}},{"keyword":"Given ","name":"I expect the \"counter\" to be \"0\"","line":7,"match":{"location":".\\test_driver\\features\\counter_increases_scenerio_outline_example.feature:7"},"result":{"status":"passed","duration":18000000}},{"keyword":"When ","name":"I tap the \"increment\" button 1 times","line":8,"match":{"location":".\\test_driver\\features\\counter_increases_scenerio_outline_example.feature:8"},"result":{"status":"passed","duration":281000000}},{"keyword":"Then ","name":"I expect the \"counter\" to be \"1\"","line":9,"match":{"location":".\\test_driver\\features\\counter_increases_scenerio_outline_example.feature:9"},"result":{"status":"passed","duration":5000000}}]},{"keyword":"Scenario Outline","type":"scenario","id":"counter;null (example 2)","name":"null (Example 2)","description":"","line":5,"tags":[{"line":4,"name":"@scenario_outline"}],"steps":[{"keyword":"Given ","name":"I pick the colour red","line":6,"match":{"location":".\\test_driver\\features\\counter_increases_scenerio_outline_example.feature:6"},"result":{"status":"passed","duration":0}},{"keyword":"Given ","name":"I expect the \"counter\" to be \"0\"","line":7,"match":{"location":".\\test_driver\\features\\counter_increases_scenerio_outline_example.feature:7"},"result":{"status":"passed","duration":15000000}},{"keyword":"When ","name":"I tap the \"increment\" button 2 times","line":8,"match":{"location":".\\test_driver\\features\\counter_increases_scenerio_outline_example.feature:8"},"result":{"status":"passed","duration":506000000}},{"keyword":"Then ","name":"I expect the \"counter\" to be \"2\"","line":9,"match":{"location":".\\test_driver\\features\\counter_increases_scenerio_outline_example.feature:9"},"result":{"status":"passed","duration":7000000}}]},{"keyword":"Scenario Outline","type":"scenario","id":"counter;null (example 3)","name":"null (Example 3)","description":"","line":5,"tags":[{"line":4,"name":"@scenario_outline"}],"steps":[{"keyword":"Given ","name":"I pick the colour red","line":6,"match":{"location":".\\test_driver\\features\\counter_increases_scenerio_outline_example.feature:6"},"result":{"status":"passed","duration":0}},{"keyword":"Given ","name":"I expect the \"counter\" to be \"0\"","line":7,"match":{"location":".\\test_driver\\features\\counter_increases_scenerio_outline_example.feature:7"},"result":{"status":"passed","duration":15000000}},{"keyword":"When ","name":"I tap the \"increment\" button 5 times","line":8,"match":{"location":".\\test_driver\\features\\counter_increases_scenerio_outline_example.feature:8"},"result":{"status":"passed","duration":1182000000}},{"keyword":"Then ","name":"I expect the \"counter\" to be \"5\"","line":9,"match":{"location":".\\test_driver\\features\\counter_increases_scenerio_outline_example.feature:9"},"result":{"status":"passed","duration":5000000}}]},{"keyword":"Scenario Outline","type":"scenario","id":"counter;null (example 4)","name":"null (Example 4)","description":"","line":5,"tags":[{"line":4,"name":"@scenario_outline"}],"steps":[{"keyword":"Given ","name":"I pick the colour red","line":6,"match":{"location":".\\test_driver\\features\\counter_increases_scenerio_outline_example.feature:6"},"result":{"status":"passed","duration":8000000}},{"keyword":"Given ","name":"I expect the \"counter\" to be \"0\"","line":7,"match":{"location":".\\test_driver\\features\\counter_increases_scenerio_outline_example.feature:7"},"result":{"status":"passed","duration":16000000}},{"keyword":"When ","name":"I tap the \"increment\" button 10 times","line":8,"match":{"location":".\\test_driver\\features\\counter_increases_scenerio_outline_example.feature:8"},"result":{"status":"passed","duration":2286000000}},{"keyword":"Then ","name":"I expect the \"counter\" to be \"10\"","line":9,"match":{"location":".\\test_driver\\features\\counter_increases_scenerio_outline_example.feature:9"},"result":{"status":"passed","duration":8000000}}]}]},{"description":"","id":"drawer","keyword":"Feature","line":1,"name":"Drawer","uri":".\\test_driver\\features\\drawer.feature","elements":[{"keyword":"Scenario","type":"scenario","id":"drawer;should open the drawer","name":"should open the drawer","description":"","line":3,"steps":[{"keyword":"Given ","name":"I open the drawer","line":4,"match":{"location":".\\test_driver\\features\\drawer.feature:4"},"result":{"status":"passed","duration":1408000000}},{"keyword":"Given ","name":"I close the drawer","line":5,"match":{"location":".\\test_driver\\features\\drawer.feature:5"},"result":{"status":"passed","duration":372000000}}]}]},{"description":"","id":"custom parameter example","keyword":"Feature","line":1,"name":"Custom Parameter Example","uri":".\\test_driver\\features\\custom_parameter_example.feature","elements":[{"keyword":"Scenario","type":"scenario","id":"custom parameter example;custom colour parameter","name":"Custom colour parameter","description":"","line":4,"steps":[{"keyword":"Given ","name":"I pick the colour red","line":5,"match":{"location":".\\test_driver\\features\\custom_parameter_example.feature:5"},"result":{"status":"passed","duration":0}},{"keyword":"Given ","name":"I pick the colour green","line":6,"match":{"location":".\\test_driver\\features\\custom_parameter_example.feature:6"},"result":{"status":"passed","duration":0}},{"keyword":"Given ","name":"I pick the colour blue","line":7,"match":{"location":".\\test_driver\\features\\custom_parameter_example.feature:7"},"result":{"status":"passed","duration":0}}]}]},{"description":"","id":"startup","keyword":"Feature","line":1,"name":"Startup","uri":".\\test_driver\\features\\counter.feature","elements":[{"keyword":"Scenario","type":"scenario","id":"startup;should increment counter","name":"should increment counter","description":"","line":3,"steps":[{"keyword":"Given ","name":"I expect the \"counter\" to be \"0\"","line":4,"match":{"location":".\\test_driver\\features\\counter.feature:4"},"result":{"status":"passed","duration":14000000}},{"keyword":"When ","name":"I tap the \"increment\" button","line":5,"match":{"location":".\\test_driver\\features\\counter.feature:5"},"result":{"status":"passed","duration":285000000}},{"keyword":"And ","name":"I tap the \"increment\" button","line":6,"match":{"location":".\\test_driver\\features\\counter.feature:6"},"result":{"status":"passed","duration":222000000}},{"keyword":"Then ","name":"I expect the \"counter\" to be \"2\"","line":7,"match":{"location":".\\test_driver\\features\\counter.feature:7"},"result":{"status":"passed","duration":6000000}}]},{"keyword":"Scenario","type":"scenario","id":"startup;counter should reset when app is restarted","name":"counter should reset when app is restarted","description":"","line":9,"steps":[{"keyword":"Given ","name":"I expect the \"counter\" to be \"0\"","line":10,"match":{"location":".\\test_driver\\features\\counter.feature:10"},"result":{"status":"passed","duration":17000000}},{"keyword":"When ","name":"I tap the \"increment\" button","line":11,"match":{"location":".\\test_driver\\features\\counter.feature:11"},"result":{"status":"passed","duration":281000000}},{"keyword":"Then ","name":"I expect the \"counter\" to be \"1\"","line":12,"match":{"location":".\\test_driver\\features\\counter.feature:12"},"result":{"status":"passed","duration":5000000}},{"keyword":"When ","name":"I restart the app","line":13,"match":{"location":".\\test_driver\\features\\counter.feature:13"},"result":{"status":"passed","duration":2058000000}},{"keyword":"Then ","name":"I expect the \"counter\" to be \"0\"","line":14,"match":{"location":".\\test_driver\\features\\counter.feature:14"},"result":{"status":"passed","duration":16000000}}]}]}] \ No newline at end of file +[{"description":"","id":"counter","keyword":"Feature","line":1,"name":"Counter","uri":".\\test_driver\\features\\counter_increases.feature","elements":[{"keyword":"Scenario","type":"scenario","id":"counter;counter increases when the button is pressed","name":"Counter increases when the button is pressed","description":"","line":5,"tags":[{"line":4,"name":"@smoke"}],"steps":[{"keyword":"Given ","name":"I pick the colour red","line":6,"match":{"location":".\\test_driver\\features\\counter_increases.feature:6"},"result":{"status":"passed","duration":10000000}},{"keyword":"Given ","name":"I expect the \"counter\" to be \"0\"","line":7,"match":{"location":".\\test_driver\\features\\counter_increases.feature:7"},"result":{"status":"passed","duration":22000000}},{"keyword":"When ","name":"I tap the \"increment\" button 10 times","line":8,"match":{"location":".\\test_driver\\features\\counter_increases.feature:8"},"result":{"status":"passed","duration":2369000000}},{"keyword":"Then ","name":"I expect the \"counter\" to be \"10\"","line":9,"match":{"location":".\\test_driver\\features\\counter_increases.feature:9"},"result":{"status":"passed","duration":7000000}}]}]},{"description":"","id":"counter","keyword":"Feature","line":1,"name":"Counter","uri":".\\test_driver\\features\\sub-features\\counter_increases.feature","elements":[{"keyword":"Scenario","type":"scenario","id":"counter;counter increases when the button is pressed","name":"Counter increases when the button is pressed","description":"","line":5,"tags":[{"line":4,"name":"@perf"}],"steps":[{"keyword":"Given ","name":"I expect the \"counter\" to be \"0\"","line":6,"match":{"location":".\\test_driver\\features\\sub-features\\counter_increases.feature:6"},"result":{"status":"passed","duration":16000000}},{"keyword":"When ","name":"I tap the \"increment\" button 20 times","line":7,"match":{"location":".\\test_driver\\features\\sub-features\\counter_increases.feature:7"},"result":{"status":"passed","duration":4610000000}},{"keyword":"Then ","name":"I expect the \"counter\" to be \"20\"","line":8,"match":{"location":".\\test_driver\\features\\sub-features\\counter_increases.feature:8"},"result":{"status":"passed","duration":8000000}}]}]},{"description":"","id":"startup","keyword":"Feature","line":1,"name":"Startup","uri":".\\test_driver\\features\\app_restart.feature","elements":[{"keyword":"Scenario","type":"scenario","id":"startup;counter should reset when app is restarted","name":"counter should reset when app is restarted","description":"","line":3,"steps":[{"keyword":"Given ","name":"I expect the \"counter\" to be \"0\"","line":4,"match":{"location":".\\test_driver\\features\\app_restart.feature:4"},"result":{"status":"passed","duration":16000000}},{"keyword":"When ","name":"I tap the \"increment\" button","line":5,"match":{"location":".\\test_driver\\features\\app_restart.feature:5"},"result":{"status":"passed","duration":289000000}},{"keyword":"Then ","name":"I expect the \"counter\" to be \"1\"","line":6,"match":{"location":".\\test_driver\\features\\app_restart.feature:6"},"result":{"status":"passed","duration":7000000}},{"keyword":"When ","name":"I restart the app","line":7,"match":{"location":".\\test_driver\\features\\app_restart.feature:7"},"result":{"status":"passed","duration":2099000000}},{"keyword":"Then ","name":"I expect the \"counter\" to be \"0\"","line":8,"match":{"location":".\\test_driver\\features\\app_restart.feature:8"},"result":{"status":"passed","duration":19000000}}]}]},{"description":"","id":"counter","keyword":"Feature","line":2,"name":"Counter","uri":".\\test_driver\\features\\counter_increases_french.feature","elements":[{"keyword":"Scenario","type":"scenario","id":"counter;counter increases when the button is pressed","name":"Counter increases when the button is pressed","description":"","line":6,"tags":[{"line":5,"name":"@smoke"}],"steps":[{"keyword":"Etant ","name":"donné que I pick the colour red","line":7,"match":{"location":".\\test_driver\\features\\counter_increases_french.feature:7"},"result":{"status":"passed","duration":0}},{"keyword":"Et ","name":"I expect the \"counter\" to be \"0\"","line":8,"match":{"location":".\\test_driver\\features\\counter_increases_french.feature:8"},"result":{"status":"passed","duration":16000000}},{"keyword":"Quand ","name":"I tap the \"increment\" button 10 times","line":9,"match":{"location":".\\test_driver\\features\\counter_increases_french.feature:9"},"result":{"status":"passed","duration":2322000000}},{"keyword":"Alors ","name":"I expect the \"counter\" to be \"10\"","line":10,"match":{"location":".\\test_driver\\features\\counter_increases_french.feature:10"},"result":{"status":"passed","duration":6000000}}]}]},{"description":"","id":"counter","keyword":"Feature","line":1,"name":"Counter","uri":".\\test_driver\\features\\counter_increases_scenerio_outline_example.feature","elements":[{"keyword":"Scenario Outline","type":"scenario","id":"counter;null (example 1)","name":"null (Example 1)","description":"","line":5,"tags":[{"line":4,"name":"@scenario_outline"}],"steps":[{"keyword":"Given ","name":"I pick the colour red","line":6,"match":{"location":".\\test_driver\\features\\counter_increases_scenerio_outline_example.feature:6"},"result":{"status":"passed","duration":0}},{"keyword":"Given ","name":"I expect the \"counter\" to be \"0\"","line":7,"match":{"location":".\\test_driver\\features\\counter_increases_scenerio_outline_example.feature:7"},"result":{"status":"passed","duration":18000000}},{"keyword":"When ","name":"I tap the \"increment\" button 1 times","line":8,"match":{"location":".\\test_driver\\features\\counter_increases_scenerio_outline_example.feature:8"},"result":{"status":"passed","duration":301000000}},{"keyword":"Then ","name":"I expect the \"counter\" to be \"1\"","line":9,"match":{"location":".\\test_driver\\features\\counter_increases_scenerio_outline_example.feature:9"},"result":{"status":"passed","duration":5000000}}]},{"keyword":"Scenario Outline","type":"scenario","id":"counter;null (example 2)","name":"null (Example 2)","description":"","line":5,"tags":[{"line":4,"name":"@scenario_outline"}],"steps":[{"keyword":"Given ","name":"I pick the colour red","line":6,"match":{"location":".\\test_driver\\features\\counter_increases_scenerio_outline_example.feature:6"},"result":{"status":"passed","duration":0}},{"keyword":"Given ","name":"I expect the \"counter\" to be \"0\"","line":7,"match":{"location":".\\test_driver\\features\\counter_increases_scenerio_outline_example.feature:7"},"result":{"status":"passed","duration":15000000}},{"keyword":"When ","name":"I tap the \"increment\" button 2 times","line":8,"match":{"location":".\\test_driver\\features\\counter_increases_scenerio_outline_example.feature:8"},"result":{"status":"passed","duration":512000000}},{"keyword":"Then ","name":"I expect the \"counter\" to be \"2\"","line":9,"match":{"location":".\\test_driver\\features\\counter_increases_scenerio_outline_example.feature:9"},"result":{"status":"passed","duration":8000000}}]},{"keyword":"Scenario Outline","type":"scenario","id":"counter;null (example 3)","name":"null (Example 3)","description":"","line":5,"tags":[{"line":4,"name":"@scenario_outline"}],"steps":[{"keyword":"Given ","name":"I pick the colour red","line":6,"match":{"location":".\\test_driver\\features\\counter_increases_scenerio_outline_example.feature:6"},"result":{"status":"passed","duration":0}},{"keyword":"Given ","name":"I expect the \"counter\" to be \"0\"","line":7,"match":{"location":".\\test_driver\\features\\counter_increases_scenerio_outline_example.feature:7"},"result":{"status":"passed","duration":15000000}},{"keyword":"When ","name":"I tap the \"increment\" button 5 times","line":8,"match":{"location":".\\test_driver\\features\\counter_increases_scenerio_outline_example.feature:8"},"result":{"status":"passed","duration":1200000000}},{"keyword":"Then ","name":"I expect the \"counter\" to be \"5\"","line":9,"match":{"location":".\\test_driver\\features\\counter_increases_scenerio_outline_example.feature:9"},"result":{"status":"passed","duration":7000000}}]},{"keyword":"Scenario Outline","type":"scenario","id":"counter;null (example 4)","name":"null (Example 4)","description":"","line":5,"tags":[{"line":4,"name":"@scenario_outline"}],"steps":[{"keyword":"Given ","name":"I pick the colour red","line":6,"match":{"location":".\\test_driver\\features\\counter_increases_scenerio_outline_example.feature:6"},"result":{"status":"passed","duration":0}},{"keyword":"Given ","name":"I expect the \"counter\" to be \"0\"","line":7,"match":{"location":".\\test_driver\\features\\counter_increases_scenerio_outline_example.feature:7"},"result":{"status":"passed","duration":16000000}},{"keyword":"When ","name":"I tap the \"increment\" button 10 times","line":8,"match":{"location":".\\test_driver\\features\\counter_increases_scenerio_outline_example.feature:8"},"result":{"status":"passed","duration":2328000000}},{"keyword":"Then ","name":"I expect the \"counter\" to be \"10\"","line":9,"match":{"location":".\\test_driver\\features\\counter_increases_scenerio_outline_example.feature:9"},"result":{"status":"passed","duration":9000000}}]}]},{"description":"","id":"startup","keyword":"Feature","line":1,"name":"Startup","uri":".\\test_driver\\features\\counter.feature","elements":[{"keyword":"Scenario","type":"scenario","id":"startup;should increment counter","name":"should increment counter","description":"","line":3,"steps":[{"keyword":"Given ","name":"I expect the \"counter\" to be \"0\"","line":4,"match":{"location":".\\test_driver\\features\\counter.feature:4"},"result":{"status":"passed","duration":17000000}},{"keyword":"When ","name":"I tap the \"increment\" button","line":5,"match":{"location":".\\test_driver\\features\\counter.feature:5"},"result":{"status":"passed","duration":297000000}},{"keyword":"And ","name":"I tap the \"increment\" button","line":6,"match":{"location":".\\test_driver\\features\\counter.feature:6"},"result":{"status":"passed","duration":227000000}},{"keyword":"Then ","name":"I expect the \"counter\" to be \"2\"","line":7,"match":{"location":".\\test_driver\\features\\counter.feature:7"},"result":{"status":"passed","duration":7000000}}]},{"keyword":"Scenario","type":"scenario","id":"startup;counter should reset when app is restarted","name":"counter should reset when app is restarted","description":"","line":9,"steps":[{"keyword":"Given ","name":"I expect the \"counter\" to be \"0\"","line":10,"match":{"location":".\\test_driver\\features\\counter.feature:10"},"result":{"status":"passed","duration":19000000}},{"keyword":"When ","name":"I tap the \"increment\" button","line":11,"match":{"location":".\\test_driver\\features\\counter.feature:11"},"result":{"status":"passed","duration":282000000}},{"keyword":"Then ","name":"I expect the \"counter\" to be \"1\"","line":12,"match":{"location":".\\test_driver\\features\\counter.feature:12"},"result":{"status":"passed","duration":8000000}},{"keyword":"When ","name":"I restart the app","line":13,"match":{"location":".\\test_driver\\features\\counter.feature:13"},"result":{"status":"passed","duration":2087000000}},{"keyword":"Then ","name":"I expect the \"counter\" to be \"0\"","line":14,"match":{"location":".\\test_driver\\features\\counter.feature:14"},"result":{"status":"passed","duration":15000000}}]}]},{"description":"","id":"drawer","keyword":"Feature","line":1,"name":"Drawer","uri":".\\test_driver\\features\\drawer.feature","elements":[{"keyword":"Scenario","type":"scenario","id":"drawer;should open the drawer","name":"should open the drawer","description":"","line":3,"steps":[{"keyword":"Given ","name":"I open the drawer","line":4,"match":{"location":".\\test_driver\\features\\drawer.feature:4"},"result":{"status":"passed","duration":1420000000}},{"keyword":"Given ","name":"I close the drawer","line":5,"match":{"location":".\\test_driver\\features\\drawer.feature:5"},"result":{"status":"passed","duration":377000000}}]}]},{"description":"","id":"custom parameter example","keyword":"Feature","line":1,"name":"Custom Parameter Example","uri":".\\test_driver\\features\\custom_parameter_example.feature","elements":[{"keyword":"Scenario","type":"scenario","id":"custom parameter example;custom colour parameter","name":"Custom colour parameter","description":"","line":4,"steps":[{"keyword":"Given ","name":"I pick the colour red","line":5,"match":{"location":".\\test_driver\\features\\custom_parameter_example.feature:5"},"result":{"status":"passed","duration":0}},{"keyword":"Given ","name":"I pick the colour green","line":6,"match":{"location":".\\test_driver\\features\\custom_parameter_example.feature:6"},"result":{"status":"passed","duration":0}},{"keyword":"Given ","name":"I pick the colour blue","line":7,"match":{"location":".\\test_driver\\features\\custom_parameter_example.feature:7"},"result":{"status":"passed","duration":0}}]}]}] \ No newline at end of file diff --git a/lib/src/flutter/flutter_run_process_handler.dart b/lib/src/flutter/flutter_run_process_handler.dart index 82f1f8e..aeb1af2 100644 --- a/lib/src/flutter/flutter_run_process_handler.dart +++ b/lib/src/flutter/flutter_run_process_handler.dart @@ -5,6 +5,7 @@ import 'package:gherkin/gherkin.dart'; class FlutterRunProcessHandler extends ProcessHandler { static const String FAIL_COLOR = "\u001b[33;31m"; // red + static const String WARN_COLOR = "\u001b[33;10m"; // yellow static const String RESET_COLOR = "\u001b[33;0m"; static RegExp _observatoryDebuggerUriRegex = RegExp( @@ -72,8 +73,15 @@ class FlutterRunProcessHandler extends ProcessHandler { _runningProcess.stdout.transform(utf8.decoder).asBroadcastStream(); _openSubscriptions.add(_runningProcess.stderr.listen((events) { - stderr.writeln( - "${FAIL_COLOR}Flutter run error: ${String.fromCharCodes(events)}$RESET_COLOR"); + final line = String.fromCharCodes(events).trim(); + if (line.startsWith('Note:')) { + // This is most likely a depricated api usage warnings (from Gradle) and should not + // cause the test run to fail. + stdout + .writeln("${WARN_COLOR}Flutter build warning: ${line}$RESET_COLOR"); + } else { + stderr.writeln("${FAIL_COLOR}Flutter build error: ${line}$RESET_COLOR"); + } })); } diff --git a/pubspec.lock b/pubspec.lock index e9936a4..a304112 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -104,7 +104,7 @@ packages: name: gherkin url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.1.1" glob: dependency: "direct main" description: diff --git a/pubspec.yaml b/pubspec.yaml index 9208f41..7036300 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_gherkin description: A Gherkin / Cucumber parser and test runner for Dart and Flutter -version: 1.1.0 +version: 1.1.1 author: Jon Samwell homepage: https://github.com/jonsamwell/flutter_gherkin @@ -16,7 +16,7 @@ dependencies: sdk: flutter glob: ^1.1.7 meta: ">=1.1.6 <2.0.0" - gherkin: ^1.1.0 + gherkin: ^1.1.1 dev_dependencies: test: ">=1.6.1 <1.7.0"