From dc0725bb3be92d7824470dcdfa8d286902dea464 Mon Sep 17 00:00:00 2001 From: sourav-kundu <66624530+sourav-kundu@users.noreply.github.com> Date: Thu, 26 Aug 2021 19:32:04 +0530 Subject: [PATCH 1/2] update code snippet for accessing getSessionDetails executor --- sample_session_details_API.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sample_session_details_API.js b/sample_session_details_API.js index f5d8479..a5ae2f0 100644 --- a/sample_session_details_API.js +++ b/sample_session_details_API.js @@ -40,9 +40,8 @@ const clientPlaywrightVersion = cp.execSync('npx playwright --version').toString * You can use all these details after your test has completed, to fetch logs or use any other Automate REST APIs */ const resp = await JSON.parse(await page.evaluate(_ => {}, `browserstack_executor: ${JSON.stringify({action: 'getSessionDetails'})}`)); - const jsonObj = await JSON.parse(resp); - console.log(jsonObj.hashed_id); // This gives the session ID of the running session - console.log(jsonObj); // This prints the entire JSON response. You can use any/all of the response attributes the way you like. + console.log(resp.hashed_id); // This gives the session ID of the running session + console.log(resp); // This prints the entire JSON response. You can use any/all of the response attributes the way you like. await browser.close(); })(); From b1385605e8dda3301db57388577715baae01ef97 Mon Sep 17 00:00:00 2001 From: sourav-kundu <66624530+sourav-kundu@users.noreply.github.com> Date: Thu, 2 Sep 2021 11:54:06 +0530 Subject: [PATCH 2/2] update readme due to new version release --- README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 19b63a2..4360c97 100644 --- a/README.md +++ b/README.md @@ -71,10 +71,12 @@ BrowserStack Playwright tests in beta supports the following browsers across the ### Playwright versions supported -Currently, we are supporting 2 Playwright versions viz. `1.11.1` and `1.10.0`. -Playwright version can be specified using a capability as: `'browserstack.playwrightVersion': '1.10.0'`. If you do not specify a value for this capability then your tests would run on the default version `1.11.1`. +Currently, we are supporting 2 Playwright versions. +Playwright version can be specified using a capability for e.g.: `'browserstack.playwrightVersion': '1.12.3'`. If you do not specify a value for this capability then your tests would run on the latest version that is supported on the BrowserStack platform. -You can also pass the capability value as `'browserstack.playwrightVersion': '1.latest'` or `1.latest-1` to signify the 2 latest versions within the major version `1`. If you pass this capability, then you can be rest assured that whichever are the latest versions on BrowserStack, your tests would run on that without you needing to change your test code often. +We recommend you to pass the capability value as `'browserstack.playwrightVersion': '1.latest'` or `1.latest-1` to signify the 2 latest versions within the major version `1`. If you pass this capability, then you can be rest assured that whichever are the latest versions on BrowserStack, your tests would run on that without you needing to change your test code often. + +You can learn more about the significance of selecting a Playwright version on the browser version in our [documentation](https://www.browserstack.com/docs/automate/playwright/browsers-and-os). ## Get Playwright session details