Project

General

Profile

Actions

Bug #15762

closed

HostJSTest: show action buttons fails intermittently to match flash

Added by Dominic Cleal over 7 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Tests
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

Occasional intermittent failures are occurring in this test:

HostJSTest::hosts index multiple actions.test_0001_show action buttons (from HostJSTest__hosts index multiple actions)
Took 42 sec.

Failed assertion, no message given. (Minitest::Assertion)
/var/lib/workspace/workspace/test_develop_pr_core_integration_only/database/postgresql/label/fast/ruby/2.0.0/test/integration/host_js_test.rb:249

The assertion is:

assert has_selector?("div", :text => "Updated hosts: changed environment")

The danger with this selector is that it's trying to match a flash message sent after the request's completed, but it's attempting to match the flash before it's displayed when it's in the HTML:

<div class="flash hide notice">Updated hosts: changed environment</div>

When the notify JS runs to display the message, it deletes the element and temporarily creates a new div elsewhere in the document with a slightly different text.

<ul class="ui-autocomplete ui-front ui-menu ui-widget ui-widget-content ui-corner-all" id="ui-id-1" tabindex="0" style="display: none;"></ul><div class="jnotify-container"><div class="jnotify-notification jnotify-notification-success"><div class=""></div><div class="foreman-alert alert alert-success"><div></div><span class="pficon pficon-ok"></span><strong>Success: </strong>Updated hosts: changed environment</div></div></div></body></html>

And then when the flash disappears, so does the element and any trace of the message. It's probably best to test success and the flash in a different way.

Actions #1

Updated by The Foreman Bot over 7 years ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/3665 added
Actions #2

Updated by Dominic Cleal over 7 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100
Actions #3

Updated by Dominic Cleal over 7 years ago

  • translation missing: en.field_release set to 160
Actions

Also available in: Atom PDF