#testing

Testing Angular Components

Angular is one of the most modern frameworks for frontend development. While unit testing in backend is nothing special these days and will be practiced in nearly every project. But it's very rare to test frontend components. Which tools/frameworks would you recommend for frontend testing?

Website design & accessibility

Main problem that occurs is that designers focuses mainly on designing the website so it looks great. But lot of times they ignore about the user experience for people with disabilities and also people with age related impairments. There are many simple solutions for the problems: ● Lighthouse ○ Google supported tool ○ Creates html report ● ARC Toolkit ○ In browser extension ○ Lists all violated accessibility test ● NoCoffee -Vision Simulator

Usually Mockito provides methods with timeout,
verify(…, timeout(…). But often it is not useful.
Thread.sleep() is a bad practise and may not work in some situations. Also it waits concrete amount of time (e.g 3000ms) and will always wait this interval, even if the operation took 300ms.

A nice solution to the problem is using the test dependency Awaitility.
It is extremely easy to use, has a fluent API, polls regularly and is configurable, so every test can be optimised.
The idea behind it, is that it polls every 100ms (by default, but configurable) and after 10sec (also by default and configurable) it announce the test failed if the condition is not met.

await()
.atLeast(1, SECONDS)
.atMost(5, SECONDS)
.until(imageInCdnIsDeleted(imageUrl));

So, instead of waiting every time 10 minutes for test to finish, because of the sleep time, the suite will finish for the (near) max time required for the operations. For example it may finish for 3.5minutes, but also for 8minutes.

iOS WebView HTML video element inconsistency

Setting up a webview for iOS with a video element tag acts differently on iPhones and iPads. On iPhones when you play the video the video will be shown in fullscreen with the fullscreen video controler, on the other hand playing a video on the iPads will not play the video in fullscreen mode, it will play it in a container how the css specifies it.
Subscribe to #testing