-
I'm building an application that simulates a terminal window, and I have some test cases related to command history, for example. For those, I need the test runner to press the arrow up and arrow down keys. I tried several different approaches using .data() but always got "Misalignment" messages (it tries to type I didn't find anything related to this in the documentation or any discussions or issues. Is it possible to do this? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
Hi, currently this is not possible. Very soon we are overhauling the test syntax so that you can run custom playwright code (including arbitrary keypresses) - however we'd also like to enable the agent to do this natively soon as well. |
Beta Was this translation helpful? Give feedback.
-
related to #16 as well, some kind of keypress control system |
Beta Was this translation helpful? Give feedback.
-
Hey @netoabel, the 0.1.0 update we released enables running custom playwright code so you can execute arbitrary keypresses in your magnitude tests! docs here: https://docs.magnitude.run/integrations/playwright Example: import { test } from 'magnitude-test';
test('my test', async ({ ai, page }) => {
await ai.step("do something");
await page.keyboard.press('ArrowLeft');
await ai.check("some check");
}); |
Beta Was this translation helpful? Give feedback.
Hey @netoabel, the 0.1.0 update we released enables running custom playwright code so you can execute arbitrary keypresses in your magnitude tests! docs here: https://docs.magnitude.run/integrations/playwright
Example: