To add a collaborator to this project you will need to use the Relish gem to add the collaborator via a terminal command. Soon you'll be able to also add collaborators here!
More about adding a collaboratorExtended search
- Background
-
- Given
- I open a new edit tab
- Scenarios
-
- Open extended search speedbar
- Open extended search speedbar with initial selection
- Find next with wrap around
- Find next without wrap around
- Find previous with wrap around
- Find previous without wrap around
- Find with regular expression
- Replace and find with no initial selection
- Replace and find with matching initial selection
- Replace and find with initial selection that doesn't match
- Replace and find with initial selection that is after last match
- Replace and find with initial selection that is after last match and no wrap around
- Replace all replaces one
- Replace all replaces two
- Replace all replaces two on the same line
- Replace all replaces overlapping occurences on the same line
- Replace all is a single undo action
- Replace all regex with back-references
- Open extended search speedbar
-
- When
- I replace the contents with "Foo\nBar\nBaz"
- And
- I move the cursor to 0
- And
- I run the command DocumentSearch::ExtendedSearchCommand
- Then
- the DocumentSearch::ExtendedSearch::SearchSpeedbar speedbar should be open
- Open extended search speedbar with initial selection
-
- When
- I replace the contents with "Foo\nBar\nBaz"
- And
- I select from 4 to 7
- And
- I run the command DocumentSearch::ExtendedSearchCommand
- Then
- the DocumentSearch::ExtendedSearch::SearchSpeedbar speedbar should be open
- And
- the "Search" field in the speedbar should have text "Bar"
- When
- I type "Foo" into the "Replace" field in the speedbar
- And
- I choose "Plain" in the "search_type" field in the speedbar
- And
- I check "Wrap Around" in the speedbar
- And
- I press "Replace && Find" in the speedbar
- Then
- the contents should be "Foo\nFoo\nBaz"
- And
- the selected text should be ""
- And
- the selection range should be from 7 to 7
- Find next with wrap around
-
- When
- I replace the contents with "Foo\nBar Foo\nHmm\nBaz"
- And
- I move the cursor to 0
- And
- I run the command DocumentSearch::ExtendedSearchCommand
- And
- I type "Foo" into the "Search" field in the speedbar
- And
- I choose "Plain" in the "search_type" field in the speedbar
- And
- I check "Wrap Around" in the speedbar
- And
- I press "Next" in the speedbar
- Then
- the contents should be "Foo\nBar Foo\nHmm\nBaz"
- And
- the selected text should be "Foo"
- And
- the selection range should be from 0 to 3
- When
- I press "Next" in the speedbar
- Then
- the contents should be "Foo\nBar Foo\nHmm\nBaz"
- And
- the selected text should be "Foo"
- And
- the selection range should be from 8 to 11
- When
- I press "Next" in the speedbar
- Then
- the contents should be "Foo\nBar Foo\nHmm\nBaz"
- And
- the selected text should be "Foo"
- And
- the selection range should be from 0 to 3
- Find next without wrap around
-
- When
- I replace the contents with "Foo\nBar Foo\nHmm\nBaz"
- And
- I move the cursor to 0
- And
- I run the command DocumentSearch::ExtendedSearchCommand
- And
- I type "Foo" into the "Search" field in the speedbar
- And
- I choose "Plain" in the "search_type" field in the speedbar
- And
- I uncheck "Wrap Around" in the speedbar
- And
- I press "Next" in the speedbar
- Then
- the contents should be "Foo\nBar Foo\nHmm\nBaz"
- And
- the selected text should be "Foo"
- And
- the selection range should be from 0 to 3
- When
- I press "Next" in the speedbar
- Then
- the contents should be "Foo\nBar Foo\nHmm\nBaz"
- And
- the selected text should be "Foo"
- And
- the selection range should be from 8 to 11
- When
- I press "Next" in the speedbar
- Then
- the contents should be "Foo\nBar Foo\nHmm\nBaz"
- And
- the selected text should be ""
- And
- the selection range should be from 11 to 11
- Find previous with wrap around
-
- When
- I replace the contents with "Foo\nBar Foo\nHmm\nBaz"
- And
- I move the cursor to 18
- And
- I run the command DocumentSearch::ExtendedSearchCommand
- And
- I type "Foo" into the "Search" field in the speedbar
- And
- I choose "Plain" in the "search_type" field in the speedbar
- And
- I check "Wrap Around" in the speedbar
- And
- I press "Previous" in the speedbar
- Then
- the contents should be "Foo\nBar Foo\nHmm\nBaz"
- And
- the selected text should be "Foo"
- And
- the selection range should be from 8 to 11
- When
- I press "Previous" in the speedbar
- Then
- the contents should be "Foo\nBar Foo\nHmm\nBaz"
- And
- the selected text should be "Foo"
- And
- the selection range should be from 0 to 3
- When
- I press "Previous" in the speedbar
- Then
- the contents should be "Foo\nBar Foo\nHmm\nBaz"
- And
- the selected text should be "Foo"
- And
- the selection range should be from 8 to 11
- Find previous without wrap around
-
- When
- I replace the contents with "Foo\nBar Foo\nHmm\nBaz"
- And
- I move the cursor to 18
- And
- I run the command DocumentSearch::ExtendedSearchCommand
- And
- I type "Foo" into the "Search" field in the speedbar
- And
- I choose "Plain" in the "search_type" field in the speedbar
- And
- I uncheck "Wrap Around" in the speedbar
- And
- I press "Previous" in the speedbar
- Then
- the contents should be "Foo\nBar Foo\nHmm\nBaz"
- And
- the selected text should be "Foo"
- And
- the selection range should be from 8 to 11
- When
- I press "Previous" in the speedbar
- Then
- the contents should be "Foo\nBar Foo\nHmm\nBaz"
- And
- the selected text should be "Foo"
- And
- the selection range should be from 0 to 3
- When
- I press "Previous" in the speedbar
- Then
- the contents should be "Foo\nBar Foo\nHmm\nBaz"
- And
- the selected text should be ""
- And
- the selection range should be from 0 to 0
- Find with regular expression
-
- When
- I replace the contents with "Foo\nBar Foo\nHmm\nBaz"
- And
- I move the cursor to 0
- And
- I run the command DocumentSearch::ExtendedSearchCommand
- And
- I type "Fo." into the "Search" field in the speedbar
- And
- I choose "Regex" in the "search_type" field in the speedbar
- And
- I check "Wrap Around" in the speedbar
- And
- I press "Next" in the speedbar
- Then
- the contents should be "Foo\nBar Foo\nHmm\nBaz"
- And
- the selected text should be "Foo"
- And
- the selection range should be from 0 to 3
- When
- I press "Next" in the speedbar
- Then
- the contents should be "Foo\nBar Foo\nHmm\nBaz"
- And
- the selected text should be "Foo"
- And
- the selection range should be from 8 to 11
- Replace and find with no initial selection
-
- When
- I replace the contents with "Foo\nBar Foo Rab Rab\nHmm\nRab\nFoo\nBaz"
- And
- I move the cursor to 0
- And
- I run the command DocumentSearch::ExtendedSearchCommand
- And
- I type "Rab" into the "Search" field in the speedbar
- And
- I type "RABBIT" into the "Replace" field in the speedbar
- And
- I choose "Plain" in the "search_type" field in the speedbar
- And
- I check "Wrap Around" in the speedbar
- And
- I press "Replace && Find" in the speedbar
- Then
- the contents should be "Foo\nBar Foo Rab Rab\nHmm\nRab\nFoo\nBaz"
- And
- the selected text should be "Rab"
- And
- the selection range should be from 12 to 15
- When
- I press "Replace && Find" in the speedbar
- Then
- the contents should be "Foo\nBar Foo RABBIT Rab\nHmm\nRab\nFoo\nBaz"
- And
- the selected text should be "Rab"
- And
- the selection range should be from 19 to 22
- When
- I press "Replace && Find" in the speedbar
- Then
- the contents should be "Foo\nBar Foo RABBIT RABBIT\nHmm\nRab\nFoo\nBaz"
- And
- the selected text should be "Rab"
- And
- the selection range should be from 30 to 33
- When
- I press "Replace && Find" in the speedbar
- Then
- the contents should be "Foo\nBar Foo RABBIT RABBIT\nHmm\nRABBIT\nFoo\nBaz"
- And
- the selected text should be "RAB"
- And
- the selection range should be from 12 to 15
- When
- I press "Replace && Find" in the speedbar
- Then
- the contents should be "Foo\nBar Foo RABBITBIT RABBIT\nHmm\nRABBIT\nFoo\nBaz"
- And
- the selected text should be "RAB"
- And
- the selection range should be from 22 to 25
- Replace and find with matching initial selection
-
- When
- I replace the contents with "Foo\nBar Foo Rab Rab\nHmm\nRab\nFoo\nBaz"
- And
- I select from 12 to 15
- And
- I run the command DocumentSearch::ExtendedSearchCommand
- And
- I type "Rab" into the "Search" field in the speedbar
- And
- I type "RABBIT" into the "Replace" field in the speedbar
- And
- I choose "Plain" in the "search_type" field in the speedbar
- And
- I check "Wrap Around" in the speedbar
- And
- I press "Replace && Find" in the speedbar
- Then
- the contents should be "Foo\nBar Foo RABBIT Rab\nHmm\nRab\nFoo\nBaz"
- And
- the selected text should be "Rab"
- And
- the selection range should be from 19 to 22
- When
- I press "Replace && Find" in the speedbar
- Then
- the contents should be "Foo\nBar Foo RABBIT RABBIT\nHmm\nRab\nFoo\nBaz"
- And
- the selected text should be "Rab"
- And
- the selection range should be from 30 to 33
- When
- I press "Replace && Find" in the speedbar
- Then
- the contents should be "Foo\nBar Foo RABBIT RABBIT\nHmm\nRABBIT\nFoo\nBaz"
- And
- the selected text should be "RAB"
- And
- the selection range should be from 12 to 15
- When
- I press "Replace && Find" in the speedbar
- Then
- the contents should be "Foo\nBar Foo RABBITBIT RABBIT\nHmm\nRABBIT\nFoo\nBaz"
- And
- the selected text should be "RAB"
- And
- the selection range should be from 22 to 25
- Replace and find with initial selection that doesn't match
-
- When
- I replace the contents with "Foo\nBar Foo Rab Rab\nHmm\nRab\nFoo\nBaz"
- And
- I select from 4 to 7
- And
- I run the command DocumentSearch::ExtendedSearchCommand
- And
- I type "Rab" into the "Search" field in the speedbar
- And
- I type "RABBIT" into the "Replace" field in the speedbar
- And
- I choose "Plain" in the "search_type" field in the speedbar
- And
- I check "Wrap Around" in the speedbar
- And
- I press "Replace && Find" in the speedbar
- Then
- the contents should be "Foo\nBar Foo Rab Rab\nHmm\nRab\nFoo\nBaz"
- And
- the selected text should be "Rab"
- And
- the selection range should be from 12 to 15
- When
- I press "Replace && Find" in the speedbar
- Then
- the contents should be "Foo\nBar Foo RABBIT Rab\nHmm\nRab\nFoo\nBaz"
- And
- the selected text should be "Rab"
- And
- the selection range should be from 19 to 22
- When
- I press "Replace && Find" in the speedbar
- Then
- the contents should be "Foo\nBar Foo RABBIT RABBIT\nHmm\nRab\nFoo\nBaz"
- And
- the selected text should be "Rab"
- And
- the selection range should be from 30 to 33
- When
- I press "Replace && Find" in the speedbar
- Then
- the contents should be "Foo\nBar Foo RABBIT RABBIT\nHmm\nRABBIT\nFoo\nBaz"
- And
- the selected text should be "RAB"
- And
- the selection range should be from 12 to 15
- When
- I press "Replace && Find" in the speedbar
- Then
- the contents should be "Foo\nBar Foo RABBITBIT RABBIT\nHmm\nRABBIT\nFoo\nBaz"
- And
- the selected text should be "RAB"
- And
- the selection range should be from 22 to 25
- Replace and find with initial selection that is after last match
-
- When
- I replace the contents with "Foo\nBar Foo Rab Rab\nHmm\nRab\nFoo\nBaz"
- And
- I select from 28 to 31
- And
- I run the command DocumentSearch::ExtendedSearchCommand
- And
- I type "Rab" into the "Search" field in the speedbar
- And
- I type "RABBIT" into the "Replace" field in the speedbar
- And
- I choose "Plain" in the "search_type" field in the speedbar
- And
- I check "Wrap Around" in the speedbar
- And
- I press "Replace && Find" in the speedbar
- Then
- the contents should be "Foo\nBar Foo Rab Rab\nHmm\nRab\nFoo\nBaz"
- And
- the selected text should be "Rab"
- And
- the selection range should be from 12 to 15
- When
- I press "Replace && Find" in the speedbar
- Then
- the contents should be "Foo\nBar Foo RABBIT Rab\nHmm\nRab\nFoo\nBaz"
- And
- the selected text should be "Rab"
- And
- the selection range should be from 19 to 22
- When
- I press "Replace && Find" in the speedbar
- Then
- the contents should be "Foo\nBar Foo RABBIT RABBIT\nHmm\nRab\nFoo\nBaz"
- And
- the selected text should be "Rab"
- And
- the selection range should be from 30 to 33
- When
- I press "Replace && Find" in the speedbar
- Then
- the contents should be "Foo\nBar Foo RABBIT RABBIT\nHmm\nRABBIT\nFoo\nBaz"
- And
- the selected text should be "RAB"
- And
- the selection range should be from 12 to 15
- When
- I press "Replace && Find" in the speedbar
- Then
- the contents should be "Foo\nBar Foo RABBITBIT RABBIT\nHmm\nRABBIT\nFoo\nBaz"
- And
- the selected text should be "RAB"
- And
- the selection range should be from 22 to 25
- Replace and find with initial selection that is after last match and no wrap around
-
- When
- I replace the contents with "Foo\nBar Foo Rab Rab\nHmm\nRab\nFoo\nBaz"
- And
- I select from 28 to 31
- And
- I run the command DocumentSearch::ExtendedSearchCommand
- And
- I type "Rab" into the "Search" field in the speedbar
- And
- I type "RABBIT" into the "Replace" field in the speedbar
- And
- I choose "Plain" in the "search_type" field in the speedbar
- And
- I uncheck "Wrap Around" in the speedbar
- And
- I press "Replace && Find" in the speedbar
- Then
- the contents should be "Foo\nBar Foo Rab Rab\nHmm\nRab\nFoo\nBaz"
- And
- the selected text should be ""
- And
- the selection range should be from 31 to 31
- When
- I press "Replace && Find" in the speedbar
- Then
- the contents should be "Foo\nBar Foo Rab Rab\nHmm\nRab\nFoo\nBaz"
- And
- the selected text should be ""
- And
- the selection range should be from 31 to 31
- Replace all replaces one
-
- When
- I replace the contents with "Foo\nBar\nBaz"
- And
- I move the cursor to 0
- And
- I run the command DocumentSearch::ExtendedSearchCommand
- And
- I type "Bar" into the "Search" field in the speedbar
- And
- I type "Rab" into the "Replace" field in the speedbar
- And
- I choose "Plain" in the "search_type" field in the speedbar
- And
- I uncheck "Wrap Around" in the speedbar
- And
- I press "Replace All" in the speedbar
- Then
- the contents should be "Foo\nRab\nBaz"
- And
- the selected text should be "Rab"
- And
- the selection range should be from 4 to 7
- Replace all replaces two
-
- When
- I replace the contents with "Foo\nBar\nBaz\nBar\nQux"
- And
- I move the cursor to 0
- And
- I run the command DocumentSearch::ExtendedSearchCommand
- And
- I type "Bar" into the "Search" field in the speedbar
- And
- I type "Rab" into the "Replace" field in the speedbar
- And
- I choose "Plain" in the "search_type" field in the speedbar
- And
- I uncheck "Wrap Around" in the speedbar
- And
- I press "Replace All" in the speedbar
- Then
- the contents should be "Foo\nRab\nBaz\nRab\nQux"
- And
- the selected text should be "Rab"
- And
- the selection range should be from 12 to 15
- Replace all replaces two on the same line
-
- When
- I replace the contents with "abcabc"
- And
- I run the command DocumentSearch::ExtendedSearchCommand
- And
- I type "bc" into the "Search" field in the speedbar
- And
- I type "xx" into the "Replace" field in the speedbar
- And
- I choose "Plain" in the "search_type" field in the speedbar
- And
- I uncheck "Wrap Around" in the speedbar
- And
- I press "Replace All" in the speedbar
- Then
- the contents should be "axxaxx"
- And
- the selected text should be "xx"
- And
- the selection range should be from 4 to 6
- When
- I press "Replace All" in the speedbar
- Then
- the contents should be "axxaxx"
- And
- the selected text should be "xx"
- And
- the selection range should be from 4 to 6
- Replace all replaces overlapping occurences on the same line
-
- When
- I replace the contents with "deedeedeed"
- And
- I run the command DocumentSearch::ExtendedSearchCommand
- And
- I type "deed" into the "Search" field in the speedbar
- And
- I type "misdeed" into the "Replace" field in the speedbar
- And
- I choose "Plain" in the "search_type" field in the speedbar
- And
- I uncheck "Wrap Around" in the speedbar
- And
- I press "Replace All" in the speedbar
- Then
- the contents should be "misdeedeemisdeed"
- And
- the selected text should be "misdeed"
- And
- the selection range should be from 9 to 16
- Replace all is a single undo action
-
- When
- I replace the contents with "Foo\n\nabcabc\n\nBar"
- And
- I run the command DocumentSearch::ExtendedSearchCommand
- And
- I type "bc" into the "Search" field in the speedbar
- And
- I type "xx" into the "Replace" field in the speedbar
- And
- I choose "Plain" in the "search_type" field in the speedbar
- And
- I uncheck "Wrap Around" in the speedbar
- And
- I press "Replace All" in the speedbar
- Then
- the contents should be "Foo\n\naxxaxx\n\nBar"
- And
- the selected text should be "xx"
- And
- the selection range should be from 9 to 11
- When
- I undo
- Then
- the contents should be "Foo\n\nabcabc\n\nBar"
- Replace all regex with back-references
-
- When
- I replace the contents with "One fish\ntwo fish\nred fish\nblue fish"
- And
- I move the cursor to 0
- And
- I run the command DocumentSearch::ExtendedSearchCommand
- And
- I type "(\w+) fish" into the "Search" field in the speedbar
- And
- I type "\1 car" into the "Replace" field in the speedbar
- And
- I choose "Regex" in the "search_type" field in the speedbar
- And
- I uncheck "Wrap Around" in the speedbar
- And
- I press "Replace All" in the speedbar
- Then
- the contents should be "One car\ntwo car\nred car\nblue car"
- And
- the selected text should be "blue car"
- And
- the selection range should be from 24 to 32
Last published over 5 years ago by danlucraft.