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

Add browsername capabilities to Grid #8449

Merged
merged 7 commits into from
Jun 24, 2020
Merged

Conversation

shucon
Copy link
Contributor

@shucon shucon commented Jun 22, 2020

Partial-PR: #8020

Thanks for contributing to Selenium!
A PR well described will help maintainers to quickly review and merge it

Before submitting your PR, please check our contributing guidelines.
Avoid large PRs, help reviewers by making them as simple and short as possible.

Description

Motivation and Context

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • I have read the contributing document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@shucon
Copy link
Contributor Author

shucon commented Jun 23, 2020

@shs96c @AutomatedTester

Copy link
Member

@shs96c shs96c left a comment

Choose a reason for hiding this comment

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

The "stereotype" is used when taking an incoming new session request to figure out which slot may be able to help. Because of this, it should be pretty minimal. Why? Because the local end (the RemoteWebDriver) tend to just ask for a particular browser name. As such, because everything added to the canonical/stereotypical capabilities MUST be matched in the request coming from the local end, you'll end up with a lot more failures when creating sessions.

java/server/src/org/openqa/selenium/grid/graphql/Grid.java Outdated Show resolved Hide resolved
java/server/src/org/openqa/selenium/grid/graphql/Node.java Outdated Show resolved Hide resolved
this.id = Require.nonNull("Node id", id);
this.uri = Require.nonNull("Node uri", uri);
this.isUp = isUp;
this.maxSession = Require.nonNull("Node maxSession", maxSession);
this.capabilities = Require.nonNull("Node capabilities", capabilities.toString());
Copy link
Member

Choose a reason for hiding this comment

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

Better to convert this to a JSON blob rather than the string representation of a java datastructure.

@shucon shucon requested a review from shs96c June 24, 2020 09:09
Copy link
Member

@shs96c shs96c left a comment

Choose a reason for hiding this comment

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

Once the nit is addressed, this LGTM

this.id = Require.nonNull("Node id", id);
this.uri = Require.nonNull("Node uri", uri);
this.isUp = isUp;
this.maxSession = Require.nonNull("Node maxSession", maxSession);
this.capabilities = Require.nonNull("Node capabilities", new Json().toJson(capabilities));
Copy link
Member

Choose a reason for hiding this comment

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

Nit: Make this a private constant in the class, as some of the state picked up by reflection is stored.

@shs96c shs96c merged commit 8ea8077 into SeleniumHQ:master Jun 24, 2020
@shs96c
Copy link
Member

shs96c commented Jun 24, 2020

OK. This looks good. Thank you!

titusfortner pushed a commit to titusfortner/selenium that referenced this pull request Aug 13, 2020
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.

2 participants