Overview
Flutter Steps adds step definitions to Webship-js 2.0.x for the markup the platform itself renders, regardless of theme or distribution, so scenarios read as plain sentences instead of CSS selectors. It is a plugin for Webship-js: it ships one file of step definitions you drop into an existing test project, and it composes with the built-in steps rather than duplicating them.
Install
npm install --save-dev @webship-js/flutter-steps
Then add its step file to cucumber.js beside the Webship-js steps:
require: [
'node_modules/webship-js/tests/step-definitions/**/*.js',
'node_modules/@webship-js/flutter-steps/tests/step-definitions/*.js',
'tests/step-definitions/**/*.js',
]
Steps
- Given the app's accessibility tree is on
- When I wait for the app to settle
- Then the app should be on "/validation"
- Then the app should run as WebAssembly
- Then the app should announce "Added to favorites."
- When I tap "Increment"
- When I tap the "Back" button
- When I tap the button in the "Item 5" row
- When I tap the element identified as "favorite-5"
- When I check the "I agree to the terms of service." checkbox
- Then the app should show the "Increment" button
- Then the app's "Elevated" button should be disabled
- Then the app's button in the "Item 5" row should be enabled
- Then the app's "I agree to the terms of service." checkbox should be checked
- Then the app's "Components" tab should be selected
- Then the app should show "You have pushed the button this many times: 1"
- When I enter "quick" in the app's "Enter an adjective" field
- When I clear the app's "Enter a noun" field
- Then the app's "Enter a noun" field should contain "fox"
- Then the app's "Enter a noun" field should be empty
- Then the app's "Enter a noun" field should be shown as invalid
- Then the app's "Enter a noun" field should show the message "Not a valid noun."
- Then the app should show the "Your story" dialog
- Then the app should show no dialog
- When I tap "Done" in the "Your story" dialog
- Then the app's "Your story" dialog should show "The quick developer saw a time"
- When I dismiss the "Your story" dialog
- When I scroll the app until I see "Item 25"
- Then the app should have no unnamed buttons
Every assertion step reads both polarities from one definition: should see and should not see are the same step. Source and issues: github.com/webship/flutter-steps.