Last modified: 2014-11-15 02:58:04 UTC
"Scenario: Deleting a topic" in features/moderation.feature occasionally fails with Then the top post should be marked as deleted # features/step_definitions/moderation_steps.rb:41 expected "This topic was locked by Selenium user" to match "This topic has been deleted" (RSpec::Expectations::ExpectationNotMetError) ./features/step_definitions/moderation_steps.rb:42:in `/^the top post should be marked as deleted$/' features/moderation.feature:17:in `Then the top post should be marked as deleted' This happens if a Locked topic is in the top few topics on the Flow board. The newly-created top topic (<- note the terminology "top post" is wrong!) does show "This topic has been deleted. Undo" as expected, but the test is somehow picking up the moderation text of the locked topic further down on the Flow board.
After the failure, the first div(:flow_first_topic_moderation_msg, css: "div.flow-topic-titlebar div.flow-moderated-topic-title") does contain "This topic has been deleted". So the test should work regardless of what else is on the page. My guess is this test needs to wait for the page to "settle down" before calling first_topic_moderation_msg_element.when_present, which may immediately find an existing "This topic was locked" lower down the page. As a start the test should wait for "AND the API action completes", e.g. when_not_present class='.flow-api-inprogress' away or check that the cursor is no longer a wait cursor. I wonder if lots of tests need "AND the API action completes".
Gerrit change #171221 (why isn't Gerrit Notification Bot doing this?)