- 
                Notifications
    
You must be signed in to change notification settings  - Fork 32
 
          ✅ e2e: new workflow to test tiplite
          #6388
        
          New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
          
     Merged
      
      
            pcrespov
  merged 22 commits into
  ITISFoundation:master
from
pcrespov:is1701/new-e2e-tip-lite
  
      
      
   
  Sep 24, 2024 
      
    
  
     Merged
                    Changes from all commits
      Commits
    
    
            Show all changes
          
          
            22 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      01dc91a
              
                minor
              
              
                pcrespov e916331
              
                adds --product-billable
              
              
                pcrespov 11317a7
              
                undo
              
              
                pcrespov 18bfba7
              
                checks two out of three steps
              
              
                pcrespov 599fa98
              
                updates makefile
              
              
                pcrespov bb7d57d
              
                doc
              
              
                pcrespov 2a273b1
              
                hid pass
              
              
                pcrespov 61b87e2
              
                minor
              
              
                pcrespov 3c95848
              
                updates tests
              
              
                pcrespov 8c3ff98
              
                wrong import
              
              
                pcrespov f06b1a1
              
                WIP
              
              
                pcrespov 22de515
              
                checks TIP button
              
              
                pcrespov cdbf0b8
              
                @matusdrobuliak66 review: masked secret
              
              
                pcrespov 0aa9460
              
                corrected some steps
              
              
                pcrespov f99c34c
              
                tags tip teaser close button
              
              
                pcrespov cae3cf1
              
                fixes pydyantic_extension
              
              
                pcrespov 5dbf90e
              
                fixes pydyantic_extension
              
              
                pcrespov f8cb8af
              
                adds test ids
              
              
                pcrespov 66847cb
              
                updates access tip teaser
              
              
                pcrespov 26752c6
              
                bad ref
              
              
                pcrespov 3d65081
              
                bad merge
              
              
                pcrespov f4d412e
              
                Merge branch 'master' into is1701/new-e2e-tip-lite
              
              
                pcrespov File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
        
          
  
    
      
          
            34 changes: 34 additions & 0 deletions
          
          34 
        
  packages/pytest-simcore/src/pytest_simcore/helpers/pydantic_extension.py
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| from pydantic import SecretStr | ||
| 
     | 
||
| 
     | 
||
| def _mask(value): | ||
| """ | ||
| Mask the password, showing only the first and last characters | ||
| or *** if very short passwords | ||
| """ | ||
| if len(value) > 2: | ||
| masked_value = value[0] + "*" * (len(value) - 2) + value[-1] | ||
| else: | ||
| # In case of very short passwords | ||
| masked_value = "*" * len(value) | ||
| return masked_value | ||
| 
     | 
||
| 
     | 
||
| def _hash(value): | ||
| """Uses hash number to mask the password""" | ||
| return f"hash:{hash(value)}" | ||
| 
     | 
||
| 
     | 
||
| class Secret4TestsStr(SecretStr): | ||
| """Prints a hint of the secret | ||
| TIP: Can be handy for testing | ||
| """ | ||
| 
     | 
||
| def _display(self) -> str | bytes: | ||
| # SEE overrides _SecretBase._display | ||
| value = self.get_secret_value() | ||
| return _mask(value) if value else "" | ||
| 
     | 
||
| 
     | 
||
| assert str(Secret4TestsStr("123456890")) == "1*******0" | ||
| assert "1*******0" in repr(Secret4TestsStr("123456890")) | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| test-results | ||
| .e2e-playwright-*.txt | ||
| assets | ||
| report.html | ||
| .e2e-playwright-*.txt | ||
| report.xml | ||
| test-results | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -1,22 +1,36 @@ | ||
| 
     | 
||
| 
     | 
||
| ## Usage | ||
| 
     | 
||
| ### Auto generate new test | ||
| `playwright codegen sim4life.io` | ||
| ``` | ||
| playwright codegen sim4life.io | ||
| ``` | ||
| 
     | 
||
| ### Run test locally with headed mode | ||
| ``` | ||
| pytest -s tests/sim4life.py --headed --browser chromium --product-billable --product-url https://sim4life.io/ --user-name YOUR_USERNAME --password YOUR_PASSWORD --service-key sim4life-8-0-0-dy | ||
| ``` | ||
| 
     | 
||
| ### Check test results output | ||
| `playwright show-trace test-results/tests-sim4life-py-test-billable-sim4life-chromium/trace.zip` | ||
| ``` | ||
| playwright show-trace test-results/tests-sim4life-py-test-billable-sim4life-chromium/trace.zip | ||
| ``` | ||
| 
     | 
||
| ### Run debug mode | ||
| `PWDEBUG=1 pytest -s tests/sim4life.py` | ||
| ``` | ||
| PWDEBUG=1 pytest -s tests/sim4life.py | ||
| ``` | ||
| 
     | 
||
| ### Run test in different browsers | ||
| `pytest -s tests/sim4life.py --tracing on --html=report.html --browser chromium --browser firefox` | ||
| ``` | ||
| pytest -s tests/sim4life.py --tracing on --html=report.html --browser chromium --browser firefox | ||
| ``` | ||
| 
     | 
||
| ### or in chrome/msedge | ||
| `pytest -s tests/sim4life.py --tracing on --html=report.html --browser-channel chrome` | ||
| ### or in chrome/ms-edge | ||
| ``` | ||
| pytest -s tests/sim4life.py --tracing on --html=report.html --browser-channel chrome | ||
| ``` | ||
| 
     | 
||
| ### Runs in CI | ||
| ## e2e CI | ||
| - https://git.speag.com/oSparc/e2e-backend | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
      
      Oops, something went wrong.
        
    
  
      
      Oops, something went wrong.
        
    
  
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Uh oh!
There was an error while loading. Please reload this page.