0

I'm the author of ScadaJS and I need to create unit tests for visual components. Up to now, the components are checked manually by human interaction.

For example, this bug simply describes what the problem is with a visual component by screenshots. Reporter says "it should look like this but looks like that and this is not something expected". Developers fix the component, check it manually in the showcase page and close the issue if everything goes well.

As one component's changes may break more than one other component, I think we should automate these tests. How do the people perform such checks in libraries where the visual stuff come into play?

A guess

We could write a script that will automatically create mouse movements and clicks, then it will create a .gif which will be used to create a reference point. If anything changes, difference of two gifs won't be a black .gif, so the test suit will throw an exception. If we set a flag to indicate "everything is OK with this component, I only changed the font size", then it will use new .gif as a reference point.

1 Answer 1

1

Selenium could be something worth to checkout. Image compare could be one option but I don't think it is very usable. Even slightest change in the component would break the test and storing reference images is pretty tedious job.

Sign up to request clarification or add additional context in comments.

1 Comment

This is very close what I needed. Maybe such a testing framework could be created based on Selenium.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.