Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Browser/base/librarycomponent.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,8 @@ def _replace_placeholder_variable(self, placeholder):
if value is NOT_FOUND:
logger.warn("Given variable placeholder could not be resolved.")
return placeholder
if isinstance(value, Secret):
return value.value
return value

@property
Expand Down
40 changes: 38 additions & 2 deletions atest/test/02_Content_Keywords/secret.robot
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,52 @@ Test Setup Ensure Open Page ${LOGIN_URL}
Test Tags require-rf-7.4+

*** Test Cases ***
Type Secret
Type Secret And Verify
${secret} = Get Secret Value
Type Secret input#username_field ${secret}
Get Text input#username_field == Joulupukki

Fill Secret
Fill Secret And Verify
${secret} = Get Secret Value
Fill Secret input#username_field ${secret}
Get Text input#username_field == Joulupukki

Type Secret And Fails With Curly Brackets
Set Browser Timeout 500ms scope=Test
${secret} = Get Secret Value
TRY
Type Secret notHere ${secret}
EXCEPT * type=GLOB AS ${error}
Should Contain ${error} notHere
END

Fill Secret And Fails With Curly Brackets
Set Browser Timeout 500ms scope=Test
${secret} = Get Secret Value
TRY
Fill Secret notHere ${secret}
EXCEPT * type=GLOB AS ${error}
Should Contain ${error} notHere
END

Type Secret And Fails Without Curly Brackets
Set Browser Timeout 500ms scope=Test
${secret} = Get Secret Value
TRY
Type Secret notHere $secret
EXCEPT * type=GLOB AS ${error}
Should Contain ${error} notHere
END

Fill Secret And Fails Without Curly Brackets
Set Browser Timeout 500ms scope=Test
${secret} = Get Secret Value
TRY
Fill Secret notHere $secret
EXCEPT * type=GLOB AS ${error}
Should Contain ${error} notHere
END

New Context With Secret As Literal In httpCredentials Is Not Supported
${secret} = Get Secret Value
TRY
Expand Down
Loading