profile
viewpoint
Arjun Attam arjun27 Microsoft Vancouver, BC https://arjun.is Program Manager on Playwright @microsoft

arjun27/gitstats 2

Weekly git stats for your engineering team

arjun27/calculator 1

Simple calculator built with React

arjun27/advent-of-code-clojure 0

Learning Clojure with Advent of Code 2018

arjun27/awesome-code-review 0

An "Awesome" list of code review resources - articles, papers, tools, etc

arjun27/azure-maven-plugins 0

Maven plugins for Azure

arjun27/azure-sdk-for-java 0

Azure SDKs for Java

issue commentmicrosoft/playwright-github-action

Error with missing libraries

I found this on the PR that @aomarks had linked: https://github.com/Polymer/lit-html/runs/1125894132

aomarks

comment created time in 15 hours

issue closedmicrosoft/playwright

[Question] Contributing to website

I was hoping to contribute an update for the website docs (https://playwright.dev) that would highlight the current page in the side navigation.

For example, the following path would make Selectors show up with color: var(--link-color) (#0366d6) https://playwright.dev/#version=v1.4.0&path=docs%2Fselectors.md

I cannot seem to find where the site gets compiled. Is there a script I'm not seeing or a separate project that builds the website?

closed time in 15 hours

SteveByerly

issue commentmicrosoft/playwright

[Question] Contributing to website

Thanks for pointing that out @SteveByerly. playwright.dev is now public repo. Would love to see this as a contribution there 👍

SteveByerly

comment created time in 15 hours

issue closedmicrosoft/playwright

[Question] PowerBI click in/"get" value of click from frame table [Need Help]

Is there anyone else out there using Playwright to test Power BI visuals? I didn't find anyone in the Power BI community doing it. I need to be able to click a value in a visual to adjust other visuals (& "get" values); right click to show a drop down to drill through to another report that has additional values and table attributes. Can playwright be used to accomplish these tasks?

I found a public visual that seems to have the same table attributes. If I can get it working for it then I should be able to do the same for our internal website reports. I used this public visual for my example code I have tried below.

Here are the sections for a single element. It would be best if I can "find" / "click" / and "get" by the actual name "Weimei Corp" instead of all of the nth elements. Also this report has way more frames than mine. I am able to get it to display the frame details. Is there documentation that shows each of these are broken down on how to get what I need by using the frame attributes?

For the examples, I figured it should be from frame and not page but I would try both.

Copy Element <div title="Weimei Corp" class="pivotTableCellWrap cell-interactive tablixAlignLeft " style="padding-top:5px;padding-right:5px;padding-bottom:6px;padding-left:5px;color:#333333;box-shadow:inset 0px 0 0 0 black, inset -0px 0 0 0 black, inset 0 -1px 0 0 #EAEAEA, inset 0 0px 0 0 black;position:relative;box-sizing:border-box;height:29px;">Weimei Corp</div>

Copy Selector #pvExplorationHost > div > div > exploration > div > explore-canvas-modern > div > div.canvasFlexBox > div > div.displayArea.disableAnimations.fitToPage > div.visualContainerHost > visual-container-repeat > visual-container-modern:nth-child(13) > transform > div > div:nth-child(4) > div > visual-modern > div > div > div.tableEx > div.innerContainer > div.bodyCells > div > div > div:nth-child(1) > div:nth-child(5)

Copy JS Path document.querySelector("#pvExplorationHost > div > div > exploration > div > explore-canvas-modern > div > div.canvasFlexBox > div > div.displayArea.disableAnimations.fitToPage > div.visualContainerHost > visual-container-repeat > visual-container-modern:nth-child(13) > transform > div > div:nth-child(4) > div > visual-modern > div > div > div.tableEx > div.innerContainer > div.bodyCells > div > div > div:nth-child(1) > div:nth-child(5)")

Copy XPath //*[@id="pvExplorationHost"]/div/div/exploration/div/explore-canvas-modern/div/div[2]/div/div[2]/div[2]/visual-container-repeat/visual-container-modern[13]/transform/div/div[3]/div/visual-modern/div/div/div[2]/div[1]/div[4]/div/div/div[1]/div[5]

Here is the code using that public visual and example codes I have tried to just click the "Weimei Corp" const playwright = require("playwright");

(async function(){ const browser = await playwright.chromium.launch({ headless: false , slowMo: 100 }); // Non-headless mode to feel comfy

const context = await browser.newContext(); // So much to say, but another time const page = await context.newPage(); // Create a new Page instance which handles most of your needs

await Promise.all([
  page.waitForNavigation(),
  page.goto('https://community.powerbi.com/t5/Data-Stories-Gallery/Customer-Analysis-Dashboard/td-p/630893')
]);
    
await page.waitForTimeout(30000); // wait for the Apps to load

debugger;

console.log('start');

console.log('Report is displayed');

await page.frames().find((frame) => { console.log(frame,frame.name()); return frame.name() === 'visual-sandbox' }); console.log('Got visual-sandbox');

//locate the iframe name visual sandbox const frame = page.frames().find(frame => frame.name() === 'visual-sandbox'); console.log(frame.name());

console.log('Got visual-sandbox');
const title= await frame.title();
await console.log('title is:'+title);

await frame.waitForTimeout(10000);

// below doesn't work await page.click('text="Weimei Corp"'); await frame.click('text="Weimei Corp"');

//Error: Evaluation failed: TypeError: Cannot read property 'click' of null const corp = await page.evaluate(() => document.querySelector("#pvExplorationHost > div > div > exploration > div > explore-canvas-modern > div > div.canvasFlexBox > div > div.displayArea.disableAnimations.fitToPage > div.visualContainerHost > visual-container-repeat > visual-container-modern:nth-child(13) > transform > div > div:nth-child(4) > div > visual-modern > div > div > div.tableEx > div.innerContainer > div.bodyCells > div > div > div:nth-child(1) > div:nth-child(5)").click());

console.log('got Corp click ');

// Error: Evaluation failed: TypeError: Cannot read property 'innerText' of null const fullText = await frame.evaluate(el => el.innerText, await page.$("#pvExplorationHost > div > div > exploration > div > explore-canvas-modern > div > div.canvasFlexBox > div > div.displayArea.disableAnimations.fitToPage > div.visualContainerHost > visual-container-repeat > visual-container-modern:nth-child(13) > transform > div > div:nth-child(4) > div > visual-modern > div > div > div.tableEx > div.innerContainer > div.bodyCells > div > div > div:nth-child(1) > div:nth-child(5)")) //console.log(fullText)

//TypeError: Cannot read property 'inntertext' of null //const hrefElement = await page.$('#pvExplorationHost > div > div > exploration > div > explore-canvas-modern > div > div.canvasFlexBox > div > div.displayArea.disableAnimations.fitToPage > div.visualContainerHost > visual-container-repeat > visual-container-modern:nth-child(13) > transform > div > div:nth-child(4) > div > visual-modern > div > div > div.tableEx > div.innerContainer > div.bodyCells > div > div > div:nth-child(1) > div:nth-child(5)'); console.log(hrefElement.innerText.name);
await hrefElement.click();

//(node:10080) UnhandledPromiseRejectionWarning: Error: Error: failed to find element matching selector "#pvExplorationHost > div > div > exploration > div > explore-canvas-modern > div > div.canvasFlexBox > div > div.displayArea.disableAnimations.fitToPage > div.visualContainerHost > visual-container-repeat > visual-container-modern:nth-child(13) > transform > div > div:nth-child(4) > div > visual-modern > div > div > div.tableEx > div.innerContainer > div.bodyCells > div > div > div:nth-child(1) > div:nth-child(5)" // at Frame._$evalExpression const hrefElement = await frame.$eval('#pvExplorationHost > div > div > exploration > div > explore-canvas-modern > div > div.canvasFlexBox > div > div.displayArea.disableAnimations.fitToPage > div.visualContainerHost > visual-container-repeat > visual-container-modern:nth-child(13) > transform > div > div:nth-child(4) > div > visual-modern > div > div > div.tableEx > div.innerContainer > div.bodyCells > div > div > div:nth-child(1) > div:nth-child(5)', el => el.value); console.log(hrefElement);
await hrefElement.click();

//(node:21332) UnhandledPromiseRejectionWarning: Error: page.waitForFunction: Evaluation failed: TypeError: Cannot read property 'length' of null await frame.waitForFunction(() => { const searches = document.querySelector(".pivotTableCellWrap cell-interactive tablixAlignLeft"); console.log('found table'); return searches.length > 1; }); await frame.waitForTimeout(10000);

await frame.waitForFunction(() => { const searches = document.getElementsByClassName(".pivotTableCellWrap cell-interactive tablixAlignLeft"); console.log('found table'); return searches.length > 1; }); await frame.waitForTimeout(10000);

//assert is not defined //const datatext = await page.$$eval('#pvExplorationHost > div > div > exploration > div > explore-canvas-modern > div > div.canvasFlexBox > div > div.displayArea.disableAnimations.fitToPage > div.visualContainerHost > visual-container-repeat > visual-container-modern:nth-child(13) > transform > div > div:nth-child(4) > div > visual-modern > div > div > div.tableEx > div.innerContainer > div.bodyCells > div > div > div:nth-child(1) > div:nth-child(5)',

elements => elements.map(el => el.textContent.trim().split('\n')[0])) assert(datatext.length > 0)

//Error: Evaluation failed: TypeError: Cannot read property 'getAttribute' of undefined const myElem = await frame.evaluate(el => el.getAttribute('Weimei Corp')); console.log(myElem)

const element = await page.$('#pvExplorationHost');

await page.waitForFunction(() => {
  const searches = document.querySelectorAll('div.tableEx');
  console.log('found table');
  return searches.length > 1;
});

await browser.close(); // Close the browser

})();

Here is example of values from my visual which is almost the same except if by title "THERESA WADE" has the special characters. I have also attached some screen shots for visual reference.

"COPY ELEMENT" <div title="THERESA Z WADE" class="pivotTableCellNoWrap cell-interactive " style="padding-top:1px;padding-right:5px;padding-bottom:2px;padding-left:5px;color:#070f25;background-color:#FFFFFF;box-shadow:inset 0px 0 0 0 black, inset -0px 0 0 0 black, inset 0 -1px 0 0 #000000, inset 0 0px 0 0 black;position:relative;box-sizing:border-box;height:24px;">THERESA Z WADE</div>

"COPY SELECTOR" #pvExplorationHost > div > div > exploration > div > explore-canvas-modern > div > div.canvasFlexBox > div > div.displayArea.disableAnimations.fitToPage > div.visualContainerHost > visual-container-repeat > visual-container-modern:nth-child(3) > transform > div > div:nth-child(4) > div > visual-modern > div > div > div.tableEx > div.innerContainer > div.bodyCells > div > div:nth-child(1) > div:nth-child(1) > div:nth-child(1) #pvExplorationHost > div > div > exploration > div > explore-canvas-modern > div > div.canvasFlexBox > div > div.displayArea.disableAnimations.fitToPage > div.visualContainerHost > visual-container-repeat > visual-container-modern:nth-child(3) > transform > div > div:nth-child(4) > div > visual-modern > div > div > div.tableEx > div.innerContainer > div.bodyCells > div > div > div:nth-child(1) > div

"Copy JS Path" document.querySelector("#pvExplorationHost > div > div > exploration > div > explore-canvas-modern > div > div.canvasFlexBox > div > div.displayArea.disableAnimations.fitToPage > div.visualContainerHost > visual-container-repeat > visual-container-modern:nth-child(3) > transform > div > div:nth-child(4) > div > visual-modern > div > div > div.tableEx > div.innerContainer > div.bodyCells > div > div > div:nth-child(1) > div")

"Copy XPath" //*[@id="pvExplorationHost"]/div/div/exploration/div/explore-canvas-modern/div/div[2]/div/div[2]/div[2]/visual-container-repeat/visual-container-modern[3]/transform/div/div[3]/div/visual-modern/div/div/div[2]/div[1]/div[4]/div/div/div[1]/div

publicreport dropdown

closed time in 15 hours

wadezone

issue commentmicrosoft/playwright

[Question] PowerBI click in/"get" value of click from frame table [Need Help]

Marking as duplicate of #3915. Please feel free to re-open after reviewing https://github.com/microsoft/playwright/issues/3915#issuecomment-694477958. A more focused/specific question would help us in helping you. Thanks!

wadezone

comment created time in 15 hours

issue commentmicrosoft/playwright

[Question] Video recording: capturing popups

Thanks for the feedback! cc @yury-s

celeryclub

comment created time in 15 hours

issue closedmicrosoft/playwright

[Question]Can Playwright be used to manipulate a Power BI visual?

I have been at this for about 4 weeks with very little luck. I can't find where anyone else is using playwright to manipulate a Power BI report like a user. Can this be done?

Currently unable to reference elements in a visual. For a single cell the select value is very long.

//doing this I get Error: Evaluation failed: TypeError: Cannot read property 'click' of null const corp = await frame.evaluate(() => document.querySelector("#pvExplorationHost > div > div > exploration > div > explore-canvas-modern > div > div.canvasFlexBox > div > div.displayArea.disableAnimations.fitToPage > div.visualContainerHost > visual-container-repeat > visual-container-modern:nth-child(13) > transform > div > div:nth-child(4) > div > visual-modern > div > div > div.tableEx > div.innerContainer > div.bodyCells > div > div > div:nth-child(1) > div:nth-child(4)").click());

I tried to do a for each but not sure how to verify the "elements" array was populated with data with the TypeError: Cannot read property 'click' of undefined

await frame.evaluate(() => {

  const elements = $('.pivotTableCellWrap cell-interactive tablixAlignLeft').toArray();

  for (i = 0; i < elements.length; i++) {

    $(elements[i]).click();

    console.log(elements[i]);

  }

});

The below is the closes I got, with the div nth child(1) but it returned the menu values at the top of the page and not from the visual before it gave me assert not defined.

// Assert text content

const corp = await page.textContent('div:nth-child(1) > div:nth-child(4)');

console.log(corp);

assert(corp === 'Weimei Corp'); //assert is not defined

const elementHandle = await frame.waitForSelector('#pvExplorationHost > div > div > exploration > div > explore-canvas-modern > div > div.canvasFlexBox > div > div.displayArea.disableAnimations.fitToPage > div.visualContainerHost > visual-container-repeat > visual-container-modern:nth-child(13) > transform > div > div:nth-child(4) > div > visual-modern > div > div > div.tableEx > div.innerContainer > div.bodyCells > div > div > div:nth-child(1) > div:nth-child(4)');

await frame.click('text="Weimei Corp"');

await frame.waitForFunction(() => {

const searches = document.getElementsByClassName(".pivotTableCellWrap cell-interactive tablixAlignLeft");

console.log('found table');

return searches.length > 1;

});

I have been reading a lot. Your documentation indicates to not use xpath and css. I am not able to find a way to use div title to find the actual name and click on it.

Avoid selectors tied to implementation xpath and css can be tied to the DOM structure or implementation. These selectors can break when the DOM structure changes.

https://github.com/microsoft/playwright/blob/master/docs/selectors.md https://stackoverflow.com/questions/48673906/collect-elements-by-class-name-and-then-click-each-one-puppeteer

What I am trying to use this public visual to manipulate a click on "Weimei Corp" then I know I should be able to do the same on our internal reports. page.goto('https://community.powerbi.com/t5/Data-Stories-Gallery/Customer-Analysis-Dashboard/td-p/630893') ]);

copy selector #pvExplorationHost > div > div > exploration > div > explore-canvas-modern > div > div.canvasFlexBox > div > div.displayArea.disableAnimations.fitToPage > div.visualContainerHost > visual-container-repeat > visual-container-modern:nth-child(13) > transform > div > div:nth-child(4) > div > visual-modern > div > div > div.tableEx > div.innerContainer > div.bodyCells > div > div > div:nth-child(1) > div:nth-child(4)

copy jspath document.querySelector("#pvExplorationHost > div > div > exploration > div > explore-canvas-modern > div > div.canvasFlexBox > div > div.displayArea.disableAnimations.fitToPage > div.visualContainerHost > visual-container-repeat > visual-container-modern:nth-child(13) > transform > div > div:nth-child(4) > div > visual-modern > div > div > div.tableEx > div.innerContainer > div.bodyCells > div > div > div:nth-child(1) > div:nth-child(4)"

copy element <div title="Weimei Corp" class="pivotTableCellWrap cell-interactive tablixAlignLeft " style="padding-top:5px;padding-right:5px;padding-bottom:6px;padding-left:5px;color:#333333;box-shadow:inset 0px 0 0 0 black, inset -0px 0 0 0 black, inset 0 -1px 0 0 #EAEAEA, inset 0 0px 0 0 black;position:relative;box-sizing:border-box;height:29px;">Weimei Corp</div>

Is there a way to reference the actual title versus using the long nth selector. <div title="Weimei Corp" class="pivotTableCellWrap cell-interactive tablixAlignLeft "

Trying to click Weimei Corp publicreport dropdown

closed time in 15 hours

wadezone

issue commentmicrosoft/playwright

[Question]Can Playwright be used to manipulate a Power BI visual?

Thanks for writing in, @wadezone. I'm not exactly sure if I understand the issue but I was able to use the website that you've shared to play with the app a bit and write a starter script using with Playwright.

const { chromium } = require('playwright');

(async () => {
  const browser = await chromium.launch({ headless: false });
  const context = await browser.newContext();
  const page = await context.newPage();

  await page.goto('https://community.powerbi.com/t5/Data-Stories-Gallery/Customer-Analysis-Dashboard/td-p/630893#');
  const frame = await page.frame({ url: 'https://app.powerbi.com/view**' });
  await frame.click('text="Weimei Corp"');
  await frame.click('text="Weimei Corp"', {button: 'right'});
  await frame.click('text="Copy"');
  await frame.click('text="Copy value"');
  
  await browser.close();
})();

I was able to click on the selector with text="Weimei Corp and do some actions on the right-click context menu. Are you thinking of building something like this? If you have a specific question, please feel free to re-open the issue.

wadezone

comment created time in 15 hours

issue commentmicrosoft/playwright

[Question] Video recording: capturing popups

Thanks Steve. Currently, Playwright records one video per page. I've modified your script to specify a _videosPath and wait for the video event on the new popup. This would save 2 videos, each for a page. We are iterating on the API and would love your feedback!

const fs = require('fs');
const { chromium } = require('playwright-chromium');

(async () => {
  const browser = await chromium.launch({
    headless: false, _videosPath: __dirname
  });
  const context = await browser.newContext({
    _recordVideos: { width: 1280, height: 720 },
  });
  const page = await context.newPage();
  const video1 = await page.waitForEvent('_videostarted');

  await page.goto('https://hhncn.csb.app');
  await page.waitForTimeout(2000);
  const [popup] = await Promise.all([page.waitForEvent('popup'), page.click('.link')]);
  const video2 = await popup.waitForEvent('_videostarted');

  await popup.waitForSelector('.logo')
  await popup.waitForTimeout(2000);
  await popup.close();
  await page.close();

   fs.renameSync(await video1.path(), 'popup-test-1.webm');
   fs.renameSync(await video2.path(), 'popup-test-2.webm');
  await browser.close();
})();
celeryclub

comment created time in 16 hours

issue commentmicrosoft/playwright-github-action

Error with missing libraries

Thanks for reporting this @aomarks. We'll investigate and get back to you shortly!

aomarks

comment created time in 17 hours

push eventmicrosoft/playwright

Mikko Korpela

commit sha 73db4a450e34c553ba9a1ce2bb4d4a97f233ff4c

docs(api): fix typo Fix typo in fullPage description.

view details

push time in 2 days

PR merged microsoft/playwright

Update api.md

Fix typo in fullPage description.

+1 -1

0 comment

1 changed file

mkorpela

pr closed time in 2 days

PullRequestReviewEvent

issue openedapexskier/nova-typescript

Unable to locate npm

Unable to locate npm to spawn tsserver. Running on this project.

Environment (please complete the following information):

  • Nova version: 1.0 (Build 202519)
  • Extension version: 1.6.2
  • TypeScript version: ^4.0.2
  • Sidebar information: <!-- [e.g. Status Running, TypeScript Version 4.0.2] get this from the extension sidebar -->
  • macOS version: 0.15.6 (19G2021)
  • NodeJS information:
    • node version: v14.5.0
    • npm version: 6.14.5
    • installation method: nvm

Extension console output

Screen Shot 2020-09-16 at 12 49 54 PM

created time in 2 days

push eventarjun27/vscode-webm-viewer

Arjun Attam

commit sha f3e2989f26c4222d0c9d41824d7857a27488f470

readme

view details

push time in 3 days

push eventarjun27/vscode-webm-viewer

Arjun Attam

commit sha 3cd47741391bce9b44fd667b883b20e98aa8ae60

more boilerplate

view details

push time in 3 days

create barncharjun27/vscode-webm-viewer

branch : master

created branch time in 3 days

created repositoryarjun27/vscode-webm-viewer

VS Code extension to open .webm video files

created time in 3 days

issue openedmicrosoft/playwright-cli

codegen: fill does not capture full text string

Specific to bing.com

Repro steps:

  • go to bing.com
  • click on the search input field
  • type "git" quickly
  • type "hub" after a short pause
  • the codegen shows on git
    • it seems bing.com tries to autocomplete the field, which does not play well with codegen

created time in 3 days

PullRequestReviewEvent

issue commentmicrosoft/playwright

[Feature] Ability to set device scale factor on an existing page

Thanks @ezzatron, this is an interesting scenario for headless browsers. Playwright treats emulation scenarios differently: they are based on browser contexts. This enables scenarios that involve multiple pages (common in the testing world) and mirrors real-world usage (since end users cannot change device scale factor for a page).

Creating a browser context is inexpensive, but it would require creating new pages in the context, causing your optimization of re-using pages to not work. At this stage, we are prioritizing testing related scenarios and we can keep this issue open to collect more feedback. Thanks!

ezzatron

comment created time in 5 days

Pull request review commentmicrosoft/playwright

chore: add devcontainer.json for GitHub Codespaces

+{+    "name": "Playwright",+    "image": "mcr.microsoft.com/playwright:next",+    "postCreateCommand": "npm install && npm run build",+    "settings": {+        "terminal.integrated.shell.linux": "/bin/bash"

Curious to know why this is required?

mxschmitt

comment created time in 6 days

PullRequestReviewEvent
PullRequestReviewEvent

push eventmicrosoft/playwright

Nathan Hoffmann

commit sha 75e847a6fa73d1da8b1ad7dd3d9f7fcf08695632

docs(pom.md): fix typo in example function name (#3855) The patch renames the `goto` function in page object model documentation to `navigate`. Fixes #3854

view details

push time in 7 days

issue closedmicrosoft/playwright

[Typo in Documentation] `goto` should be `navigate`

On this page in the docs the example of a page object defines a function goto. The usage of the page object uses a function navigate. It seems to me that the goto function should really be navigate. If this is the case, I can make a PR to fix the typo.

closed time in 7 days

nrhoffmann
PullRequestReviewEvent

issue commentmicrosoft/playwright

[Feature] Browser context serialization to support local storage

We now have a guide for sharing authentication state across browser contexts (using APIs for cookies and local storage). We could evolve this into a unified API for all "browser context state" based on user feedback. Please share your user scenarios and help us identify what's missing :)

arjun27

comment created time in 7 days

issue commentmicrosoft/playwright

[Typo in Documentation] `goto` should be `navigate`

That's right, good catch! Can you send a PR? I'd love to merge.

nrhoffmann

comment created time in 7 days

issue commentmicrosoft/playwright

[BUG] ffmpeg dependency check fails on Linux

@yury-s, @aslushnikov - I believe this issue would be fixed if we bundled ffmpeg for Linux as well with the NPM package (as we have for Windows/macOS). Is it possible to do that? I'm a bit hesitant to make ffmpeg an optional dependency since screencast is a highly requested user feature.

anthonychu

comment created time in 7 days

push eventarjun27/arjun.is

Arjun Attam

commit sha a1d1b8ccf56ca6afa1d069659a183f9339eebd11

Update index.css

view details

push time in 7 days

push eventarjun27/arjun.is

Arjun Attam

commit sha 7f06b7f4d7984ed7a83e9dfc823b8e0f1f40cbb7

Update index.css

view details

push time in 7 days

push eventarjun27/arjun.is

Arjun Attam

commit sha 4a8d0eeb3015ec9f4ef7c4acb691ec747467e52a

Update homephoto.njk

view details

push time in 7 days

delete branch arjun27/playwright-1

delete branch : langs-1

delete time in 8 days

push eventmicrosoft/playwright

Arjun Attam

commit sha 4240e1df1de80cff3d9dccbfd661d2d6dcedadf4

docs: add page on language bindings (#3819)

view details

push time in 8 days

PR merged microsoft/playwright

docs: add page on language bindings

Adds brief summary and links for supported languages.

+46 -2

0 comment

3 changed files

arjun27

pr closed time in 8 days

push eventmicrosoft/playwright

Arjun Attam

commit sha 777689a96aa9507e637cc4b9b3f904e27a95d8da

docs(intro): add cli to getting started (#3821) * docs(intro): add cli to getting started * fix doclint

view details

push time in 8 days

push eventmicrosoft/playwright

Arjun Attam

commit sha ee98bd0a296f06606aea8971710bca3f653a9f67

docs(selectors): update structure and add best practices (#3817) * docs(selectors): update structure and add best practices * dgozman comments

view details

push time in 8 days

push eventarjun27/playwright-1

Arjun Attam

commit sha ef03071b799c06cb6799564fe6feab0a00536093

fix doclint

view details

push time in 8 days

push eventarjun27/playwright-1

Arjun Attam

commit sha 9b4d6074840b44ecab4467cda643ebfd0b2c23e8

dgozman comments

view details

push time in 8 days

push eventarjun27/playwright-1

Arjun Attam

commit sha 8f2157cfa603ec60e31fbd76f98043aa2fadfcd6

docs(intro): add cli to getting started

view details

push time in 8 days

PR opened microsoft/playwright

docs(intro): add cli to getting started
+36 -28

0 comment

2 changed files

pr created time in 8 days

create barncharjun27/playwright-1

branch : cli-docs-1

created branch time in 8 days

PR opened microsoft/playwright

docs: add page on language bindings

Adds brief summary and links for supported languages.

+46 -2

0 comment

3 changed files

pr created time in 9 days

push eventarjun27/playwright-1

Arjun Attam

commit sha 0d8b62d475bfaaa2cbd80816e0efff82f18c4c75

docs: add page on language bindings

view details

push time in 9 days

create barncharjun27/playwright-1

branch : langs-1

created branch time in 9 days

create barncharjun27/playwright-1

branch : selectors-doc-1

created branch time in 9 days

push eventmicrosoft/playwright

Max Schmitt

commit sha ff0d6971517fd29531f2e34033c12aa9bf650e69

docs(docker): add note how to use chromium sandbox (#3779)

view details

push time in 9 days

delete branch microsoft/playwright

delete branch : docs/chromium-sandbox

delete time in 9 days

PR merged microsoft/playwright

Reviewers
docs(docker): add note how to use chromium sandbox

Tested it locally that it works, after using root as the default user. So the users have to enable the seccomp profile + create a separate user inside the Docker container.

Fixes #3607

+20 -4

0 comment

1 changed file

mxschmitt

pr closed time in 9 days

issue closedmicrosoft/playwright

[BUG] Chromium doesn't work in the playwright:bionic Docker image

Context:

  • Playwright Version: 1.3.0
  • Operating System: Linux (CentOS 7)
  • Node.js version: 12.18.3
  • Browser: Chromium
  • Extra: Docker version 19.03.11

Code Snippet

$> wget https://raw.githubusercontent.com/microsoft/playwright/master/docs/docker/seccomp_profile.json
$> docker run -it --rm --security-opt seccomp=./seccomp_profile.json mcr.microsoft.com/playwright:bionic bash
pwuser@0144135bbdad:/$ cd ~
pwuser@0144135bbdad:~$ npm i playwright

> playwright@1.3.0 install /home/pwuser/node_modules/playwright
> node install.js

Failed to process descriptor at /home/pwuser/tmp/node_modules/playwright
npm WARN saveError ENOENT: no such file or directory, open '/home/pwuser/package.json'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open '/home/pwuser/package.json'
npm WARN pwuser No description
npm WARN pwuser No repository field.
npm WARN pwuser No README data
npm WARN pwuser No license field.

+ playwright@1.3.0
added 34 packages from 79 contributors and audited 34 packages in 2.149s

3 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

pwuser@0144135bbdad:~$ node
Welcome to Node.js v12.18.3.
Type ".help" for more information.
> require("playwright").chromium.launch().then(console.log)
Promise { <pending> }
> (node:42) UnhandledPromiseRejectionWarning: browserType.launch: Chromium sandboxing failed!
================================
To workaround sandboxing issues, do either of the following:
  - (preferred): Configure environment to support sandboxing: https://github.com/microsoft/playwright/blob/master/docs/troubleshooting.md
  - (alternative): Launch Chromium without sandbox using 'chromiumSandbox: false' option
================================
Error
    at /home/pwuser/node_modules/playwright/lib/chromium/crConnection.js:131:63
    at new Promise (<anonymous>)
    at CRSession.send (/home/pwuser/node_modules/playwright/lib/chromium/crConnection.js:130:16)
    at CRSession.send (/home/pwuser/node_modules/playwright/lib/helper.js:80:31)
    at Function.connect (/home/pwuser/node_modules/playwright/lib/chromium/crBrowser.js:55:39)
    at Chromium._connectToTransport (/home/pwuser/node_modules/playwright/lib/server/chromium.js:53:38)
    at Chromium._innerLaunch (/home/pwuser/node_modules/playwright/lib/server/browserType.js:90:36)
    at async ProgressController.run (/home/pwuser/node_modules/playwright/lib/progress.js:75:28)
    at async Chromium.launch (/home/pwuser/node_modules/playwright/lib/server/browserType.js:62:25)
(node:42) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:42) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Describe the bug

I am running playwright through Docker using the recommended settings but Chromium doesn't seem to work. I keep getting an "unable to sandbox" error. Webkit and Firefox are working as expected.

I have also tried this with the 1.2.1 version and am getting the same result.

closed time in 9 days

MrDiggles2

Pull request review commentmicrosoft/playwright

docs(docker): add note how to use chromium sandbox

 $ docker pull mcr.microsoft.com/playwright:bionic  ### Run the image +By default, the Docker image will use the `root` user to run the browsers. This will disable the Chromium sandbox which is not available with root. If you run trusted code (e.g. End-to-end tests), then the root user is in most cases fine. For web scraping or crawling, we recommend to create a separate user inside the Docker container and use the seccomp profile.++#### Trusted environments+ ```-$ docker container run -it --rm --ipc=host --security-opt seccomp=seccomp_profile.json mcr.microsoft.com/playwright:bionic /bin/bash+docker run -it --rm mcr.microsoft.com/playwright:bionic /bin/bash+```++#### With the Chromium Sandbox++```+$ docker run -it --rm --ipc=host --security-opt seccomp=seccomp_profile.json mcr.microsoft.com/playwright:bionic /bin/bash

I think ipc=host is also applicable to trusted environments.

mxschmitt

comment created time in 10 days

Pull request review commentmicrosoft/playwright

docs(docker): add note how to use chromium sandbox

 # Running Playwright in Docker -[Dockerfile.bionic](Dockerfile.bionic) is a playwright-ready image of playwright.+[Dockerfile.bionic](Dockerfile.bionic) is a playwright-ready image of Playwright.
[Dockerfile.bionic](Dockerfile.bionic) can be used to run Playwright scripts in Docker environments.
mxschmitt

comment created time in 10 days

Pull request review commentmicrosoft/playwright

docs(docker): add note how to use chromium sandbox

 $ docker pull mcr.microsoft.com/playwright:bionic  ### Run the image +By default, the Docker image will use the `root` user to run the browsers. This will disable the Chromium sandbox which is not available with root. If you run trusted code (e.g. End-to-end tests), then the root user is in most cases fine. For web scraping or crawling, we recommend to create a separate user inside the Docker container and use the seccomp profile.++#### Trusted environments

Is "trusted environments" the right phrase? Environments sounds like CI/VMs that you run playwright on, but what we mean by this is trusted websites.

With the goal of making headings instantly relevant, I think we can title this as "End-to-end tests" and add a one-line description to what that means in this context. Similarly, the other heading can be "Crawling and scraping", followed by a one-line description of why sandboxing is important in that scenario.

mxschmitt

comment created time in 10 days

PullRequestReviewEvent
PullRequestReviewEvent

issue closedmicrosoft/playwright

[Feature]more smart selector policy

if we can support the selector policy thinking browser as blackbox, the user experience will more awesome. https://github.com/getgauge/taiko#smart-selectors https://docs.taiko.dev/api/relativeselector/ these feature can improve the productivity of producting command when user interacting web application in auth script mode.

closed time in 10 days

roughsoft

issue commentmicrosoft/playwright

[Feature]more smart selector policy

Thanks for the request @roughsoft. I'll merge this with #2877 since they are duplicates.

roughsoft

comment created time in 10 days

push eventarjun27/arjun.is

Arjun Attam

commit sha 447daaefb2515d698bf6ce45f23e0032dea015d4

fix copy

view details

push time in 10 days

push eventarjun27/arjun.is

Arjun Attam

commit sha 1cd80b2ade3ebb45eeed5559d94f3f39f91dfb2e

podcast page: styling

view details

push time in 10 days

push eventarjun27/arjun.is

Arjun Attam

commit sha 7a0649f3876ff743f4a005007a4670a3571ed1d2

fix copy

view details

push time in 10 days

delete branch arjun27/arjun.is

delete branch : podcast-page

delete time in 10 days

push eventarjun27/arjun.is

Arjun Attam

commit sha ed1e041ae432411aea0dd7cd7ac987ec97e45694

feat: add podcast archive (#8) * feat: add podcast archive * styling * more styling

view details

push time in 10 days

PR merged arjun27/arjun.is

feat: add podcast archive
+1098 -0

1 comment

6 changed files

arjun27

pr closed time in 10 days

push eventarjun27/arjun.is

Arjun Attam

commit sha 49255de655a3170110562732f69e2af9ca808417

more styling

view details

push time in 10 days

push eventarjun27/arjun.is

Arjun Attam

commit sha 886bea203d9af9663018f4a244a55ac6d4424932

styling

view details

push time in 10 days

PR opened arjun27/arjun.is

feat: add podcast archive
+1097 -3

0 comment

6 changed files

pr created time in 10 days

create barncharjun27/arjun.is

branch : podcast-page

created branch time in 10 days

push eventmicrosoft/playwright

Arjun Attam

commit sha 25fe115719ec38004b20dc765dd988c8c9f20383

docs: update why-playwright.md (#3761) * docs: update why-playwright.md * review fixes

view details

push time in 14 days

PR merged microsoft/playwright

docs: update why-playwright.md
  • Fixes errors in previous version
  • Adds new section on limitations covering IE11, Java bindings and testing on real mobile devices
+11 -2

0 comment

1 changed file

arjun27

pr closed time in 14 days

push eventarjun27/playwright-1

Arjun Attam

commit sha 9dea475367055b330eca7a046a3fb61007df5e28

review fixes

view details

push time in 14 days

PR opened microsoft/playwright

docs: update why-playwright.md
  • Fixes errors in previous version
  • Adds new section on limitations covering IE11, Java bindings and testing on real mobile devices
+11 -2

0 comment

1 changed file

pr created time in 14 days

create barncharjun27/playwright-1

branch : docs-why-2

created branch time in 14 days

delete branch arjun27/playwright-1

delete branch : get-help

delete time in 14 days

push eventmicrosoft/playwright

Arjun Attam

commit sha 921c8d8d8c735358e9f604d120595a097e0c5f3e

docs: add help section (#3741)

view details

push time in 14 days

create barncharjun27/playwright-1

branch : get-help

created branch time in 16 days

issue commentmicrosoft/playwright

[BUG] Scrollbars are not hidden

Screen Shot 2020-09-02 at 11 40 02 AM

Seeing the same behavior on apple.com launched with playwright-cli@0.2.0

Anrb13

comment created time in 16 days

push eventvsls-contrib/codeboard

Arjun Attam

commit sha 9dab2f1f8463b37f07cdbd2e817582e467e36e4f

card crud in the webview

view details

push time in 16 days

push eventvsls-contrib/codeboard

Arjun Attam

commit sha af12a9d5c2a659636d6be815c4bd698dc58d8a22

fix input focus

view details

push time in 16 days

push eventvsls-contrib/codeboard

Arjun Attam

commit sha e67f5514d55b30c1ac89acf806581533cd52b091

Basic editable card for input

view details

push time in 16 days

issue commentmicrosoft/playwright

[Question] Why is an explicit npm install playwright needed?

But I guess the errors appear for unrelated reasons?

Yes, the error is a catch-all for missing browser binaries.

playwright could detect that the postinstall hook hadn't run

I might be wrong but I don't think it's possible to detect the hook didn't run. Playwright can check whether browser binaries are available and show the catch-all error.

Appreciate these ideas! I'd like to find a way so this becomes obvious, and something that we could handle by default. One approach could be to set the PLAYWRIGHT_BROWSERS_PATH=0 env var by default on CI environments, or at least on github actions (as @mxschmitt suggested). I noticed that you're not using the playwright github action. We could solve caching/config within the action, but I'm curious if you knew about it and chose to not use it.

umaar

comment created time in 17 days

pull request commentmicrosoft/vscode

Add playwright-python to workspace tags

Thanks for the review. Just added the comment for GDPR

arjun27

comment created time in 17 days

push eventarjun27/vscode

Arjun Attam

commit sha a139fea82151df168a2639442bbc5e68b3bd51db

Add gdpr comment for workspace.py.playwright

view details

push time in 17 days

issue commentmicrosoft/playwright

[Question] Why is an explicit npm install playwright needed?

Hey @umaar, this is because NPM wouldn't run the postinstall hook, as the node_modules directory is cached. Did you consider caching the npm-cache directory instead? We have other alternative approaches documented here. Let me know if you have any other ideas – would love to make this more intuitive.

umaar

comment created time in 17 days

issue commentmicrosoft/playwright

[Feature] allow selecting the second (k-th) selector match.

Duplicate of #2370? See selectors.index proposal.

pavelfeldman

comment created time in 18 days

issue closedmicrosoft/playwright

[BUG] Visible radio button cannot be clicked ("element is outside of the viewport")

Context:

  • Playwright Version: 1.3.0
  • Operating System: MacOS Catalina
  • Node.js version: 14.7.0
  • Browser: Chromium

Code Snippet

The objective is to click/select the radio button with the label "JA" via its ID "existing-customer-input-0":

const { chromium } = require('playwright');

(async () => {
  const browser = await chromium.launch({headless: false}, {slowMo: 50});
  // ...
  await page.click('#existing-customer-input-0');
})();

Describe the bug

The problematic section of the tested web page consists of a radio button group with two buttons: image The corresponding HTML source code:

<div class="c-button-group">
  <label class="c-button-group__item" for="existing-customer-input-0">
    <input class="c-button-group__input" type="radio" id="existing-customer-input-0" name="existingCustomer" 
    value="yes">
    <span class="c-button-group__label">ja</span>
  </label>
  <label class="c-button-group__item" for="existing-customer-input-1">
    <input class="c-button-group__input" type="radio" id="existing-customer-input-1" name="existingCustomer" 
    value="no">
    <span class="c-button-group__label">nein</span>
  </label>
</div>

Expected behavior: Button "JA" is found and clicked/selected.

Actual behavior: Playwright can't successfully select the element referenced by the above ID and throws the following error message:

TimeoutError: page.click: Timeout 30000ms exceeded. =========================== logs =========================== [api] waiting for selector "#existing-customer-input-0" [api] selector resolved to visible <input value="yes" type="radio" name="existingCustomer"…/> [api] attempting click action [api] waiting for element to be visible, enabled and not moving [api] element is visible, enabled and does not move [api] scrolling into view if needed [api] done scrolling [api] element is outside of the viewport [api] retrying click action [...] It keeps retrying with the same messages as above until the timeout kicks in.

Regarding "element is outside of the viewport": Not sure what this exactly implies but the element with the ID "existing-customer-input-0" is clearly visible and not overshadowed/hidden during a headful test.

closed time in 18 days

klctrl

issue commentmicrosoft/playwright

[BUG] Visible radio button cannot be clicked ("element is outside of the viewport")

I'll close the issue for now since this isn't a bug. We can continue the discussion to find an ideal selector to choose.

klctrl

comment created time in 18 days

issue commentmicrosoft/playwright

[BUG] Visible radio button cannot be clicked ("element is outside of the viewport")

Thanks for sharing the link on email. I noticed that the radio button has the following styles and is therefore not located on the page.

left: -9999px;
position: absolute;

I understand how using the text-based selector feels unreliable because of the other element on the page. Do you think we could combine the text selector with another text selector localize the search (text=Parent >> text=Child) into a part of the page? It might also be worth to get your thoughts on #2370

klctrl

comment created time in 18 days

push eventmicrosoft/playwright

Amit Zur

commit sha 8f37d78fd3ee4f51b0d5bdcf5a00e333f8500e44

Add Applitools SDK to the showcase (#3694) * Add Applitools * Add Applitools

view details

push time in 18 days

PR merged microsoft/playwright

Add Applitools SDK to the showcase

Add Applitools to the showcase

+1 -0

0 comment

1 changed file

amitzur

pr closed time in 18 days

delete branch vsls-contrib/codeboard

delete branch : webview

delete time in 18 days

push eventvsls-contrib/codeboard

Arjun Attam

commit sha b5b83d6052ce9a54355f1a0f3159a3a7d3b27f39

webview lane methods

view details

Arjun Attam

commit sha 94d847c74c59664ebabb9f230766d795d153f48a

Merge branch 'master' of https://github.com/vsls-contrib/codeboard

view details

push time in 18 days

push eventvsls-contrib/codeboard

Arjun Attam

commit sha d49e406fafb02c018fd3f0403e0a36ec8037ce85

remove padding

view details

push time in 18 days

push eventvsls-contrib/codeboard

Arjun Attam

commit sha cbe5871854d6cb77fa5458eddecfed787c28c2ca

basic markdown card

view details

Arjun Attam

commit sha 19e35f91f13ce0c2661464d6905d8e49b1d68c76

markdown note is rendered

view details

Arjun Attam

commit sha e127dac74b11647b3c598b38f11da2dd25ba0686

Merge branch 'master' of https://github.com/vsls-contrib/codeboard

view details

push time in 18 days

more