Skip to content
This repository has been archived by the owner on Jan 29, 2021. It is now read-only.

codegen: fails to capture certain websites #2

Closed
aslushnikov opened this issue Jul 7, 2020 · 1 comment
Closed

codegen: fails to capture certain websites #2

aslushnikov opened this issue Jul 7, 2020 · 1 comment

Comments

@aslushnikov
Copy link
Contributor

https://github.com

Launch playwright-cli record https://github.com and then clicking in the search in the top right corner, type "playwright" and hit "enter". Typing is missing.

const assert = require('assert');
const { chromium, firefox, webkit } = require('playwright');

(async() => {
  const browser = await chromium.launch();
  const page = await browser.newPage();

  // Go to https://github.com/
  await page.goto('https://github.com/');

  // 0× click
  await page.click('li[id=jump-to-suggestion-search-global]');
  assert.equal(page.url(), 'https://github.com/search?q=playwright');
})();

https://playwright.dev

Launch playwright-cli record https://playwright.dev, click search and try typing evaluate there. The generated selector is broken

const assert = require('assert');
const { chromium, firefox, webkit } = require('playwright');

(async() => {
  const browser = await chromium.launch();
  const page = await browser.newPage();

  // Go to https://playwright.dev/
  await page.goto('https://playwright.dev/');

  // Click <selector>
  await page.click('<selector>');

  // Fill <selector>
  await page.fill('<selector>', 'evaluate');
  assert.equal(page.url(), 'https://playwright.dev/#version=v1.2.0&path=docs%2Fapi.md&q=pageevaluatepagefunction-arg');
})();

https://theverge.com

  1. Launch playwright-cli record https://theverge.com, try clicking on any article. Generated selector is broken - it's simply img[alt=""].
const assert = require('assert');
const { chromium, firefox, webkit } = require('playwright');

(async() => {
  const browser = await chromium.launch();
  const page = await browser.newPage();

  // Go to https://www.theverge.com/
  await page.goto('https://www.theverge.com/');

  // Click img[alt=""]
  await Promise.all([
    page.waitForNavigation({ url: 'https://www.theverge.com/2020/7/7/21314972/away-employees-ceo-steph-korey-resign-native-american-costume' }),
    page.click('img[alt=""]')
  ]);
})();
  1. Clicking on any menus on theVerge.com is not captured as well.

https://bbc.com

Launch playwright-cli record https://bbc.com, try clicking on any article. The generated selector has wrongly escaped quotes, and doesn't point to the element I clicked.

const assert = require('assert');
const { chromium, firefox, webkit } = require('playwright');

(async() => {
  const browser = await chromium.launch();
  const page = await browser.newPage();

  // Go to https://www.bbc.com/
  await page.goto('https://www.bbc.com/');

  // Click div[id=page] text=/\s*Brazil's Bolsonaro tests positive for Covid-19\s*/
  await page.click('div[id=page] text=/\\s*Brazil\\'s Bolsonaro tests positive for Covid-19\\s*/');
})();
@dgozman dgozman changed the title recorder bugs: recorder fails to capture certain websites codegen: fails to capture certain websites Sep 2, 2020
@mxschmitt
Copy link
Member

Went through them:

GitHub

passes

playwright.dev

since we load the content on-demand the generated code fails and wants to search too early. (networkidle would fix it)

bbc

We should think about some way to show to the user that a element does not fulfil our actionability criteria. Currently a Promise rejection will be shown:

Uncaught (in promise) frame.click: Timeout 10000ms exceeded.
=========================== logs ===========================
waiting for selector "text=/.*Biden meets family of black ma.*/"
  selector resolved to visible <x-pw-tooltip>text=/.*Biden meets family of black ma.*/</x-pw-tooltip>
attempting click action
  waiting for element to be visible, enabled and not moving
  element is visible, enabled and does not move
  scrolling into view if needed
  done scrolling
  checking that element receives pointer events at (433.03,290.18)
  <article id="sty_54017735" data-reactid=".1u5nzq99e16.1.0…>…</article> from <body class=" bbccom_mpu_middle  bbccom_mpu_middle_sma…>…</body> subtree intercepts pointer events
retrying click action
  waiting for element to be visible, enabled and not moving
  element is visible, enabled and does not move
  scrolling into view if needed
  done scrolling
  checking that element receives pointer events at (433.03,290.18)
  <article id="sty_54017735" data-reactid=".1u5nzq99e16.1.0…>…</article> from <body class=" bbccom_mpu_middle  bbccom_mpu_middle_sma…>…</body> subtree intercepts pointer events
retrying click action
  waiting for element to be visible, enabled and not moving
  element is visible, enabled and does not move
  scrolling into view if needed
  done scrolling
  checking that element receives pointer events at (433.03,290.18)
  <article id="sty_54017735" data-reactid=".1u5nzq99e16.1.0…>…</article> from <body class=" bbccom_mpu_middle  bbccom_mpu_middle_sma…>…</body> subtree intercepts pointer events
retrying click action
  waiting for element to be visible, enabled and not moving
  element is visible, enabled and does not move
  scrolling into view if needed
  done scrolling
  checking that element receives pointer events at (433.03,290.18)
  <article id="sty_54017735" data-reactid=".1u5nzq99e16.1.0…>…</article> from <body class=" bbccom_mpu_middle  bbccom_mpu_middle_sma…>…</body> subtree intercepts pointer events
retrying click action
  waiting for element to be visible, enabled and not moving
  element is visible, enabled and does not move
  scrolling into view if needed
  done scrolling
  checking that element receives pointer events at (433.03,290.18)
  <article id="sty_54017735" data-reactid=".1u5nzq99e16.1.0…>…</article> from <body class=" bbccom_mpu_middle  bbccom_mpu_middle_sma…>…</body> subtree intercepts pointer events
retrying click action
  waiting for element to be visible, enabled and not moving
  element is visible, enabled and does not move
  scrolling into view if needed
  done scrolling
  checking that element receives pointer events at (433.03,290.18)
  <article id="sty_54017735" data-reactid=".1u5nzq99e16.1.0…>…</article> from <body class=" bbccom_mpu_middle  bbccom_mpu_middle_sma…>…</body> subtree intercepts pointer events
retrying click action
  waiting for element to be visible, enabled and not moving
  element is visible, enabled and does not move
  scrolling into view if needed
  done scrolling
  checking that element receives pointer events at (433.03,290.18)
  <article id="sty_54017735" data-reactid=".1u5nzq99e16.1.0…>…</article> from <body class=" bbccom_mpu_middle  bbccom_mpu_middle_sma…>…</body> subtree intercepts pointer events
retrying click action
  waiting for element to be visible, enabled and not moving
  element is visible, enabled and does not move
  scrolling into view if needed
  done scrolling
  checking that element receives pointer events at (433.03,290.18)
  <article id="sty_54017735" data-reactid=".1u5nzq99e16.1.0…>…</article> from <body class=" bbccom_mpu_middle  bbccom_mpu_middle_sma…>…</body> subtree intercepts pointer events
retrying click action
  waiting for element to be visible, enabled and not moving
  element is visible, enabled and does not move
  scrolling into view if needed
  done scrolling
  checking that element receives pointer events at (433.03,290.18)
  <article id="sty_54017735" data-reactid=".1u5nzq99e16.1.0…>…</article> from <body class=" bbccom_mpu_middle  bbccom_mpu_middle_sma…>…</body> subtree intercepts pointer events
retrying click action
  waiting for element to be visible, enabled and not moving
  element is visible, enabled and does not move
  scrolling into view if needed
  done scrolling
  checking that element receives pointer events at (433.03,290.18)
  <article id="sty_54017735" data-reactid=".1u5nzq99e16.1.0…>…</article> from <body class=" bbccom_mpu_middle  bbccom_mpu_middle_sma…>…</body> subtree intercepts pointer events
retrying click action
  waiting for element to be visible, enabled and not moving
  element is visible, enabled and does not move
  scrolling into view if needed
  done scrolling
  checking that element receives pointer events at (433.03,290.18)
  <article id="sty_54017735" data-reactid=".1u5nzq99e16.1.0…>…</article> from <body class=" bbccom_mpu_middle  bbccom_mpu_middle_sma…>…</body> subtree intercepts pointer events
retrying click action

https://www.bbc.com/news/topics/c01e560qvyxt/jacob-blake-shooting -> First entry

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants