plantuml / plantuml-server

PlantUML Online Server
https://plantuml.com/
GNU General Public License v3.0
1.6k stars 462 forks source link

Webapp accessibility fixes #250

Closed niceborn closed 1 year ago

niceborn commented 1 year ago
arnaudroques commented 1 year ago

Many thanks for your contribution. Not sure why some tests fail. Could you have a look at it? Thanks!

niceborn commented 1 year ago

Hello, I was not aware, that there are automatical tests. Perhaps they fail, because now there are 4 submit buttons and the default image on the site is an SVG instead a PNG for quality reasons? I see there are some tests about the height and width of the image on this testsite. I'm not very familiar with Java tests.

arnaudroques commented 1 year ago

EcmaError: lineNumber=[84] column=[0] lineSource=[] name=[TypeError] sourceName=[script in http://localhost:8080/plantuml/uml/SyfFKj2rKt3CoKnELR1Io4ZDoSddoaijBqXCJ-Lo0ahQwA99Eg7go4ajKIzMA4dCoKPNdfHQKf9Qf92NNuAknqQjA34ppquXgJ8Lbrr0AG00 from (80, 13) to (104, 10)] message=[TypeError: Cannot call method "query" of undefined (script in http://localhost:8080/plantuml/uml/SyfFKj2rKt3CoKnELR1Io4ZDoSddoaijBqXCJ-Lo0ahQwA99Eg7go4ajKIzMA4dCoKPNdfHQKf9Qf92NNuAknqQjA34ppquXgJ8Lbrr0AG00 from (80, 13) to (104, 10)#84)]

It looks like navigator.permissions is not known by the browser used during the test (so query() cannot be called)

Maybe we should check if navigator.permissions is not null at line 98 ?

niceborn commented 1 year ago

OK, I can change this later.

arnaudroques commented 1 year ago

ChatGPT suggests:

if (typeof navigator.permissions !== "undefined" && navigator.permissions !== null) {
  // navigator.permissions is not null
}

:-)

Not sure if that makes sense

niceborn commented 1 year ago

Seems to work now. Now we get the image not detected message (No image detected in response). I revert the change.