Page MenuHomePhabricator

Flow: "Deleting a topic" browser test is confused by Locked topic
Closed, ResolvedPublic

Description

"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.


Version: master
Severity: normal

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 3:48 AM
bzimport set Reference to bz72993.
bzimport added a subscriber: Unknown Object (MLST).

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 171221 (why isn't Gerrit Notification Bot doing this?)

Change 171221 had a related patch set uploaded (by Catrope):
QA: wait for API to complete when moderating

https://gerrit.wikimedia.org/r/171221

Change 171221 abandoned by Sbisson:
QA: wait for API to complete when moderating

Reason:
Too old and no longer relevant with the current state for those tests.

https://gerrit.wikimedia.org/r/171221

SBisson claimed this task.