Use case StRS-MDOKFSTUDIO-TOOLBAR-003
The reader finds and replaces text in the preview
Readers and editors of a long document want to locate a word or phrase in what they read, see every occurrence, and change it in the document without switching to the text editor, with the rest of the file left as it is.
Use case diagram
How it is split
This use case (StRS) is reached by one path (the coloured line). A path goes from one situation (circle) to the next; each step (pill) is a behaviour (SwRS) with its own tests.
path 1: Find a word and replace it other outcomeone dot = one scenario checked: nominal boundary refusal
Path 1: Find a word and replace it
- The preview page has the focusSwRS-MDOKFSTUDIO-TOOLBAR-009 in the text editor, the key is left to VS CodeSwRS-MDOKFSTUDIO-TOOLBAR-009 · 6 tests the reader presses Cmd+F or Ctrl+F and a find bar opens with its field focused
- The find bar is openSwRS-MDOKFSTUDIO-TOOLBAR-010 the options match case, whole word and regular expression narrow the searchSwRS-MDOKFSTUDIO-TOOLBAR-010 · 9 tests the reader types a query, every match is painted and Enter moves to the next one
- The matches are walkedSwRS-MDOKFSTUDIO-TOOLBAR-012 a match that does not map one-to-one to the source is not replacedSwRS-MDOKFSTUDIO-TOOLBAR-012 while a block editor is open, the replacement is refused with the reasonSwRS-MDOKFSTUDIO-TOOLBAR-012 · 8 tests the reader replaces one or all matches, each in its source span, in one undo step
- The text is replaced in the document
This map has 538 different ways through it in 8 steps or fewer. Instead of testing each one end to end, the 3 behaviours on the map are tested one by one, with 18 scenarios.
Behaviours of this use case
SwRS-MDOKFSTUDIO-TOOLBAR-009Cmd/Ctrl+F opens a find bar over the preview 6 testsSwRS-MDOKFSTUDIO-TOOLBAR-010The find bar paints the matches of the rendered text and walks them 9 testsSwRS-MDOKFSTUDIO-TOOLBAR-012Replace edits only the matched source spans 8 tests
SwRS-MDOKFSTUDIO-TOOLBAR-011The find bar matches case, whole words and regular expressions superseded superseded by SwRS-MDOKFSTUDIO-TOOLBAR-010 Markdown file
SwRS-MDOKFSTUDIO-TOOLBAR-014Replace is unavailable while a block editor is open superseded superseded by SwRS-MDOKFSTUDIO-TOOLBAR-012 Markdown file
SwRS-MDOKFSTUDIO-TOOLBAR-131Replace all announces the matches it will skip superseded superseded by SwRS-MDOKFSTUDIO-TOOLBAR-012 Markdown file
SwRS-MDOKFSTUDIO-TOOLBAR-132The find and replace fields keep their native editing shortcuts superseded superseded by SwRS-MDOKFSTUDIO-TOOLBAR-009 Markdown file