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

fix(Entire Browser): make sure input recording with japanese IME Work #16210

Merged
merged 10 commits into from
Aug 9, 2022

Conversation

YA2KM
Copy link
Contributor

@YA2KM YA2KM commented Aug 3, 2022

fix(Entire Browser): make sure input recording with japanese IME Work

Input events are not recoreded collectry with japanese IME.

thir problem caused by invaliid key event "Prosess".
"_performAction" receives fuge amount of "Prosess Key event " in a short moment with japanese IME.

This patch fixes this problem.

This patch fixes recorder stack problem with japanese IME.
@YA2KM
Copy link
Contributor Author

YA2KM commented Aug 3, 2022

681232289.783875.mp4

Copy link
Member

@yury-s yury-s left a comment

Choose a reason for hiding this comment

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

Could you also add a test for this?

@YA2KM
Copy link
Contributor Author

YA2KM commented Aug 4, 2022

sure, why not!

taiga533 and others added 3 commits August 4, 2022 12:34
Changed the process of receiving Process key input to be performed by JavaScript injected into the page being recorded.
[Fix] Process key input acceptance processing is now handled by JavaScript injected into the Page object.
@ghost
Copy link

ghost commented Aug 4, 2022

CLA assistant check
All CLA requirements met.

@YA2KM
Copy link
Contributor Author

YA2KM commented Aug 4, 2022

@yury-s

I changed my patch with an advice by my boss like this.

packages/playwright-core/src/server/injected/recorder.ts:329
if (['Shift', 'Control', 'Meta', 'Alt', 'Process'].includes(event.key)) return false;

It works fine, But I am not sure where the test file is.

Could you kindly tell me where the file which test "injected/recorder.ts" is?

I suppose that I should just add 'Process' to the test file.

Thank you.

@mxschmitt
Copy link
Member

Here would be a nice place to add a test / test this special case:

test('should fill', async ({ page, openRecorder }) => {

@YA2KM
Copy link
Contributor Author

YA2KM commented Aug 4, 2022

Here would be a nice place to add a test / test this special case:

Thank you for your replying.

I heard about the file from my boss.
But, I would like to test the 'Process Key event ' rejection behavior.

I can fill input element by japanese and test will be passed without this patch.

But I can't record japanese Input with playwright codegen.

So ,I think i should modify here.

test('should press', async ({ page, openRecorder }) => {

I wrote test code like below, But It doesnt work due to timeout.

 const [, sources] = await Promise.all([
      recorder.waitForActionPerformed(),
      page.press('input', 'Process') //timeout.
    ]);

How do I test?
Sorry for your inconvinience.
I am newbie of playwright and not fluent eng speaker.
thank you.

This patch fixes recorder stack problem with japanese IME.
@YA2KM
Copy link
Contributor Author

YA2KM commented Aug 4, 2022

@mxschmitt
@yury-s

Hi.
My question is solved by my co-worker.
I appreciate @taiga533 s helping.

Finally, our modify is passed the test on my local enviroment.
(expecting nice result on github actions test.)
Would you mind if I ask you to review our codes?

Thank you.

@mxschmitt mxschmitt requested a review from yury-s August 7, 2022 13:33
@yury-s yury-s added the CQ1 label Aug 9, 2022
@yury-s
Copy link
Member

yury-s commented Aug 9, 2022

@YA2KM heads up, I had to revert the change as the test was failing on all bots. Feel free to open another PR with a passing test.

@mxschmitt
Copy link
Member

I think I broke it with my "formatting fixes", let me reland it.

mxschmitt pushed a commit to mxschmitt/playwright that referenced this pull request Aug 10, 2022
microsoft#16393)

Revert "fix(codegen): make sure input recording with japanese IME Work (microsoft#16210)"

This reverts commit 925de8d.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants