microsoft / playwright

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
https://playwright.dev
Apache License 2.0
66.22k stars 3.62k forks source link

[BUG]StepOver option is not stopping at a keyboard action #9166

Closed jithinjosejacob closed 2 years ago

jithinjosejacob commented 3 years ago

Context:

Code Snippet

sample test can be found here : https://github.com/jithinjosejacob/playwright_stag/blob/master/tests/TC004_geo.spec.js

const { test } = require('@playwright/test');

test('Geo location test', async ({ page }) => {
  // Open up google maps and click on Your Location button to verify that we are on MCG.
  await page.goto('https://maps.google.com');

  // For Demo Purpose pause here and show the features.
  await page.pause();

  // Verify that we are actually on MCG, by clicking on your location.
  await page.click(`//button[@aria-label='Your Location']`);
  // Wait for specific network request to complete
  await page.waitForRequest(/.*preview/);
  //await page.screenshot({ path: 'mcg-pixel4.png' });

  await page.click(`//input[@aria-label='Search Google Maps']`);
  await page.type(`//input[@aria-label='Search Google Maps']`, 'hungryjacks', { delay: 100 });
  await page.keyboard.press('Enter');
  // Wait for specific network request to complete
  await page.waitForRequest(/.*preview/);
});

Describe the bug Do a stepover on each action until user reaches line 20( page.type(//input[@aria-label='Search Google Maps'], 'hungryjacks', { delay: 100 });)

Actual Result

If user clicks Step Over, user types into input box and then presses Enter and reaches end of context

Expected Result

If user clicks Step Over, user types into input box . Wait the stepover action at Line 21 ,which is a keyboard press Enter If user clicks StepOver then press Enter

JoelEinbinder commented 3 years ago

It looks like the beforeInputAction method does not get called for input actions not taken on an element. Probably needs some special logic for finding the currently focused element.

cc @pavelfeldman

pavelfeldman commented 2 years ago

I believe that was fixed in 1.15.2

pavelfeldman commented 2 years ago

I'll close this, but please open a new issue if this still happens to you.