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

[BUG] Android screenshots repeating / tiling #26342

Closed
fractalfeeling opened this issue Aug 8, 2023 · 4 comments
Closed

[BUG] Android screenshots repeating / tiling #26342

fractalfeeling opened this issue Aug 8, 2023 · 4 comments

Comments

@fractalfeeling
Copy link

System info

  • Playwright Version: v1.36.1
  • Operating System: Samsung Galaxy S21
  • Browser: Chromium

Source code

I am trying to run tests on a mobile device and getting this bug.
The screenshots have elements repeating and not capturing the full page.

Steps

Expected

Screenshot should capture full page, not tile/repeat elements

Actual
Looks like this.
TEST-chrome-latest-mobile-Samsung-Galaxy-S21--v-12-0-browserstack-win32

@dgozman
Copy link
Contributor

dgozman commented Aug 8, 2023

@fractalfeeling When you say "Run test on Browserstack on mobile", what exactly does that mean? Could you share a repro please? Without a repro it's unlikely we'll be able to help.

@fractalfeeling
Copy link
Author

fractalfeeling commented Aug 9, 2023

@dgozman This is my test file pwtest.js:

const { _android } = require('playwright');
const expect = require('chai').expect;
(async () => {
  const caps = {
    "osVersion": "12.0",
    "deviceName": "Samsung Galaxy S22", // "Samsung Galaxy S22 Ultra", "Google Pixel 7 Pro", "OnePlus 9", etc.
    "browserName": "chrome",
    "realMobile": "true",
    'name': 'My android playwright test',
    'build': 'playwright-build-1',
    'browserstack.playwrightLogs': 'true',
    'browserstack.console': 'verbose',
    'browserstack.username': process.env.BROWSERSTACK_USERNAME, // || <your_username>,
    'browserstack.accessKey': process.env.BROWSERSTACK_ACCESS_KEY, // || <your_access_key>,
  };
  const device = await _android.connect(`wss://cdp.browserstack.com/playwright?caps=${encodeURIComponent(JSON.stringify(caps))}`);

  console.log(device.model());
  console.log(device.serial());
  await device.shell('am force-stop com.android.chrome');
  const context = await device.launchBrowser();
  const page = await context.newPage();
    await page.goto('https://en.wikipedia.org/wiki/Playwright');
    await page.screenshot({ path: 'screenshot.png', fullPage: true});
    await context.close();
    await device.close();
})();

Documentation is found here: https://www.browserstack.com/docs/automate/playwright/playwright-android, under Java. You would need a Browserstack account along with username and access key to recreate. Steps are:

  1. npm i playwright
  2. npm i chai
  3. node pwtest.js

@dgozman
Copy link
Contributor

dgozman commented Aug 9, 2023

@fractalfeeling Thank you for the information, I can repro some issues with Android emulator.

@dgozman dgozman changed the title [BUG] Mobile screenshots repeating / tiling [BUG] Android screenshots repeating / tiling Aug 9, 2023
dgozman added a commit that referenced this issue Aug 9, 2023
Germandrummer92 pushed a commit to OctoMind-dev/playwright that referenced this issue Oct 27, 2023
@pavelfeldman
Copy link
Member

Why was this issue closed?

Thank you for your contribution to our project. This issue has been closed due to its limited upvotes and recent activity, and insufficient feedback for us to effectively act upon. Our priority is to focus on bugs that reflect higher user engagement and have actionable feedback, to ensure our bug database stays manageable.

Should you feel this closure was in error, please create a new issue and reference this one. We're open to revisiting it given increased support or additional clarity. Your understanding and cooperation are greatly appreciated.

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

No branches or pull requests

3 participants