- 
                Notifications
    You must be signed in to change notification settings 
- Fork 115
test(controller): Add test for controller documentation coverage #2035
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
      
      
    Conversation
  
    
      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
    
  
  
    
    Introduces a pytest test to ensure all controller classes in shiny/playwright/controller are documented in docs/_quartodoc-testing.yml. Also updates the documentation config to include PageNavbar which was missing and the tests caught that.
Added InputBookmarkButton to documentation config. Expanded CONTROLLER_BASE_PATTERNS in test_controller_documentation.py to skip additional UI-related base classes.
Deleted the test_documented_classes_format function which checked that documented controller entries are valid Python identifiers.
Replaces the ControllerDocumentationChecker class with standalone functions for extracting controller classes and documented controllers. Simplifies the test structure and error reporting, improving readability and maintainability.
Updated OutputDataFrame to pass timeout to expect_cell_class for all cell state checks. Improved test reliability by adding retries and timeout when verifying cell enters editing state after pressing Enter.
              
                    karangattu
  
              
              commented
              
                  
                    Jul 17, 2025 
                  
              
              
            
            
        
          
                ...ponents/data_frame/validate_row_selection_edit_mode/test_validate_row_selection_edit_mode.py
              
                Outdated
          
            Show resolved
            Hide resolved
        
      Removed unnecessary class expectation when editing cells in OutputDataFrame and simplified flaky retry logic in the related test by using a single wait and class state check. This streamlines cell editing interactions and improves test reliability.
Deleted an extraneous blank line in the OutputDataFrame class to improve code readability.
Deleted the unnecessary 'timeout' parameter from the test_validate_row_selection_in_edit_mode function call to clean up the test code.
A comment was added to explain that the stage column begins to be edited in the test_validate_row_selection_in_edit_mode test. This improves code readability for future maintenance.
              
                    schloerke
  
              
              approved these changes
              
                  
                    Jul 21, 2025 
                  
              
              
            
            
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
      
  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.
  
    
  
    
The key changes include enhancements to the documentation configuration, updates to test coverage, and improvements to method implementations for better functionality and maintainability.
Documentation updates:
InputBookmarkButtonandPageNavbarto the documentation configuration indocs/_quartodoc-testing.yml. This ensures these controllers are now included in the generated documentation.Functional improvements:
expect_class_statemethod inshiny/playwright/controller/_output.pyto consistently include thetimeoutparameter in allexpect_cell_classcalls, improving flexibility and consistency.Test enhancements:
test_validate_row_selection_in_edit_modeto ensure proper row focus and cell state after exiting edit mode, improving the robustness of the test.tests/pytest/test_controller_documentation.pyto validate that all controller classes are documented and that no extraneous entries exist in the documentation configuration. This ensures alignment between the codebase and the documentation.Scenario 1: Developer forgets to document it in the testing docs
Code has: Card, Accordion, InputBookmarkButton
Docs have: Card, Accordion
Test fails with:
Scenario 2: Developer makes a typo in docs
Code has: Card, Accordion, InputBookmarkButton
Docs have: Card, Accordion, InputBookmarkButto
Controllers missing from docs/_quartodoc-testing.yml: - playwright.controller.InputBookmarkButton Extraneous classes in docs/_quartodoc-testing.yml: - playwright.controller.InputBookmarkButto