pixiebrix-extension icon indicating copy to clipboard operation
pixiebrix-extension copied to clipboard

[e2e testing] refactor fixture logic to preload link state

Open fungairino opened this issue 1 year ago • 1 comments

Right now we have to load the admin console every time we run a playwright test to link the extension properly. It would be better to figure out a way to save the state of the extension chrome storage in the fixture so that it is preloaded.

See relevant code in our fixture: https://github.com/pixiebrix/pixiebrix-extension/blob/86e7ba484910ba5faf7f27a2acd2b6d5d381588d/end-to-end-tests/fixtures/extensionBase.ts#L79

It seems like playwright has limited support for modifying the chrome storage. We might need to find a work-around or wait for them to add support: https://github.com/microsoft/playwright/issues/14949

@grahamlangford

fungairino avatar Mar 12 '24 18:03 fungairino

It seems like playwright has limited support for modifying the chrome storage. We might need to find a work-around or wait for them to add support:

IIRC, you might use https://playwright.dev/docs/evaluating to send custom events that some DEBUG-only build hooks listen for?

twschiller avatar Mar 12 '24 18:03 twschiller