I have a file in notepad with this text as example:
*Given* I get an user ID from XXX
*And* I set header "Authorization" with value "invalid_token"
*When* I send a POST request to api/endpoint/"documentlibraryID"/"identity_id"/root/"new_name"
*Then* the response code should be 401
*And* the response should contain "Invalid authorization token"
*Given* I get an user ID from XXX
*And* I set header "Authorization" with value "YYY"
*When* I send a POST request to api/endpoint/"documentlibraryID"/"identity_id"/root/"new_name"
*Then* the response code should be 200
*And* the response should contain "new_name"
*Given* I get an user ID from "XXX"
*And* I set header "Authorization" with value "YYY"
*When* I send a POST request to api/endpoint/"documentlibraryID"/"identity_id"/root/"folder_name"?automaticRename=true
*Then* the response code should be 200
*And* the response should contain "folder_name 1"
What I need to do: before each word api, i need to insert {code:none}
and insert {code}
at the end of the line. Example:
api/endpoint/"documentlibraryID"/"identity_id"/root/"folder_name"?automaticRename=true
would be:
{code:none}api/endpoint/"documentlibraryID"/"identity_id"/root/"folder_name"?automaticRename=true{code}
The first part is easy, I would just replace api for {code:none}api in Notepad++. The last part is my problem. Not all lines ends with the same text ... so I would need to find a regex that would Insert {code}
at the end of the each line that it finds the word api somewhere, or some other approach ... Not sure if this was clear, I can try to explain better, thanks for any help!