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] fix: return statement in submit() #11883

Merged
merged 2 commits into from
Apr 18, 2023

Conversation

TamsilAmani
Copy link
Contributor

@TamsilAmani TamsilAmani commented Apr 11, 2023

Description

The value evaluated by the submit() was not being returned.

Motivation and Context

Help developers who use selenium to get correct result.

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.

@harsha509
Copy link
Member

Makes sense!

Thank you @TamsilAmani !

harsha509
harsha509 previously approved these changes Apr 11, 2023
Copy link
Member

@harsha509 harsha509 left a comment

Choose a reason for hiding this comment

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

Thank you @TamsilAmani !

@titusfortner
Copy link
Member

What result are we expecting from submit? It's an action on the browser, so the return should be null

@harsha509 harsha509 dismissed their stale review April 11, 2023 17:49

Checked the code again after @titusfortner comment, looks like it is only returning null. Do you have any use case tamsil ?

@swrdfish
Copy link

swrdfish commented Apr 11, 2023

@titusfortner @harsha509
Thank you for looking into this.

I stumbled upon this bug while working on Nightwatch. The problem is that .submit() is supposed to return a promise, which can be used to wait for the command to complete. Without the promise we cannot ensure that subsequent actions behave deterministically. It is not the value we are interested in but the promise to let us know when the command has finished.

@titusfortner titusfortner merged commit 395a926 into SeleniumHQ:trunk Apr 18, 2023
14 of 17 checks passed
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.

None yet

4 participants