I am trying to setup a playwright project to run high-contrast tests for Firefox. I have a working setup for chromium in high-contrast using the following in my playwright config:
name: 'chromium-highContrast',
use: {
browserName: 'chromium',
colorScheme: 'dark',
contextOptions: { forcedColors: 'active' },
}
Now if I try the same setup for my Firefox tests it does not work. So for Firefox I would setup the project like this:
name: 'firefox-highContrast',
use: {
browserName: 'firefox',
colorScheme: 'dark',
contextOptions: { forcedColors: 'active' },
}
The screenshot tests still show Firefox normally while in chromium they show as high-contrast. Same for debugging. I use Fedora 38 and playwright version 1.35.0 .
Do I need a different setup for Firefox or can I accomplish this in another way?
Edit: Added a Screenshot of the expected colors




I managed to set this up using the following settings.
The playwright browser sets some additional settings which differ from my local firefox version. My result looks like this which is still a little bit off but close enough for my purposes:
I use this Website to display the current browser config