From de691e8564ba51f5c3b412a696f1bb8ecf2d1622 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Mon, 23 Apr 2018 09:14:22 -0700 Subject: [PATCH] casper: Fix race condition in stars test. I have no idea why this started failing just now, but the test was written without a proper wait in between actions, and fixing that fixes the failure I'd been seeing. --- frontend_tests/casper_tests/07-stars.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/frontend_tests/casper_tests/07-stars.js b/frontend_tests/casper_tests/07-stars.js index f6f346f8e6..29d7047bd6 100644 --- a/frontend_tests/casper_tests/07-stars.js +++ b/frontend_tests/casper_tests/07-stars.js @@ -37,10 +37,15 @@ casper.then(function () { // Clicking on a message star stars it. toggle_last_star(); - casper.test.assertEquals(star_count(), 1, - "Got expected single star count."); +}); - casper.click('a[href^="#narrow/is/starred"]'); +casper.then(function () { + casper.waitUntilVisible('#zhome .icon-vector-star', function () { + casper.test.assertEquals(star_count(), 1, + "Got expected single star count."); + + casper.click('a[href^="#narrow/is/starred"]'); + }); }); casper.waitUntilVisible('#zfilt', function () {