Commit 689e242c authored by Vincent Pelletier's avatar Vincent Pelletier

erp5_web_renderjs_ui: Add a small delay during language change.

In order to stabilise UI tests which are waiting for the loading animation
to play during language change.
Pick a small delay so users should not notice (value suggested by Romain).
parent 9ce2a212
Pipeline #20050 failed with stage
in 0 seconds
......@@ -22,7 +22,11 @@
.declareMethod("render", function () {
var gadget = this;
return new RSVP.Queue()
return new RSVP.Queue(
// Stabilise UI tests with a tiny delay, which should be unnoticeable
// to users.
RSVP.delay(200)
)
.push(function () {
return RSVP.all([
gadget.getUrlForList([{command: 'history_previous'}]),
......
  • @romain: notification just so you know I pushed this.

  • @vpelletier FYI, I tried today to extend this idea to all pages, so that the loader is display for a minimal amount of time, but I don't like the result currently, as it adds flickering (I feel the delay between the page and the header rendering). I should find a way to improve this.

  • FWIW, 60fps means 16.7ms per frame. Maybe a delay of 10ms would be less noticeable ? I do not know if it would still work reliably for the purpose of stabilising tests.

    Either way, I feel the current approach used in tests is very hackish. Would it be possible to have some dummy tag attribute modified whenever a load happened, and to trigger selenium waits on it ? (fetch current value from DOM into some variable, trigger change, wait until value in DOM is different from variable)

Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment