English 中文(简体)
How to get test result in fixture
原标题:

is it possible to get test result in Playwright fixture? See the sample code below, how to access test result(passed/failed/skipped) after await use(todoPage); in testFixture? It would help me decide whether it need to do some afterEach job in the fixture.

Or shall I add a testFixture.afterEach() in the myTest.spec.ts? Is it a best practise?

const testFixture = base.extend<{ todoPage: TodoPage }>({
  todoPage: async ({ page }, use) => {
    const todoPage = new TodoPage(page);
    await todoPage.goto();
    await todoPage.addToDo( item1 );
    await todoPage.addToDo( item2 );
    await use(todoPage);
    await todoPage.removeAll();
  },
});

testFixture ( should add an item , async ({ todoPage }) => {
  await todoPage.addToDo( my item );
  // ...
});
问题回答

暂无回答




相关问题
store data in memory with nestjs

I am trying to persist some data in my nestjs server so I can then use that data in my client app through http requests. I have created a products.service.ts file with the function getAllData() that ...

React Hook Form Error on custom Input component

I am having a problem when I use react hook form + zod in my application, in short the inputs never change value and I get the following error in the console: Warning: Function components cannot be ...

Updatable promises using proxy in JavaScript

EDIT: I ve updated this question, and the old question is moved here. A POC can be found on this jsfiddle or the snippet below GOAL: The goal here is to make or rather simulate a promise that can be ...

热门标签