Tell me about your approach to writing automated tests with Selenium, and how you would structure the test code for maintainability.
Implement a pure Python helper that creates a maintainable index for Selenium tests organized by Page Object and feature. Each test has a page, feature, name, and numeric priority. Return a nested dictionary whose test names are ordered by priority, then alphabetically.
Input: a list of test dictionaries. Output: {page: {feature: [test_names]}}.
Example: [{"page":"LoginPage","feature":"authentication","name":"test_valid_login","priority":2}] returns {"LoginPage":{"authentication":["test_valid_login"]}}.
Constraints: 1 to 500 tests, nonempty string fields, unique test names.
def organize_selenium_tests(test_cases):