Coder Social home page Coder Social logo

Comments (5)

kasperpeulen avatar kasperpeulen commented on August 27, 2024 1

We cannot .use in void

I know, just suggesting an idea.

I found out that this does work:

test.extend({ fixture: 'some fixture' })('some test', async ({ fixture }) => {
  // test
});

On runtime it works, but it gives TS errors. And of course is also quite ugly.

from playwright.

kasperpeulen avatar kasperpeulen commented on August 27, 2024

It would be interesting if you could attach use like this:

test('some test', async ({ fixture }) => {
  // test
}).use({
  fixture: 'some fixture'
})

from playwright.

Ransely-Nigrel avatar Ransely-Nigrel commented on August 27, 2024
.use({
  fixture: 'some fixture'
})

We cannot .use in void

from playwright.

pavelfeldman avatar pavelfeldman commented on August 27, 2024

The original issue refers to the Cannot use({ headless }) in a describe group, because it forces a new worker error. For the fixtures that force new workers (run browsers in a different mode), this will remain to be a hard limitation. You can't have headed and headless tests in the same file.

As for the .use on a test level, please use anonymous describes to wrap those tests and define use. As use refers to the scope and is not chained, that's the only way we'll support it.

from playwright.

kasperpeulen avatar kasperpeulen commented on August 27, 2024

@pavelfeldman
Can you comment if this is expected to work:

test.extend({ viewport: someViewport })('some test', async ({ fixture }) => {
  // test
});

it does work, but it gives TS errors

from playwright.

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.