learningequality / ka-lite

KA Lite: lightweight web server for serving core Khan Academy content (videos and exercises) without needing internet connectivity
https://learningequality.org/ka-lite/
Other
458 stars 305 forks source link

Fix BDD tests on newer Firefox / Selenium versions #5505

Closed benjaoming closed 6 years ago

benjaoming commented 7 years ago

Summary

On Circle CI, builds are working fine because it uses Firefox 47. But in later versions of Firefox, we have timeouts when testing logout()

def logout(context):
    url = reverse("api_dispatch_list", kwargs={"resource_name": "user"}) + "logout/"
    context.browser.get(build_url(context, url))
    pre_element = find_css_with_wait(context, "pre")
    json_response_text = pre_element.text
    assert "success" in json_response_text and "true" in json_response_text

It builds on an assumption that the browser displays the JSON response as a DOM with everything wrapped in a <pre>.... which it doesn't anymore

Suggesting to just check that the HTTP response is 200 and be fine with that.

mrpau-eugene commented 6 years ago

Fixed in #5532