Giter Club home page Giter Club logo

node-js-playwright-browserstack's People

Contributors

07souravkunda avatar agrawalsaurabhs avatar asambstack avatar bstack-security-github avatar kamal-kaur04 avatar pranavj1001 avatar somebodysmokein avatar yashdsaraf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

node-js-playwright-browserstack's Issues

Android devices: Error: browserType.launch: Browser has been closed

When I am trying to run the sample-test script with an Android device, I am getting the error:
Error: browserType.launch: Browser has been closed.
For Windows it works perfectly fine.

Steps to reproduce:

git clone https://github.com/browserstack/node-js-playwright-browserstack.git

Checkout to sdk branch.

Update the configuration file.
browserstack.yml

platforms:
  - deviceName: Samsung Galaxy S22 Ultra
    browserName: chrome # Try 'samsung' for Samsung browser
    osVersion: 12.0

package.json

"devDependencies": {
    "@playwright/test": "^1.35.0",
    "browserstack-node-sdk": "latest"
  }

Browserstack connection dosn't work with Playwright version 1.39.0

With version 1.39.0, browserstack throws the error "Error: browserType.connect: Error: deviceDescriptors: expected array, got undefined", likely because 1.39.0 is not available yet with Browserstack.
Same, when using 1.37.1 version, browserstack is automatically picking 1.38.0 (even when mentioned explicitly "client.playwrightVersion": "1.37.1"), and throwing errors.

Ideally, "client.playwrightVersion": should be able to work with the exact specified playwright version so to avoid such breaking changes.

Get error on step npm run sample-test

Hello Support,

I’m following the steps and get error on Step 4:
https://www.browserstack.com/docs/automate/playwright/getting-started/nodejs#MacOS_or_Linux

  1. [playwright-webkit@latest:OSX Ventura] › sample_test.js:4:1 › BstackDemo Add to cart ==========

    browserType.launch: Browser has been closed

     at Object.playwrightFixtures.browser.scope [as fn] ([/Users/kaushikchavda/Projects/node-js-playwright-browserstack/node_modules/@playwright/test/lib/index.js:180:51](mailto:/Users/kaushikchavda/Projects/node-js-playwright-browserstack/node_modules/@playwright/test/lib/index.js:180:51))
     at [/Users/kaushikchavda/Projects/node-js-playwright-browserstack/node_modules/@playwright/test/lib/fixtures.js:95:81](mailto:/Users/kaushikchavda/Projects/node-js-playwright-browserstack/node_modules/@playwright/test/lib/fixtures.js:95:81)
    
  2. [chrome@latest:Windows 11] › sample_test.js:4:1 › BstackDemo Add to cart ======================

browserType.launch: Browser has been closed

    at Object.playwrightFixtures.browser.scope [as fn] ([/Users/kaushikchavda/Projects/node-js-playwright-browserstack/node_modules/@playwright/test/lib/index.js:180:51](mailto:/Users/kaushikchavda/Projects/node-js-playwright-browserstack/node_modules/@playwright/test/lib/index.js:180:51))
    at [/Users/kaushikchavda/Projects/node-js-playwright-browserstack/node_modules/@playwright/test/lib/fixtures.js:95:81](mailto:/Users/kaushikchavda/Projects/node-js-playwright-browserstack/node_modules/@playwright/test/lib/fixtures.js:95:81)
  1. [playwright-firefox:Windows 11] › sample_test.js:4:1 › BstackDemo Add to cart =================
browserType.launch: Browser has been closed

    at Object.playwrightFixtures.browser.scope [as fn] ([/Users/kaushikchavda/Projects/node-js-playwright-browserstack/node_modules/@playwright/test/lib/index.js:180:51](mailto:/Users/kaushikchavda/Projects/node-js-playwright-browserstack/node_modules/@playwright/test/lib/index.js:180:51))
    at [/Users/kaushikchavda/Projects/node-js-playwright-browserstack/node_modules/@playwright/test/lib/fixtures.js:95:81](mailto:/Users/kaushikchavda/Projects/node-js-playwright-browserstack/node_modules/@playwright/test/lib/fixtures.js:95:81)

3 failed
[chrome@latest:Windows 11] › sample_test.js:4:1 › BstackDemo Add to cart =======================
[playwright-webkit@latest:OSX Ventura] › sample_test.js:4:1 › BstackDemo Add to cart ===========
[playwright-firefox:Windows 11] › sample_test.js:4:1 › BstackDemo Add to cart ==================

need example for integration with Percy Visual Testing + Docker

Need example for integration with Percy Visual Testing + Docker.

I am able to get the code base working in the Jammy playwright image using HTTPS_PROXY, HTTP_PROXY env variables.

But the snapshot upload fails with network connection failure.

There is very less information available to fix the issue with it.

Getting error during Legacy Integration my tests

Screenshot from 2024-03-12 09-54-26
When i trying "Legacy Integration" with my tests wrote on "NodeJS/Playwright", when i trying connect via wssEndpoint getting such issue "Error: browserType.connect: Target page, context or browser has been closed".

test('Authentication Test', async ({}) => {
    const caps = {
        osVersion: "13.0",
        deviceName: "Samsung Galaxy S23", // "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.username":  "userName",
        "browserstack.accessKey": "password",
        "browserstack.local":  true,
    }
  let vBrowser = await playwright.chromium.connect({
        wsEndpoint:
            `wss://cdp.browserstack.com/playwright?caps=` +
            `${encodeURIComponent(JSON.stringify(caps))}`,
    });

    let vContext = await vBrowser.newContext();

    const page = await vContext.newPage();

    await test.step("Login Test", async () => {
        await Login(page, config);
    })

Need to rethrow errors in sample tests

Please add throw(e); to line 37 in sample_test.js and to line 19 in local_test.js

The issue is the status of the local tests is not the same as the status of the test in browserstack because we're consuming the error in the test.

typescript version

Hi, do you have a typescript version of this repo to use on BrowserStack Automate SDK with browserstack.yml file ?

Is playwright supported? Tests fail but show as passed

The sdk branch appears to use framework: playwright, and this is GitHub repository is linked to in the setup documentation for Playwright and BrowserStack.

In the sdk branch, when you set retries: 3 in the playwright configuration file for re-running test failures and then run npm run sample-test command, (with your own user/access key) it marks the tests in BrowserStack as passed, but throws these errors in the console and the SDK marks the tests as failed, leading to it retrying over and over.

Running 4 tests using 2 workers

1) [playwright-firefox@latest:Windows 11@browserstack] › tests\bstack_test_add_to_cart.js:3:1 › BStackDemo test add to cart

    Error: : expected object, got undefined

    Retry #1 ───────────────────────────────────────────────────────────────────────────────────────
    Error: : expected object, got undefined

    Retry #2 ───────────────────────────────────────────────────────────────────────────────────────
    Error: : expected object, got undefined

    Retry #3 ───────────────────────────────────────────────────────────────────────────────────────
    Error: : expected object, got undefined

But in BrowserStack, it shows as passed sessions:
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.