Skip to content
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

Adopting Playwright #2702

Merged
merged 2 commits into from
Mar 14, 2023
Merged

Adopting Playwright #2702

merged 2 commits into from
Mar 14, 2023

Conversation

cniackz
Copy link
Collaborator

@cniackz cniackz commented Mar 10, 2023

How to test:

  • Get code from the repo

  • Start MinIO Server:

MINIO_ROOT_USER=minioadmin MINIO_ROOT_PASSWORD=minioadmin minio server /Volumes/data{1...4} --address :9000 --console-address :9001
  • Start console server at 9090
cd ~/console
make install
~/go/bin/console server
  • Start console at port 5005
cd ~/console/portal-ui
yarn install
yarn playwright
  • Execute the tests:
cd ~/console/portal-ui
npx playwright test
  • get report
cd ~/console/portal-ui
npx playwright show-report
  • get coverage
cd ~/console/portal-ui
nyc report --reporter=html; open ./coverage/index.html

Screenshot 2023-03-09 at 5 38 25 PM

The flow:

Screenshot 2023-03-11 at 10 53 45 AM

Logs:

Tests executed and coverage report also saved in logs, this could lead us to put a threshold on the coverage in the next PR to avoid decreasing it and at least keep at the same initial level, but for now it is being saved:

npx playwright test

Running 6 tests using 1 worker
······
  6 passed (29.0s)
npx nyc report
---------------------------------------|---------|----------|---------|---------|-------------------
File                                   | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s 
---------------------------------------|---------|----------|---------|---------|-------------------
All files                              |   45.93 |     36.3 |   32.54 |   46.05 |                   
 src                                   |   51.51 |    35.36 |   35.59 |   50.94 |                   
  MainRouter.tsx                       |    62.5 |      100 |      25 |   83.33 | 27                
  ProtectedRoutes.tsx                  |      66 |    51.42 |   53.84 |    65.3 | ...70-106,120,[13](https://github.com/minio/console/actions/runs/4393057694/jobs/7693239196#step:9:14)4 
  StyleHandler.tsx                     |   73.33 |       50 |     100 |   73.33 | 55-59             
  config.ts                            |   71.42 |    57.[14](https://github.com/minio/console/actions/runs/4393057694/jobs/7693239196#step:9:15) |     100 |   71.42 | 30-34             
  history.ts                           |     100 |      100 |     100 |     100 |                   
  index.tsx                            |     100 |      100 |     100 |     100 |                   
  serviceWorker.ts                     |    7.89 |     6.25 |    6.66 |    7.89 | 29-131,140        
  store.ts                             |   85.71 |       75 |      50 |   83.33 | 57                
  systemSlice.ts                       |   42.85 |       50 |      30 |   38.46 | ...25-142,[15](https://github.com/minio/console/actions/runs/4393057694/jobs/7693239196#step:9:16)1-[16](https://github.com/minio/console/actions/runs/4393057694/jobs/7693239196#step:9:17)4 
 src/common                            |   21.42 |     6.42 |   10.52 |   21.71 |                   
  Copyright.tsx                        |       0 |      100 |       0 |       0 | 22                
  LoadingComponent.tsx                 |     100 |      100 |     100 |     100 |                   
  utils.ts                             |   20.81 |     6.42 |    8.33 |    21.1 | ...12-518,706-713 
 src/common/SecureComponent            |   77.57 |    54.83 |   58.82 |   79.04 |                   
  SecureComponent.tsx                  |   55.55 |    53.33 |   33.33 |    62.5 | 32,47-48          
  accessControl.ts                     |   70.96 |    57.77 |   69.23 |   72.13 | ...-80,99-103,146 
  index.ts                             |       0 |        0 |       0 |       0 |                   
  permissions.ts                       |   94.44 |        0 |       0 |   94.44 | 480-482           
 src/common/api                        |   28.57 |       20 |      50 |   28.57 |                   
  index.ts                             |   28.57 |       20 |      50 |   28.57 | 34-35,44-91       
 src/icons/SidebarMenus                |      50 |      100 |       0 |      50 |                   
  EncryptionIcon.tsx                   |      50 |      100 |       0 |      50 | 21                
  EncryptionStatusIcon.tsx             |      50 |      100 |       0 |      50 | 21                
 src/screens                           |      50 |      100 |       0 |      50 |                   
  NotFoundPage.tsx                     |      50 |      100 |       0 |      50 | 23                
 src/screens/AnonymousAccess           |      20 |      100 |       0 |      20 |                   
  AnonymousAccess.tsx                  |      20 |      100 |       0 |      20 | 32-62             
 src/screens/Console                   |   61.53 |    52.21 |   34.37 |    64.7 |                   
  CommandBar.tsx                       |   34.09 |        0 |    5.88 |   35.71 | ...61-187,214-301 
  Console.tsx                          |   62.66 |    53.57 |   35.48 |   67.18 | ...94,496,522-542 
  ConsoleKBar.tsx                      |   77.77 |       50 |     100 |   77.77 | 35,39             
  consoleSlice.ts                      |   88.88 |       50 |      75 |    87.5 | 46                
  kbar-actions.tsx                     |      75 |    83.33 |   16.66 |   78.94 | 37,47,59,71       
  valid-routes.ts                      |   86.66 |    77.77 |      80 |   86.66 | 98-99             
 src/screens/Console/Buckets           |    87.5 |      100 |      75 |     100 |                   
  Buckets.tsx                          |    87.5 |      100 |      75 |     100 |                   
 ...eens/Console/Buckets/BucketDetails |      50 |      100 |       0 |      50 |                   
  bucketDetailsSlice.ts                |      50 |      100 |       0 |      50 | 38-44,53,55       
 ...creens/Console/Buckets/ListBuckets |   22.75 |    34.46 |   13.79 |   22.83 |                   
  BucketListItem.tsx                   |      75 |    60.86 |      50 |      75 | ...01,204,214-230 
  BulkLifecycleModal.tsx               |    2.66 |        0 |       0 |    2.66 | 60,87-443         
  BulkReplicationModal.tsx             |    1.75 |        0 |       0 |    1.75 | 55,82-474         
  ListBuckets.tsx                      |   57.14 |    58.02 |    40.9 |   57.89 | ...10,278-361,467 
 ...sole/Buckets/ListBuckets/AddBucket |   68.52 |    52.48 |   61.64 |   67.02 |                   
  AddBucket.tsx                        |   83.13 |    68.33 |   67.56 |   81.81 | ...[17](https://github.com/minio/console/actions/runs/4393057694/jobs/7693239196#step:9:18),232,345-489 
  AddBucketName.tsx                    |     100 |      100 |     100 |     100 |                   
  BucketNamingRules.tsx                |     100 |    61.11 |     100 |     100 | 83-131            
  InvalidRule.tsx                      |     100 |      100 |     100 |     100 |                   
  NARule.tsx                           |      50 |      100 |       0 |      50 | 26                
  ValidRule.tsx                        |     100 |      100 |     100 |     100 |                   
  addBucketThunks.ts                   |   81.48 |    58.33 |   66.66 |   81.48 | 55-56,64,80-81    
  addBucketsSlice.ts                   |      25 |     6.45 |   33.33 |      25 | 75-161,174        
 src/screens/Console/Common            |    62.5 |    76.92 |   44.44 |    62.5 |                   
  ComponentsScreen.tsx                 |   16.66 |      100 |       0 |   16.66 | 26-58             
  FormLayout.tsx                       |     100 |      100 |     100 |     100 |                   
  SearchBox.tsx                        |   83.33 |       75 |   66.66 |   83.33 | 70                
  SectionTitle.tsx                     |     100 |    77.77 |     100 |     100 | 39,63             
 src/screens/Console/Common/AButton    |     100 |      100 |     100 |     100 |                   
  AButton.tsx                          |     100 |      100 |     100 |     100 |                   
 src/screens/Console/Common/Components |    37.5 |       20 |      50 |    37.5 |                   
  AutoColorIcon.tsx                    |   16.66 |        0 |       0 |   16.66 | 28-37             
  withSuspense.tsx                     |     100 |      100 |     100 |     100 |                   
 ...mon/FormComponents/CheckboxWrapper |      50 |        0 |       0 |      50 |                   
  CheckboxWrapper.tsx                  |      50 |        0 |       0 |      50 | 46,80             
 ...n/FormComponents/CodeMirrorWrapper |     100 |    55.55 |     100 |     100 |                   
  CodeMirrorWrapper.tsx                |     100 |    55.55 |     100 |     100 | 48,54-95          
 ...n/FormComponents/FormSwitchWrapper |   88.88 |    62.06 |     100 |    87.5 |                   
  FormSwitchWrapper.tsx                |   88.88 |    62.06 |     100 |    87.5 | 168               
 ...mon/FormComponents/InputBoxWrapper |   69.56 |    60.71 |   66.66 |   69.56 |                   
  InputBoxWrapper.tsx                  |   69.56 |    60.71 |   66.66 |   69.56 | ...62-167,233-235 
 ...ommon/FormComponents/InputUnitMenu |   13.33 |        0 |       0 |   13.33 |                   
  InputUnitMenu.tsx                    |   13.33 |        0 |       0 |   13.33 | 34,52-97          
 ...mmon/FormComponents/PredefinedList |      50 |        0 |       0 |      50 |                   
  PredefinedList.tsx                   |      50 |        0 |       0 |      50 | 17,28             
 .../FormComponents/QueryMultiSelector |    3.07 |        0 |       0 |    3.07 |                   
  QueryMultiSelector.tsx               |    3.07 |        0 |       0 |    3.07 | 49,82-228         
 .../FormComponents/RadioGroupSelector |   44.44 |        0 |       0 |   44.44 |                   
  RadioGroupSelector.tsx               |   44.44 |        0 |       0 |   44.44 | 49,85-87,111-138  
 ...ommon/FormComponents/SelectWrapper |   42.85 |        0 |       0 |   42.85 |                   
  SelectWrapper.tsx                    |   42.85 |        0 |       0 |   42.85 | 51,63,103-130     
 ...nsole/Common/FormComponents/common |     100 |      100 |     100 |     100 |                   
  styleLibrary.ts                      |     100 |      100 |     100 |     100 |                   
 ...reens/Console/Common/GenericWizard |    7.69 |        0 |       0 |    7.69 |                   
  GenericWizard.tsx                    |    5.88 |        0 |       0 |    5.88 | 28,112-208        
  WizardPage.tsx                       |   11.11 |        0 |       0 |   11.11 | 26,73-116         
 src/screens/Console/Common/Hooks      |      80 |      100 |      75 |      80 |                   
  useApi.tsx                           |      80 |      100 |      75 |      80 | 24-25             
 src/screens/Console/Common/Layout     |     100 |       75 |     100 |     100 |                   
  PageLayout.tsx                       |     100 |       75 |     100 |     100 | 26                
 src/screens/Console/Common/MainError  |      72 |    47.05 |      50 |      72 |                   
  MainError.tsx                        |      72 |    47.05 |      50 |      72 | ...8,61-62,73-146 
 ...creens/Console/Common/ModalWrapper |   11.42 |        0 |       0 |   11.42 |                   
  ConfirmDialog.tsx                    |   33.33 |        0 |       0 |   33.33 | 34,73-78          
  ModalWrapper.tsx                     |    6.89 |        0 |       0 |    6.89 | 45,68-153         
 ...reens/Console/Common/ObjectManager |   54.43 |    13.04 |   58.62 |   53.84 |                   
  ObjectHandled.tsx                    |      20 |        0 |       0 |      20 | 41,161-178        
  ObjectManager.tsx                    |   78.57 |       50 |    62.5 |   78.57 | 1[18](https://github.com/minio/console/actions/runs/4393057694/jobs/7693239196#step:9:19)-132           
  ObjectManagerButton.tsx              |   78.94 |    30.76 |      75 |   77.77 | 69-71,82          
  TrafficMonitor.tsx                   |   41.66 |    13.33 |      60 |   41.66 | 53-103            
 ...s/Console/Common/PageHeaderWrapper |     100 |      100 |     100 |     100 |                   
  PageHeaderWrapper.tsx                |     100 |      100 |     100 |     100 |                   
 .../Console/Common/ProgressBarWrapper |   11.11 |        0 |       0 |      12 |                   
  ProgressBarWrapper.tsx               |   11.11 |        0 |       0 |      12 | 56-67,102-130     
 ...creens/Console/Common/TableWrapper |   58.74 |    52.21 |   62.79 |   58.86 |                   
  TableActionButton.tsx                |   34.28 |    25.71 |      50 |   34.28 | ...22,134,141-158 
  TableWrapper.tsx                     |   66.66 |    57.73 |   64.86 |   66.98 | ...53,671-681,737 
 ...mmon/TableWrapper/TableActionIcons |      60 |        0 |       0 |      60 |                   
  CloudIcon.tsx                        |      50 |        0 |       0 |      50 | 5                 
  ConsoleIcon.tsx                      |      50 |        0 |       0 |      50 | 5                 
  DisableIcon.tsx                      |      50 |        0 |       0 |      50 | 5                 
  FormatDriveIcon.tsx                  |      50 |      100 |       0 |      50 | 4                 
  common.ts                            |     100 |      100 |     100 |     100 |                   
 ...eens/Console/Common/TooltipWrapper |     100 |    66.66 |     100 |     100 |                   
  TooltipWrapper.tsx                   |     100 |    66.66 |     100 |     100 | 48                
 ...ens/Console/Common/VirtualizedList |     100 |      100 |     100 |     100 |                   
  VirtualizedList.tsx                  |     100 |      100 |     100 |     100 |                   
 src/screens/Console/Dashboard         |   27.77 |      100 |      10 |   27.77 |                   
  dashboardSlice.ts                    |   30.76 |      100 |   14.28 |   30.76 | 43-51,57-64       
  dashboardThunks.ts                   |      20 |      100 |       0 |      20 | 26-33             
 src/screens/Console/Groups            |   66.91 |    51.51 |   55.55 |   68.46 |                   
  AddGroupHelpBox.tsx                  |     100 |      100 |     100 |     100 |                   
  AddGroupScreen.tsx                   |   82.75 |      100 |   72.72 |   82.75 | 77-78,94-95,105   
  Groups.tsx                           |   59.37 |    39.53 |   36.36 |   61.29 | ...02,221-297,416 
  UsersSelectors.tsx                   |   63.88 |     64.7 |      70 |   65.71 | ...07-108,127-142 
 src/screens/Console/HealthInfo        |      60 |      100 |       0 |      60 |                   
  healthInfoSlice.ts                   |      60 |      100 |       0 |      60 | 35-38             
 src/screens/Console/License           |   43.18 |        0 |    4.34 |   45.23 |                   
  FAQModal.tsx                         |   16.66 |      100 |       0 |      20 | 25-33             
  LicenseFAQ.tsx                       |      40 |      100 |       0 |      50 | 28-29             
  LicenseLink.tsx                      |      50 |      100 |       0 |      50 | 20                
  licenseSlice.ts                      |      60 |      100 |       0 |      60 | 32-35             
  utils.tsx                            |   46.15 |        0 |    6.66 |   46.15 | ...41-388,445,450 
 src/screens/Console/Logs              |   23.07 |        0 |       0 |   23.07 |                   
  logsSlice.ts                         |   23.07 |        0 |       0 |   23.07 | 36-66             
 src/screens/Console/Menu              |   85.05 |    73.25 |      80 |   85.05 |                   
  ConsoleMenuList.tsx                  |   86.36 |    64.28 |     100 |   86.36 | 113-114,135       
  LicenseBadge.tsx                     |   88.88 |     87.5 |     100 |   88.88 | 36                
  Menu.tsx                             |    90.9 |      100 |      75 |    90.9 | 112               
  MenuItem.tsx                         |   86.66 |    78.57 |     100 |   86.66 | 78,85,87-88       
  MenuSectionHeader.tsx                |      50 |      100 |       0 |      50 | 24                
  MenuStyleUtils.tsx                   |     100 |      100 |     100 |     100 |                   
  MenuToggle.tsx                       |   57.14 |     37.5 |   33.33 |   57.14 | 52-145            
 src/screens/Console/ObjectBrowser     |   28.49 |    41.79 |   15.18 |   28.64 |                   
  OBBucketList.tsx                     |   85.71 |       80 |   71.42 |   85.71 | ...14,129,169,303 
  ObjectBrowser.tsx                    |   66.66 |      100 |   33.33 |   66.66 | 25,28             
  objectBrowserSlice.ts                |    4.27 |        0 |    1.78 |    4.27 | 90-244,250-362    
  transferManager.ts                   |   38.09 |      100 |       0 |      40 | ...33,37-38,42-49 
 src/screens/Console/Policies          |   78.49 |       64 |   67.74 |      80 |                   
  AddPolicyHelpBox.tsx                 |     100 |      100 |     100 |     100 |                   
  AddPolicyScreen.tsx                  |   75.86 |    77.77 |      70 |   75.86 | ...60,65-66,71,87 
  ListPolicies.tsx                     |   77.35 |    56.25 |    62.5 |   78.84 | ...61-162,166,173 
  Policies.tsx                         |   83.33 |      100 |   66.66 |     100 |                   
  utils.ts                             |     100 |      100 |     100 |     100 |                   
 src/screens/Console/Support           |   15.78 |      100 |       0 |   15.78 |                   
  registerSlice.ts                     |   15.78 |      100 |       0 |   15.78 | 61-108            
 src/screens/Console/Trace             |      50 |      100 |       0 |      50 |                   
  traceSlice.ts                        |      50 |      100 |       0 |      50 | 35-41             
 src/screens/Console/Users             |   [19](https://github.com/minio/console/actions/runs/4393057694/jobs/7693239196#step:9:20).04 |      100 |    7.69 |   19.04 |                   
  AddUsersSlice.tsx                    |   19.04 |      100 |    7.69 |   19.04 | 48-70,76-89       
 src/screens/Console/Users/thunk       |    12.5 |      100 |       0 |    12.5 |                   
  AddUsersThunk.tsx                    |    12.5 |      100 |       0 |    12.5 | 34-38,45-62       
 src/screens/Console/Watch             |      60 |      100 |       0 |      60 |                   
  watchSlice.ts                        |      60 |      100 |       0 |      60 | 33-36             
 src/screens/LoginPage                 |   10.52 |        0 |    1.88 |   11.02 |                   
  LoginField.tsx                       |      40 |      100 |       0 |      40 | 25,57-59          
  LoginPage.tsx                        |    6.81 |        0 |       0 |    7.14 | ...40-248,252-343 
  StrategyForm.tsx                     |    5.55 |        0 |       0 |    6.25 | 45,76-247         
  loginSlice.ts                        |      16 |        0 |    6.25 |      16 | 68-82,87-119      
  loginThunks.ts                       |   13.04 |        0 |       0 |   13.04 | 29-58,65-71,79-93 
  types.ts                             |       0 |        0 |       0 |       0 |                   
 src/theme                             |     100 |      100 |     100 |     100 |                   
  main.ts                              |     100 |      100 |     100 |     100 |                   
 src/utils                             |   28.94 |    10.71 |   14.28 |   28.94 |                   
  sortFunctions.ts                     |      30 |       15 |      [20](https://github.com/minio/console/actions/runs/4393057694/jobs/7693239196#step:9:21) |      30 | ...61,68-75,79-85 
  stylesUtils.ts                       |      25 |        0 |       0 |      25 | [23](https://github.com/minio/console/actions/runs/4393057694/jobs/7693239196#step:9:24)-[27](https://github.com/minio/console/actions/runs/4393057694/jobs/7693239196#step:9:28),[32](https://github.com/minio/console/actions/runs/4393057694/jobs/7693239196#step:9:33)-1[51](https://github.com/minio/console/actions/runs/4393057694/jobs/7693239196#step:9:52)      
---------------------------------------|---------|----------|---------|---------|-------------------

@cniackz cniackz changed the title Adopting Playwright [WIP] - Adopting Playwright Mar 10, 2023
@cniackz cniackz self-assigned this Mar 10, 2023
@cniackz
Copy link
Collaborator Author

cniackz commented Mar 10, 2023

It is still pending, because I need to add tests to GitHub Actions to be executed by our CI/CD Pipeline.

@dvaldivia
Copy link
Collaborator

LGTM

@cniackz
Copy link
Collaborator Author

cniackz commented Mar 10, 2023

Wait Daniel, I need to fix React warning and add github actions, almost there....

@cniackz cniackz force-pushed the adopt-playwright branch 19 times, most recently from 096b85b to fb84ca4 Compare March 11, 2023 15:31
@cniackz cniackz changed the title [WIP] - Adopting Playwright Adopting Playwright Mar 12, 2023
Copy link
Member

@prakashsvmx prakashsvmx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested. Looks good to me 👍 :

@bexsoft bexsoft merged commit 5cb4e6f into minio:master Mar 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants