Skip to content
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

test(freedrawing): test enhancement #7941

Merged
merged 45 commits into from May 22, 2022
Merged

Conversation

ShaMan123
Copy link
Contributor

@ShaMan123 ShaMan123 commented May 14, 2022

This PR is a byproduct of the next PR that will add erasing visual tests.
I added logic to freedrawing tests to prepare for testing erasing and decided (with your voice guiding me :)) to split up the PR into dedicated changes.
This PR adds another layer of tests to free drawing by testing visuals before and after mouseup and comparing between them.
I think it's relevant and to the point.
It is proven by the tests failing (freedrawing4 - Simple free drawing, with opacity) - you might want to output the mesh result to a different file to compare changes. It might be desirable in general so tell me if to commit a different golden name for the mesh test. Shadow + opacity cause this it seems

@ShaMan123 ShaMan123 requested a review from asturur May 14, 2022 15:02
@ShaMan123
Copy link
Contributor Author

What about the failing test?

@asturur
Copy link
Member

asturur commented May 18, 2022

oh i assumed the failing test was firefox as usual

@asturur
Copy link
Member

asturur commented May 18, 2022

Is the broken test a new test?
i see it has opacity and shadow, was the golden built with node?

@asturur
Copy link
Member

asturur commented May 18, 2022

The website visual test got broken, probably the qunit update.
I need to fix that so i can see the difference in chrome/firefox

@ShaMan123
Copy link
Contributor Author

i see it has opacity and shadow, was the golden built with node?

The test was built in node. It is a new test. It's the upper canvas test.

@asturur
Copy link
Member

asturur commented May 19, 2022

We can fix the the display in browser, take the golden from there, and disable the node test once we understand how much the difference is. With shadow and opacity is mostly normal

@ShaMan123
Copy link
Contributor Author

I have just updated ruby so I can't serve the website as well.
Makes sense to disable the test on node as it is interactive visuals only.

ShaMan123 added a commit to fabricjs/fabricjs.com that referenced this pull request May 19, 2022
@github-actions
Copy link
Contributor

github-actions bot commented May 19, 2022

Code Coverage Summary

> fabric@5.1.0 coverage:report
> nyc report --reporter=lcov --reporter=text

-----------|---------|----------|---------|---------|-----------------------------------------------
File       | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s                             
-----------|---------|----------|---------|---------|-----------------------------------------------
All files  |   83.04 |    75.94 |   85.69 |   82.77 |                                               
 fabric.js |   83.04 |    75.94 |   85.69 |   82.77 | ...,30850,30924,30935-31000,31123,31222,31458 
-----------|---------|----------|---------|---------|-----------------------------------------------

@github-actions
Copy link
Contributor

github-actions bot commented May 19, 2022

Code Coverage Summary

> fabric@5.1.0 coverage:report
> nyc report --reporter=lcov --reporter=text

-----------|---------|----------|---------|---------|-----------------------------------------------
File       | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s                             
-----------|---------|----------|---------|---------|-----------------------------------------------
All files  |   83.09 |    75.98 |   85.69 |   82.82 |                                               
 fabric.js |   83.09 |    75.98 |   85.69 |   82.82 | ...,30850,30924,30935-31000,31123,31222,31458 
-----------|---------|----------|---------|---------|-----------------------------------------------

@github-actions
Copy link
Contributor

github-actions bot commented May 19, 2022

Code Coverage Summary

> fabric@5.1.0 coverage:report
> nyc report --reporter=lcov --reporter=text

-----------|---------|----------|---------|---------|-----------------------------------------------
File       | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s                             
-----------|---------|----------|---------|---------|-----------------------------------------------
All files  |    83.1 |    76.01 |   85.69 |   82.83 |                                               
 fabric.js |    83.1 |    76.01 |   85.69 |   82.83 | ...,30850,30924,30935-31000,31123,31222,31458 
-----------|---------|----------|---------|---------|-----------------------------------------------

@ShaMan123
Copy link
Contributor Author

I have managed to serve the website

expected is golden generated in node
actual is generated in browser (chrome)
image

@ShaMan123
Copy link
Contributor Author

If I understand correctly node canvas doesn't apply opacity to the shadow...
What is the expected behavior?

@asturur
Copy link
Member

asturur commented May 19, 2022

we can take the browser one that is most common case ( especially for free drawing ) and we can disable the test when we detect node with fabric.isLikelyNode and move forward.
Did you manage to fix the qunit display in the website?
I remember i worked on it really recently and i fixed it.

@asturur
Copy link
Member

asturur commented May 19, 2022

image

i fixed it here, then:

image

i broke it there and i didn't verify it.

I saw we updated qunit in fabric and i thought it was a good idea to have the same version

@asturur
Copy link
Member

asturur commented May 19, 2022

When hiding passed tests is still broken, anyway, there are 22 failing tests in 5.2.0 mostly on svg import, i wonder what happened

@ShaMan123
Copy link
Contributor Author

I don't see any of it...
Did you run the start cmd from fabric.js dir?

image

@ShaMan123
Copy link
Contributor Author

image

i fixed it here, then:

image

i broke it there and i didn't verify it.

I saw we updated qunit in fabric and i thought it was a good idea to have the same version

Where is this? In the website? I have the website up and running locally

@github-actions
Copy link
Contributor

github-actions bot commented May 19, 2022

Code Coverage Summary

> fabric@5.1.0 coverage:report
> nyc report --reporter=lcov --reporter=text

-----------|---------|----------|---------|---------|-----------------------------------------------
File       | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s                             
-----------|---------|----------|---------|---------|-----------------------------------------------
All files  |   83.05 |    75.98 |   85.69 |   82.78 |                                               
 fabric.js |   83.05 |    75.98 |   85.69 |   82.78 | ...,30850,30924,30935-31000,31123,31222,31458 
-----------|---------|----------|---------|---------|-----------------------------------------------

@ShaMan123
Copy link
Contributor Author

All set

@asturur asturur merged commit 4263d5b into master May 22, 2022
@ShaMan123
Copy link
Contributor Author

I forget about the json...
I guess it will wait for es6

@ShaMan123 ShaMan123 deleted the freedrawing-test-enhancement branch September 11, 2022 23:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants