-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Playwright version 4.9.0] / Microsoft.Playwright.PlaywrightException : TypeError: No color space found with id = "oklch" #169
Comments
Thanks for the issue. Would it be possible to see the test code that generates that error? Specifically the HTML that Deque.AxeCore.Playwright is testing against. I can't think of anything that's changed from 4.8.2 to 4.9.0 that would cause this problem as we didn't do anything to update color spaces. 4.7.1 is where we added support for CSS 4 color spaces such as |
Thanks @straker - yes it does seem odd but it's the only thing I could see in the changelog that looked semi-related to color spaces! The snippet below is the code we're using for our TestHelper. The error in our tests can be traced back to the last line in this snippet ie It's Chromium browser and we have also set the following in our tests:
Snippet from TestHelper where the last line is causing the errors:
|
Thanks for the code snippet. Do you by chance know what the HTML of the page looks like at the time the error is thrown? Would it be possible to put that HTML either in this issue or somewhere public (like a gist or codepen, etc.)? |
Thanks - it's a lot of different pages that had this test failure, here's one example: https://system.spektrix.net/qa_automation_accessibility/website/eventlist.aspx |
Hey @evelynmcr! I spun up an example using the URL provided and wasn't able to replicate the same error message. The stack trace refers to a possible issue with an iframe, the example URL doesn't appear to have any iframes but I've tested other pages that do contain iframes and have not had that error thrown. Are you passing any specific Chrome options that could affect your tests? <ItemGroup>
<PackageReference Include="Deque.AxeCore.Playwright" Version="4.9.0" />
<PackageReference Include="Microsoft.Playwright" Version="1.42.0" />
</ItemGroup> using Deque.AxeCore.Commons;
using Deque.AxeCore.Playwright;
using Microsoft.Playwright;
public class Example
{
public static async Task Main(string[] args)
{
var playwright = await Playwright.CreateAsync();
var browser = await playwright.Chromium.LaunchAsync(
new BrowserTypeLaunchOptions
{
Headless = false
}
);
var page = await browser.NewPageAsync();
await page.GotoAsync("https://system.spektrix.net/qa_automation_accessibility/website/eventlist.aspx");
AxeResult axeResults = await page!.RunAxe();
foreach (var violation in axeResults.Violations)
{
Console.WriteLine("Rule ID: " + violation.Id);
foreach (var node in violation.Nodes)
{
Console.WriteLine("Node HTML: " + node.Html);
}
}
}
} |
Hi @Zidious , thanks for this. Very odd as we're not using an iframe anywhere other than on our payments page (we have an iframe for the card details / payment processing) but it's still the same error on all the pages that don't have this iframe. Below are the only additional browser options we have configured:
|
Hmm, interesting ya that shouldn't affect anything. I did notice:
Could you shed a bit more light on |
Thanks - I actually posted the AxeHelper code further up here Re: rulesToExclude, it differs depending on what page is being tested, but is one of the following: AxeRules.ColorContrast |
My mistake, missed that! Are you able to run my example outside of your existing test suite and do you get any errors relating to color space? |
@evelynmcr I just ran into this same error message on a different website. The issue was caused by the website loading a script that overrode native JS features (like array functions) which causes our script to work in unexpected ways, thus causing the error. They were using prototype.js. Do you know if your test pages that are erroring load any scripts that might override native JS features? |
@straker thanks - we do use prototype.js and some other scripts on some of our pages too so perhaps that's causing the issue. Do you have any idea why it's only with the new version of Playwright that it's interacting like this? @Zidious - apologies, not had a chance to try running that example yet, can try it tomorrow! |
@evelynmcr I tried older versions and it looks like axe-core still errors but changes where the error occurs. Axe-core v4.8.4 errors when running color contrast and produces an |
@straker thanks - so both errors about color, but still different? Our current version on main is 4.8.2 which runs the tests successfully. So I guess something must have happened between 4.8.2 and 4.8.4 if there's errors happening on the latter (As an aside, we've upgraded our version of Microsoft.Playwright from 1.42.0 to 1.43.0 and the tests are still failing) |
Hi, just wondering if anything else has come of this. Every dependabot PR we get now for our tests repo (for other packages, but includes the Deque.AxeCore.Playwright upgrade too) fails until we remove the Deque.AxeCore.Playwright package upgrade to 4.9.0. I can't see 4.8.4 (to check for diff between 4.8.2 and 4.8.4) so presumably it's not available publicly? Any other thoughts? Thanks! |
@evelynmcr Unforntuatefnly I don't think there's anything we can do about the issue. Since we've determined it's the |
As an update, we've upgraded to version 4.9.1 now and our tests are passing again! Seems like it didn't like 4.9.0 but 4.9.1 is good. |
Glad to hear, going to close this issue then. As part of 4.9.1 we found a workaround to the |
Which package were you using when you encountered the issue?**
Describe the bug
We have a .NET project which uses Playwright Axe for accessibility testing of our site. These tests have been running successfully so far. We just got a dependabot PR in our project to bump the version of Deque.AxeCore.Playwright from 4.8.2 to 4.9.0. However, a lot of our tests have failed with this version change due to an issue with the oklch color space. Error message can be found below.
I tried rerunning our tests on our main branch (where Playwright version is still 4.8.2) and they all pass. It's only on the PR with the new version of Playwright (4.9.0) that they fail. I don't have much knowledge about color spaces; looking at the diff for v4.8.2 vs v4.9.0 I'm unsure what in the new version would have caused this.
We're using .NET version 8.0 and Microsoft.Playwright version 1.42.0, if relevant.
Any guidance appreciated.
The text was updated successfully, but these errors were encountered: