Skip to content

fix: replace fill('') with keyboard select-all and backspace for clipboard paste setup#3297

Merged
Ziinc merged 2 commits intoLogflare:mainfrom
laraujo7:la/firefox-webkit-schema_modal-fix
Mar 30, 2026
Merged

fix: replace fill('') with keyboard select-all and backspace for clipboard paste setup#3297
Ziinc merged 2 commits intoLogflare:mainfrom
laraujo7:la/firefox-webkit-schema_modal-fix

Conversation

@laraujo7
Copy link
Copy Markdown
Contributor

No description provided.

@laraujo7 laraujo7 force-pushed the la/firefox-webkit-schema_modal-fix branch from 56b4243 to 667fa39 Compare March 18, 2026 09:32
@nelsonmestevao
Copy link
Copy Markdown
Contributor

@Ziinc this one fixes the UI issue in webkit/firefox so it reverts #3294 🙏


const modifier = process.platform === 'darwin' ? 'Meta' : 'Control';

await page.keyboard.press(`${modifier}+A`);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is there a reason why this is needed?
Should add an inline comment for docs.

Copy link
Copy Markdown
Contributor Author

@laraujo7 laraujo7 Mar 18, 2026

Choose a reason for hiding this comment

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

In this test, we verify that the copied fields (id, status, timestamp, etc.) are the ones we expect. We do this by pasting the value into a text input and then checking it. Since we use the same input to verify different fields, we first need to delete the previously pasted value before pasting the next one.

I’m not sure why the fill suddenly stopped working, so this is a workaround for it.

Copy link
Copy Markdown
Contributor Author

@laraujo7 laraujo7 Mar 18, 2026

Choose a reason for hiding this comment

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

Added inline comments ✅

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

could we not use navigator.clipboard.readText() as a more efficient way to read the clipboard?
https://stackoverflow.com/questions/72265518/how-to-access-the-clipboard-contents-using-playwright-in-typescript

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I tried that, had to add a different config and it only worked on chromium 😞

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

i see. perhaps a page reload between each assertion would be less hacky to at least clear input state

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this feels like a really odd workaround for something that should be quite straightforward. can we rethink the approach please.

Copy link
Copy Markdown
Contributor Author

@laraujo7 laraujo7 Mar 23, 2026

Choose a reason for hiding this comment

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

@Ziinc I left some comments about this issue. I've also come up with a somewhat different approach — instead of relying on an already existing input, I create my own to test against and then remove it afterward. Let me know what you think.

@laraujo7 laraujo7 force-pushed the la/firefox-webkit-schema_modal-fix branch from 667fa39 to 7021024 Compare March 18, 2026 11:03
@laraujo7 laraujo7 force-pushed the la/firefox-webkit-schema_modal-fix branch from 7021024 to 52fb425 Compare March 23, 2026 20:18
@laraujo7 laraujo7 force-pushed the la/firefox-webkit-schema_modal-fix branch from 52fb425 to b2222ea Compare March 24, 2026 12:03
Copy link
Copy Markdown
Contributor

@Ziinc Ziinc left a comment

Choose a reason for hiding this comment

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

Much cleaner 👍

@Ziinc Ziinc merged commit 810bf23 into Logflare:main Mar 30, 2026
6 checks passed
Ziinc added a commit that referenced this pull request Apr 10, 2026
…board paste setup (#3297)

Co-authored-by: Ziinc <Ziinc@users.noreply.github.com>
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.

3 participants