Git Product home page Git Product logo

Comments (6)

robertsLando avatar robertsLando commented on June 25, 2024 1

Ok fixed. The solution described above was correct I only had to do test in series instead of parallel.

This can be closed but I suggest to add an example on docs with the createBrowserContext like this.

Thanks again for the support given so far 🙏🏼

from web.

bashmish avatar bashmish commented on June 25, 2024

This might be the way, can you play with it?

// @web/test-runner-playwright/src/PlaywrightLauncher.ts
export type CreateBrowserContextFn = (args: CreateArgs) => BrowserContext | Promise<BrowserContext>;

export class PlaywrightLauncher implements BrowserLauncher {
  // ...
  private createBrowserContextFn: CreateBrowserContextFn;
  // ...
}

You can pass it via playwrightLauncher argument { createBrowserContext }.

from web.

robertsLando avatar robertsLando commented on June 25, 2024

Thanks for the hint:

function createBrowserContext({ browser, config }) {

    // ignore HTTPS errors
    const context = browser.newContext({
        ignoreHTTPSErrors: true
    })
    return context

}

....

export default {
    // https://modern-web.dev/docs/test-runner/browser-launchers/playwright/#testing-multiple-browsers
    // Requires: @web/test-runner-playwright
    browsers: [
        playwrightLauncher({
            product: 'chromium', createBrowserContext
        }), // { headless: false, devtools: true }  }),
        playwrightLauncher({ product: 'firefox', createBrowserContext }),
        playwrightLauncher({ product: 'webkit', createBrowserContext }),
    ],
....

This actually works for chromium but not for firefox and webkit, will do some more tests to dfind out how to make others working

from web.

robertsLando avatar robertsLando commented on June 25, 2024

It should work also for firefox and webkit based on docs but I them are not working as expected.... any other hint?

from web.

bashmish avatar bashmish commented on June 25, 2024

Ok fixed. The solution described above was correct I only had to do test in series instead of parallel.

did you have to set "concurrent: 1"? if so, then it might be related to a recent change in Chrome which cuts resources in inactive tabs, which are heavily used by WTR, so that many tests don't work in there
that's another issue which we don't have a solution for, so we recommend for now to disable concurrency

from web.

robertsLando avatar robertsLando commented on June 25, 2024

Nope I simply had to wait for ws tests to end before running wss tests, at start I was just starting both one after the other:

https://github.com/mqttjs/MQTT.js/blob/main/test/browser/test.js#L60

Tests are passing: https://github.com/mqttjs/MQTT.js/actions/runs/6782443335/job/18434666671#step:6:33 🎉

from web.

Related Issues (20)

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.