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

[js + bazel]: Run Node browser tests on the RBE #14194

Merged
merged 21 commits into from
Jun 27, 2024

Conversation

shs96c
Copy link
Member

@shs96c shs96c commented Jun 26, 2024

PR Type

Enhancement, Tests, Configuration changes


Changes walkthrough 📝

Relevant files
Formatting
1 files
LocateNodesTest.java
Remove trailing whitespace in `LocateNodesTest.java`         

java/test/org/openqa/selenium/bidi/browsingcontext/LocateNodesTest.java

  • Removed trailing whitespace.
+1/-1     
Enhancement
57 files
pinnedScript.js
Add ESLint directive in `pinnedScript.js`                               

javascript/node/selenium-webdriver/lib/pinnedScript.js

  • Added ESLint directive to disable the next line.
+1/-0     
httpserver.js
Update import paths in `httpserver.js`                                     

javascript/node/selenium-webdriver/lib/test/httpserver.js

  • Updated import paths to use selenium-webdriver package.
+3/-3     
index.js
Update import paths in `index.js`                                               

javascript/node/selenium-webdriver/lib/test/index.js

  • Updated import paths to use selenium-webdriver package.
+2/-2     
resources.js
Enhance resource location with Bazel runfiles                       

javascript/node/selenium-webdriver/lib/test/resources.js

  • Added @bazel/runfiles import.
  • Updated locate function to use runfiles.
  • +12/-3   
    actions_test.js
    Update import paths in `actions_test.js`                                 

    javascript/node/selenium-webdriver/test/actions_test.js

    • Updated import paths to use selenium-webdriver package.
    +2/-2     
    add_intercept_parameters_test.js
    Update import paths in `add_intercept_parameters_test.js`

    javascript/node/selenium-webdriver/test/bidi/add_intercept_parameters_test.js

    • Updated import paths to use selenium-webdriver package.
    +5/-5     
    bidi_session_test.js
    Update import paths in `bidi_session_test.js`                       

    javascript/node/selenium-webdriver/test/bidi/bidi_session_test.js

    • Updated import paths to use selenium-webdriver package.
    +1/-1     
    bidi_test.js
    Update import paths in `bidi_test.js`                                       

    javascript/node/selenium-webdriver/test/bidi/bidi_test.js

    • Updated import paths to use selenium-webdriver package.
    +4/-4     
    browser_test.js
    Update import paths in `browser_test.js`                                 

    javascript/node/selenium-webdriver/test/bidi/browser_test.js

    • Updated import paths to use selenium-webdriver package.
    +2/-2     
    browsingcontext_inspector_test.js
    Update import paths in `browsingcontext_inspector_test.js`

    javascript/node/selenium-webdriver/test/bidi/browsingcontext_inspector_test.js

    • Updated import paths to use selenium-webdriver package.
    +4/-4     
    browsingcontext_test.js
    Update import paths in `browsingcontext_test.js`                 

    javascript/node/selenium-webdriver/test/bidi/browsingcontext_test.js

    • Updated import paths to use selenium-webdriver package.
    +7/-7     
    input_test.js
    Update import paths in `input_test.js`                                     

    javascript/node/selenium-webdriver/test/bidi/input_test.js

    • Updated import paths to use selenium-webdriver package.
    +3/-3     
    local_value_test.js
    Update import paths in `local_value_test.js`                         

    javascript/node/selenium-webdriver/test/bidi/local_value_test.js

    • Updated import paths to use selenium-webdriver package.
    +6/-6     
    locate_nodes_test.js
    Update import paths in `locate_nodes_test.js`                       

    javascript/node/selenium-webdriver/test/bidi/locate_nodes_test.js

    • Updated import paths to use selenium-webdriver package.
    +8/-8     
    log_inspector_test.js
    Update import paths in `log_inspector_test.js`                     

    javascript/node/selenium-webdriver/test/bidi/log_inspector_test.js

    • Updated import paths to use selenium-webdriver package.
    +3/-3     
    network_commands_test.js
    Update import paths in `network_commands_test.js`               

    javascript/node/selenium-webdriver/test/bidi/network_commands_test.js

    • Updated import paths to use selenium-webdriver package.
    +8/-8     
    network_test.js
    Update import paths in `network_test.js`                                 

    javascript/node/selenium-webdriver/test/bidi/network_test.js

    • Updated import paths to use selenium-webdriver package.
    +3/-3     
    script_test.js
    Update import paths in `script_test.js`                                   

    javascript/node/selenium-webdriver/test/bidi/script_test.js

    • Updated import paths to use selenium-webdriver package.
    +14/-9   
    setFiles_command_test.js
    Update import paths in `setFiles_command_test.js`               

    javascript/node/selenium-webdriver/test/bidi/setFiles_command_test.js

    • Updated import paths to use selenium-webdriver package.
    +5/-5     
    storage_test.js
    Update import paths in `storage_test.js`                                 

    javascript/node/selenium-webdriver/test/bidi/storage_test.js

    • Updated import paths to use selenium-webdriver package.
    +6/-6     
    builder_test.js
    Update import paths in `builder_test.js`                                 

    javascript/node/selenium-webdriver/test/builder_test.js

    • Updated import paths to use selenium-webdriver package.
    +8/-8     
    devtools_test.js
    Update import paths in `devtools_test.js`                               

    javascript/node/selenium-webdriver/test/chrome/devtools_test.js

    • Updated import paths to use selenium-webdriver package.
    +5/-5     
    options_test.js
    Update import paths in `options_test.js`                                 

    javascript/node/selenium-webdriver/test/chrome/options_test.js

    • Updated import paths to use selenium-webdriver package.
    +2/-2     
    permission_test.js
    Update import paths in `permission_test.js`                           

    javascript/node/selenium-webdriver/test/chrome/permission_test.js

    • Updated import paths to use selenium-webdriver package.
    +2/-2     
    service_test.js
    Update import paths in `service_test.js`                                 

    javascript/node/selenium-webdriver/test/chrome/service_test.js

    • Updated import paths to use selenium-webdriver package.
    +2/-2     
    cookie_test.js
    Update import paths in `cookie_test.js`                                   

    javascript/node/selenium-webdriver/test/cookie_test.js

    • Updated import paths to use selenium-webdriver package.
    +1/-1     
    devtools_test.js
    Update import paths in `devtools_test.js`                               

    javascript/node/selenium-webdriver/test/devtools_test.js

    • Updated import paths to use selenium-webdriver package.
    +2/-2     
    options_test.js
    Update import paths in `options_test.js`                                 

    javascript/node/selenium-webdriver/test/edge/options_test.js

    • Updated import paths to use selenium-webdriver package.
    +2/-2     
    service_test.js
    Update import paths in `service_test.js`                                 

    javascript/node/selenium-webdriver/test/edge/service_test.js

    • Updated import paths to use selenium-webdriver package.
    +2/-2     
    elementAccessibleName_test.js
    Update import paths in `elementAccessibleName_test.js`     

    javascript/node/selenium-webdriver/test/elementAccessibleName_test.js

    • Updated import paths to use selenium-webdriver package.
    +1/-1     
    elementAriaRole_test.js
    Update import paths in `elementAriaRole_test.js`                 

    javascript/node/selenium-webdriver/test/elementAriaRole_test.js

    • Updated import paths to use selenium-webdriver package.
    +1/-1     
    element_finding_test.js
    Update import paths in `element_finding_test.js`                 

    javascript/node/selenium-webdriver/test/element_finding_test.js

    • Updated import paths to use selenium-webdriver package.
    +3/-4     
    execute_script_test.js
    Update import paths in `execute_script_test.js`                   

    javascript/node/selenium-webdriver/test/execute_script_test.js

    • Updated import paths to use selenium-webdriver package.
    +1/-1     
    addon_test.js
    Update import paths in `addon_test.js`                                     

    javascript/node/selenium-webdriver/test/firefox/addon_test.js

    • Updated import paths to use selenium-webdriver package.
    +2/-2     
    contextSwitching_test.js
    Update import paths in `contextSwitching_test.js`               

    javascript/node/selenium-webdriver/test/firefox/contextSwitching_test.js

    • Updated import paths to use selenium-webdriver package.
    +3/-3     
    full_page_screenshot_test.js
    Update import paths in `full_page_screenshot_test.js`       

    javascript/node/selenium-webdriver/test/firefox/full_page_screenshot_test.js

    • Updated import paths to use selenium-webdriver package.
    +1/-1     
    options_test.js
    Update import paths in `options_test.js`                                 

    javascript/node/selenium-webdriver/test/firefox/options_test.js

    • Updated import paths to use selenium-webdriver package.
    +4/-4     
    frame_test.js
    Update import paths in `frame_test.js`                                     

    javascript/node/selenium-webdriver/test/frame_test.js

    • Updated import paths to use selenium-webdriver package.
    +1/-1     
    http_test.js
    Update import paths in `http_test.js`                                       

    javascript/node/selenium-webdriver/test/http/http_test.js

    • Updated import paths to use selenium-webdriver package.
    +2/-2     
    util_test.js
    Update import paths in `util_test.js`                                       

    javascript/node/selenium-webdriver/test/http/util_test.js

    • Updated import paths to use selenium-webdriver package.
    +2/-2     
    options_test.js
    Update import paths in `options_test.js`                                 

    javascript/node/selenium-webdriver/test/ie/options_test.js

    • Updated import paths to use selenium-webdriver package.
    +2/-2     
    api_test.js
    Update import paths in `api_test.js`                                         

    javascript/node/selenium-webdriver/test/lib/api_test.js

    • Updated import paths to use selenium-webdriver package.
    +1/-1     
    capabilities_test.js
    Update import paths in `capabilities_test.js`                       

    javascript/node/selenium-webdriver/test/lib/capabilities_test.js

    • Updated import paths to use selenium-webdriver package.
    +6/-6     
    form_submit_test.js
    Update import paths in `form_submit_test.js`                         

    javascript/node/selenium-webdriver/test/lib/form_submit_test.js

    • Updated import paths to use selenium-webdriver package.
    +1/-1     
    webdriver_script_test.js
    Update import paths in `webdriver_script_test.js`               

    javascript/node/selenium-webdriver/test/lib/webdriver_script_test.js

    • Updated import paths to use selenium-webdriver package.
    +1/-2     
    page_loading_test.js
    Update import paths in `page_loading_test.js`                       

    javascript/node/selenium-webdriver/test/page_loading_test.js

    • Updated import paths to use selenium-webdriver package.
    +2/-2     
    print_pdf_test.js
    Update import paths in `print_pdf_test.js`                             

    javascript/node/selenium-webdriver/test/print_pdf_test.js

    • Updated import paths to use selenium-webdriver package.
    +1/-1     
    proxy_test.js
    Update import paths in `proxy_test.js`                                     

    javascript/node/selenium-webdriver/test/proxy_test.js

    • Updated import paths to use selenium-webdriver package.
    +2/-2     
    rect_test.js
    Update import paths in `rect_test.js`                                       

    javascript/node/selenium-webdriver/test/rect_test.js

    • Updated import paths to use selenium-webdriver package.
    +1/-1     
    remote_test.js
    Update import paths in `remote_test.js`                                   

    javascript/node/selenium-webdriver/test/remote_test.js

    • Updated import paths to use selenium-webdriver package.
    +4/-4     
    safari_test.js
    Update import paths in `safari_test.js`                                   

    javascript/node/selenium-webdriver/test/safari_test.js

    • Updated import paths to use selenium-webdriver package.
    +1/-1     
    select_test.js
    Update import paths in `select_test.js`                                   

    javascript/node/selenium-webdriver/test/select_test.js

    • Updated import paths to use selenium-webdriver package.
    +2/-2     
    stale_element_test.js
    Update import paths in `stale_element_test.js`                     

    javascript/node/selenium-webdriver/test/stale_element_test.js

    • Updated import paths to use selenium-webdriver package.
    +1/-1     
    upload_test.js
    Update import paths in `upload_test.js`                                   

    javascript/node/selenium-webdriver/test/upload_test.js

    • Updated import paths to use selenium-webdriver package.
    +3/-3     
    virtualAuthenticator_test.js
    Update import paths in `virtualAuthenticator_test.js`       

    javascript/node/selenium-webdriver/test/virtualAuthenticator_test.js

    • Updated import paths to use selenium-webdriver package.
    +5/-5     
    webComponent_test.js
    Update import paths in `webComponent_test.js`                       

    javascript/node/selenium-webdriver/test/webComponent_test.js

    • Updated import paths to use selenium-webdriver package.
    +1/-1     
    window_test.js
    Update import paths in `window_test.js`                                   

    javascript/node/selenium-webdriver/test/window_test.js

    • Updated import paths to use selenium-webdriver package.
    +2/-2     

    💡 PR-Agent usage:
    Comment /help on the PR to get a list of all available PR-Agent tools and their descriptions

    @shs96c shs96c changed the title Rbe js browser tests 2 [js + bazel]: Run Node browser tests on the RBE Jun 27, 2024
    Copy link
    Contributor

    PR Reviewer Guide 🔍

    ⏱️ Estimated effort to review [1-5] 4
    🧪 Relevant tests No
    🔒 Security concerns No
    ⚡ Key issues to review Possible Bug:
    The changes in resources.js introduce a new way to handle file paths using runfiles.resolve(filePath). This could potentially change the behavior of the exports.locate function, especially if the runfiles.resolve fails and falls through to the error. It's important to ensure that this new approach does not break existing functionality or introduce path resolution issues in different environments.
    Refactoring Needed:
    The PR includes changes to import paths across multiple test files, changing them from relative to absolute imports using the 'selenium-webdriver' package. This is a significant change that could impact how modules are resolved and loaded. Thorough testing is needed to ensure that these changes do not affect the functionality of the tests and that all modules are correctly located and loaded in all supported environments.

    Copy link
    Contributor

    PR Code Suggestions ✨

    CategorySuggestion                                                                                                                                    Score
    Maintainability
    Reduce code duplication by extracting browser setup logic into a separate function

    Extract the repeated logic for setting up browser services and options into a separate
    function to reduce code duplication and improve maintainability.

    javascript/node/selenium-webdriver/testing/index.js [297-308]

    -if ('SE_CHROMEDRIVER' in process.env) {
    -  const found = locate(process.env.SE_CHROMEDRIVER)
    -  const service = new chrome.ServiceBuilder(found)
    -  builder.setChromeService(service)
    +function setupBrowser(browserName, envVars, builder) {
    +  if (envVars.driver in process.env) {
    +    const found = locate(process.env[envVars.driver])
    +    const service = new browserName.ServiceBuilder(found)
    +    builder[`set${browserName}Service`](service)
    +  }
    +  if (envVars.binary in process.env) {
    +    const binary = locate(process.env[envVars.binary])
    +    const options = new browserName.Options()
    +    options.setBinary(binary)
    +    options.setAcceptInsecureCerts(true)
    +    options.addArguments('disable-infobars', 'disable-breakpad', 'disable-dev-shm-usage', 'no-sandbox')
    +    builder[`set${browserName}Options`](options)
    +  }
     }
    -if ('SE_CHROME' in process.env) {
    -  const binary = locate(process.env.SE_CHROME)
    -  const options = new chrome.Options()
    -  options.setChromeBinaryPath(binary)
    -  options.setAcceptInsecureCerts(true)
    -  options.addArguments('disable-infobars', 'disable-breakpad', 'disable-dev-shm-usage', 'no-sandbox')
    -  builder.setChromeOptions(options)
    -}
    +setupBrowser(chrome, { driver: 'SE_CHROMEDRIVER', binary: 'SE_CHROME' }, builder);
     
    • Apply this suggestion
    Suggestion importance[1-10]: 9

    Why: This suggestion significantly improves maintainability by reducing code duplication and encapsulating the browser setup logic into a reusable function. It addresses a major concern in terms of code maintainability.

    9
    Reduce the number of import statements by using destructuring

    Consider destructuring the selenium-webdriver imports to maintain consistency and reduce
    the number of import statements.

    javascript/node/selenium-webdriver/test/chrome/permission_test.js [21-24]

    -const chrome = require('selenium-webdriver/chrome')
    -const { Browser } = require('selenium-webdriver/index')
    +const { chrome, Browser } = require('selenium-webdriver')
     
    • Apply this suggestion
    Suggestion importance[1-10]: 8

    Why: The suggestion improves code maintainability by reducing the number of import statements, making the code cleaner and more consistent.

    8
    Combine similar imports into a single line for better readability

    Combine similar imports from 'selenium-webdriver' into a single line to improve code
    readability.

    javascript/node/selenium-webdriver/test/edge/options_test.js [22-23]

    -const edge = require('selenium-webdriver/edge')
    -const symbols = require('selenium-webdriver/lib/symbols')
    +const { edge, symbols } = require('selenium-webdriver')
     
    • Apply this suggestion
    Suggestion importance[1-10]: 8

    Why: Combining similar imports into a single line improves code readability and maintainability, making it easier to manage.

    8
    Verify the necessity of the "supports-color" dependency and remove if not needed

    Ensure that the newly added dependency "supports-color" is necessary for the project. If
    it is not explicitly required, consider removing it to keep the package lightweight and to
    reduce the potential attack surface.

    javascript/node/selenium-webdriver/package.json [50]

    -"supports-color": "^9.4.0"
    +""
     
    • Apply this suggestion
    Suggestion importance[1-10]: 7

    Why: Ensuring that all dependencies are necessary helps keep the package lightweight and reduces the potential attack surface. This suggestion is good for maintainability but requires verification of the dependency's necessity.

    7
    Best practice
    Add a resolution strategy to handle version conflicts and ensure dependency consistency

    Consider adding a resolution strategy in the package.json for handling potential version
    conflicts among dependencies, especially since multiple new dependencies with broad
    version ranges are being introduced.

    javascript/node/selenium-webdriver/package.json [25-29]

     "dependencies": {
    -  "@bazel/runfiles": "^5.8.1",
    -  "jszip": "^3.10.1",
    -  "tmp": "^0.2.3",
    -  "ws": "^8.17.1"
    +  "@bazel/runfiles": "5.8.1",
    +  "jszip": "3.10.1",
    +  "tmp": "0.2.3",
    +  "ws": "8.17.1"
    +},
    +"resolutions": {
    +  "@bazel/runfiles": "5.8.1",
    +  "jszip": "3.10.1",
    +  "tmp": "0.2.3",
    +  "ws": "8.17.1"
     }
     
    • Apply this suggestion
    Suggestion importance[1-10]: 9

    Why: Adding a resolution strategy can help manage potential version conflicts among dependencies, ensuring consistency and stability in the project. This is a proactive approach to dependency management.

    9
    Pin the version of "@bazel/runfiles" to a specific version for more reliable builds

    Consider pinning the version of "@bazel/runfiles" to a specific version rather than using
    a version range. This can help ensure consistent builds and avoid potential issues with
    automatic updates that might introduce breaking changes.

    javascript/node/selenium-webdriver/package.json [26]

    -"@bazel/runfiles": "^5.8.1",
    +"@bazel/runfiles": "5.8.1",
     
    • Apply this suggestion
    Suggestion importance[1-10]: 8

    Why: Pinning the version of "@bazel/runfiles" can help ensure consistent builds and avoid potential issues with automatic updates that might introduce breaking changes. This is a best practice for maintaining stability.

    8
    Simplify module imports by using consistent and less deep path references

    Use consistent import paths for modules from 'selenium-webdriver', avoiding deep path
    references where possible.

    javascript/node/selenium-webdriver/test/http/http_test.js [24-25]

    -const HttpClient = require('selenium-webdriver/http').HttpClient
    -const HttpRequest = require('selenium-webdriver/lib/http').Request
    +const { HttpClient, HttpRequest } = require('selenium-webdriver/http')
     
    • Apply this suggestion
    Suggestion importance[1-10]: 7

    Why: This suggestion enhances code readability and maintainability by avoiding deep path references, which is a good practice.

    7
    Improve error message readability by using template literals

    Use template literals for error messages to improve readability and maintainability.

    javascript/node/selenium-webdriver/testing/index.js [565]

    -throw new Error('Unable to locate (no repo mapping file): ' + fileLike)
    +throw new Error(`Unable to locate (no repo mapping file): ${fileLike}`)
     
    • Apply this suggestion
    Suggestion importance[1-10]: 6

    Why: Using template literals for error messages enhances readability and maintainability. This is a good practice but is a minor improvement in the context of the overall code.

    6
    Use more descriptive variable names to enhance code clarity

    Consider using a more descriptive variable name than found to enhance code clarity.

    javascript/node/selenium-webdriver/testing/index.js [298-300]

    -const found = locate(process.env.SE_CHROMEDRIVER)
    -const service = new chrome.ServiceBuilder(found)
    +const chromeDriverPath = locate(process.env.SE_CHROMEDRIVER)
    +const service = new chrome.ServiceBuilder(chromeDriverPath)
     builder.setChromeService(service)
     
    • Apply this suggestion
    Suggestion importance[1-10]: 6

    Why: More descriptive variable names improve code clarity and readability. This is a minor enhancement but contributes positively to the codebase.

    6
    Use shallower paths for module imports to enhance manageability and cleanliness of code

    Avoid using deep paths for importing modules to make the import statements cleaner and
    more manageable.

    javascript/node/selenium-webdriver/test/devtools_test.js [23]

    -const { HttpResponse } = require('selenium-webdriver/devtools/networkinterceptor')
    +const { HttpResponse } = require('selenium-webdriver/devtools')
     
    • Apply this suggestion
    Suggestion importance[1-10]: 6

    Why: Using shallower paths for imports makes the code cleaner and more manageable, though the improvement is relatively minor.

    6
    Add visibility attribute to js_library rule

    Consider adding a visibility attribute to the js_library rule to restrict or allow access
    as needed. This helps in managing package accessibility across different parts of the
    Bazel build environment.

    javascript/node/selenium-webdriver/BUILD.bazel [119-124]

     js_library(
         name = "node_modules/@bazel/runfiles",
         srcs = glob([
             "test/**/*_test.js",
         ]),
         deps = [
             ":node_modules/@bazel/runfiles",
         ],
    +    visibility = ["//visibility:public"]
     )
     
    • Apply this suggestion
    Suggestion importance[1-10]: 6

    Why: Adding a visibility attribute is a best practice for managing package accessibility in Bazel, but it is not crucial for the functionality of the code.

    6
    Possible issue
    Ensure version consistency in the dependency specifier

    Ensure that the version specifier for @bazel/runfiles is consistent with the version
    number. The specifier uses a caret (^), which allows minor updates, but the version is
    specified exactly as 5.8.1. If the intention is to allow minor updates, the version should
    also reflect this flexibility.

    pnpm-lock.yaml [101-103]

     '@bazel/runfiles':
       specifier: ^5.8.1
    -  version: 5.8.1
    +  version: ^5.8.1
     
    • Apply this suggestion
    Suggestion importance[1-10]: 8

    Why: The suggestion addresses a potential issue with version consistency, which can prevent unexpected behavior during dependency resolution. This is important for maintaining a stable build environment.

    8
    Review the necessity of adding [email protected] to multiple dependencies

    The addition of [email protected] to various dependencies should be reviewed for
    necessity and potential version conflicts, especially since it is added globally to many
    packages. This could lead to dependency resolution issues if different packages require
    different versions of supports-color.

    pnpm-lock.yaml [122]

    -eslint: 9.5.0([email protected])
    +eslint: 9.5.0
     
    • Apply this suggestion
    Suggestion importance[1-10]: 7

    Why: The suggestion highlights a potential issue with adding the same dependency version across multiple packages, which could lead to conflicts. This is a valid concern for dependency management.

    7
    Compatibility
    Check and pin the version of "sinon" to ensure compatibility with the project's existing dependencies

    Review the version constraints for all newly added dependencies to ensure they are
    compatible with the existing ecosystem of the project, particularly focusing on "sinon"
    which has a major version update.

    javascript/node/selenium-webdriver/package.json [49]

    -"sinon": "^17.0.1",
    +"sinon": "17.0.1",
     
    • Apply this suggestion
    Suggestion importance[1-10]: 8

    Why: Pinning the version of "sinon" can help avoid compatibility issues with the project's existing dependencies, especially since it involves a major version update. This is important for maintaining compatibility.

    8
    Enhancement
    Improve code readability by using destructuring for environment variables

    Consider using destructuring for the process.env object to make the code cleaner and more
    readable.

    javascript/node/selenium-webdriver/testing/index.js [297-300]

    -if ('SE_CHROMEDRIVER' in process.env) {
    -  const found = locate(process.env.SE_CHROMEDRIVER)
    +const { SE_CHROMEDRIVER } = process.env;
    +if (SE_CHROMEDRIVER) {
    +  const found = locate(SE_CHROMEDRIVER)
       const service = new chrome.ServiceBuilder(found)
       builder.setChromeService(service)
     }
     
    • Apply this suggestion
    Suggestion importance[1-10]: 7

    Why: The suggestion improves code readability and maintainability by using destructuring, which is a cleaner approach. However, the improvement is minor and does not address any critical issues.

    7
    Possible bug
    Verify the definition and accessibility of the BROWSERS dictionary

    Ensure that the BROWSERS dictionary is properly defined and accessible in the scope where
    it's used, as it's critical for the configuration of environment variables and additional
    data in the mocha_test rules.

    javascript/node/selenium-webdriver/BUILD.bazel [171-174]

    +# Ensure BROWSERS is defined and accessible
     ] + BROWSERS[browser]["data"],
     env = {
         "SELENIUM_BROWSER": browser,
     } | BROWSERS[browser]["env"],
     
    • Apply this suggestion
    Suggestion importance[1-10]: 5

    Why: The suggestion is valid but somewhat redundant, as the usage of BROWSERS in the code implies it is already defined and accessible. It is more of a reminder than a necessary change.

    5

    @shs96c shs96c merged commit fe7e7c7 into SeleniumHQ:trunk Jun 27, 2024
    11 checks passed
    @shs96c shs96c deleted the rbe-js-browser-tests-2 branch June 27, 2024 17:33
    sandeepsuryaprasad pushed a commit to sandeepsuryaprasad/selenium that referenced this pull request Oct 29, 2024
    If you `cd` into `javascript/node/selenium-webdriver` a `pnpm`-based workflow should still work.
    
    This PR also removes a now unused ci-javascript.yml file: everything that this used to do is now handled by the RBE.
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    2 participants