Project

General

Profile

Bug #15762

HostJSTest: show action buttons fails intermittently to match flash

Added by Dominic Cleal about 4 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Tests
Target version:
Difficulty:
Triaged:
Bugzilla link:
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.

Associated revisions

Revision ca9bf61b (diff)
Added by Dominic Cleal about 4 years ago

fixes #15762 - move flash testing out of integration test

The flash div is only present momentarily before jnotify removes the
element and re-displays it as a popup, so only check that it's set in
the response from functional tests.

History

#1 Updated by The Foreman Bot about 4 years ago

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

#2 Updated by Dominic Cleal about 4 years ago

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

#3 Updated by Dominic Cleal about 4 years ago

  • Legacy Backlogs Release (now unused) set to 160

Also available in: Atom PDF