Clear vs ClearInput

Open
#66 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
30/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
python
Domain
testing-qa

Research direction

Start by reviewing the existing Clear action and the Selenium clear behavior described in the issue. Define the supported input cases and verify that the proposed action removes both displayed text and the underlying value, including for MUI components.

Written by the indexing model from the issue text.

Description

While testing MUI components I noticed that a simple element.clear() isn't sufficient to clear out text input fields. I came across a reference to comments in selenium source code explaining exactly what clear() does and doesn't do.

/** If this element is a text entry element, this will clear the value. Has no effect on other elements. Text entry elements are INPUT and TEXTAREA elements. Note that the events fired by this event may not be as you'd expect. In particular, we don't fire any keyboard or mouse events. If you want to ensure keyboard events are fired, consider using something like {@link #sendKeys(CharSequence...)} with the backspace key. To ensure you get a change event, consider following with a call to {@link #sendKeys(CharSequence...)} with the tab key. */

While it does remove the TEXT of a the input element, it will not remove the VALUE from the element. For MUI components this renders element.clear() nearly useless since any followup interaction with the field will often lead to the value being pushed to the text input again.

I'd like to propose a new action that is more universal (if that's even a possibility) than our current Clear(). Something that will handle removing the input along with value.

Dominant language
Python
Stars
7
Forks
2
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ScreenPyHQ/screenpy_selenium

All issues in ScreenPyHQ/screenpy_selenium

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.