← Back to Discord Forum

Custom fixture not accepted for `storageState` function.

I am receiving the error Fixture "storageState" has unknown parameter "uiSetting" when attempting to use the following ``` test.use({ storageState: async ({baseURL, uiSetting, storageState}, use) => { await use(storageState) } })

This thread is trying to answer question "Why am I receiving an error message about an unknown 'uiSetting' parameter when trying to use a custom fixture for the 'storageState' function?"

1 reply

I have set the following ``` import {test as base} from '@playwright/test';

export type TestOptions = { uiSetting: UiSetting; };

export const test = base.extend<TestOptions>({ uiSetting: ['new', {option: true}], });


Troubleshooting 'uiSetting' Parameter Error in Playwright

If you're getting an error about an unknown 'uiSetting' parameter when using a custom fixture for the 'storageState' function in @playwright/test, it's likely due to an issue with your custom fixture definition or usage.

Review Your Code

First, check your code. Custom fixture names should start with a letter or underscore and can only contain letters, numbers, and underscores. Here's an example:

import { test } from '@playwright/test';

test('my test', async ({ page }) => {
  // Your test code here

Overriding Fixtures

Next, ensure you've correctly overridden the existing fixtures. Overriding allows you to modify fixture behavior to suit your needs. But remember, you need to consider any dependencies on other built-in fixtures or parameters.

Check for Typos

Also, look for typos or incorrect usage of parameters in your code. The 'uiSetting' parameter isn't a built-in parameter for the 'storageState' function in Playwright.

Seek Assistance

If you're still stuck, consult the official documentation or online forums. They can provide insights into common pitfalls or offer solutions specific to this issue.

Remember, troubleshooting requires attention to detail and understanding of how fixtures work in Playwright. By following best practices and ensuring proper implementation of custom fixtures, you can effectively overcome this error.

For more tips on mastering Playwright, check out this comprehensive guide.

Related Discord Threads

AboutQuestionsDiscord ForumBrowser ExtensionTagsQA Jobs

Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email luc@ray.run.