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

[WebDriver BiDi] allow grapheme in key input #46301

Merged
merged 1 commit into from
Jan 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions webdriver/tests/bidi/input/perform_actions/invalid.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,9 +376,16 @@ async def test_params_key_action_value_invalid_type(perform_actions,

@pytest.mark.parametrize(
"value",
["fa", "\u0BA8\u0BBFb", "\u0BA8\u0BBF\u0BA8", "\u1100\u1161\u11A8c"],
[
"fa", # 2 symbols.
"\U0001F604a", # "😄a" a codepoint with a symbol.
"\u0BA8\u0BBFa", # "நிa" a grapheme with a symbol.
"\u1100\u1161\u11A8a", # "각a" a grapheme with a symbol.
"\u2764\ufe0fa", # "❤️a" a grapheme with a symbol.
"\U0001F604\U0001F60D", # "😄😍" 2 graphemes.
],
)
async def test_params_key_action_value_invalid_multiple_codepoints(
async def test_params_key_action_value_invalid_multiple_graphemes(
perform_actions, value):
actions = [
create_key_action("keyDown", {"value": value}),
Expand Down
10 changes: 5 additions & 5 deletions webdriver/tests/bidi/input/perform_actions/key.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ async def test_key_backspace(bidi_session, top_context, setup_key_test):
@pytest.mark.parametrize(
"value",
[
("\U0001F604"),
("\U0001F60D"),
("\u0BA8\u0BBF"),
("\u1100\u1161\u11A8"),
"\U0001F604", # "😄" (\ud83d\ude04), a single surrogate codepoint.
"\u0BA8\u0BBF", # "நி" (\u0BA8\u0BBF), a grapheme containing several chars.
"\u1100\u1161\u11A8", # "각" (\u1100\u1161\u11A8), a grapheme containing several chars.
"\u2764\ufe0f", # "❤️" (\u2764\ufe0f), a grapheme containing several codepoints.
],
)
async def test_key_codepoint(
async def test_key_grapheme(
bidi_session, top_context, setup_key_test, value
):
# Not using send_keys() because we always want to treat value as
Expand Down