{"action":"created","issue":{"url":"https://api.github.com/repos/consul/consul/issues/2542","repository_url":"https://api.github.com/repos/consul/consul","labels_url":"https://api.github.com/repos/consul/consul/issues/2542/labels{/name}","comments_url":"https://api.github.com/repos/consul/consul/issues/2542/comments","events_url":"https://api.github.com/repos/consul/consul/issues/2542/events","html_url":"https://github.com/consul/consul/pull/2542","id":307168850,"number":2542,"title":"Fix Flaky spec: Moderate debates Hide","user":{"login":"iagirre","id":31625251,"avatar_url":"https://avatars3.githubusercontent.com/u/31625251?v=4","gravatar_id":"","url":"https://api.github.com/users/iagirre","html_url":"https://github.com/iagirre","followers_url":"https://api.github.com/users/iagirre/followers","following_url":"https://api.github.com/users/iagirre/following{/other_user}","gists_url":"https://api.github.com/users/iagirre/gists{/gist_id}","starred_url":"https://api.github.com/users/iagirre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iagirre/subscriptions","organizations_url":"https://api.github.com/users/iagirre/orgs","repos_url":"https://api.github.com/users/iagirre/repos","events_url":"https://api.github.com/users/iagirre/events{/privacy}","received_events_url":"https://api.github.com/users/iagirre/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-21T09:24:09Z","updated_at":"2018-03-21T16:16:52Z","closed_at":null,"author_association":"COLLABORATOR","pull_request":{"url":"https://api.github.com/repos/consul/consul/pulls/2542","html_url":"https://github.com/consul/consul/pull/2542","diff_url":"https://github.com/consul/consul/pull/2542.diff","patch_url":"https://github.com/consul/consul/pull/2542.patch"},"body":"References\r\n==========\r\n- This is a **backport** of the issue https://github.com/AyuntamientoMadrid/consul/issues/1222 from Madrid's fork about a flaky spec.\r\n- The **original PR** is https://github.com/AyuntamientoMadrid/consul/pull/1372\r\n\r\nObjectives\r\n==========\r\nThere was a flaky in the file `spec/features/moderation/debates_spec.rb` when hidding debates. The problem was a race condition that appeared after clicking the 'Hide' button.\r\nThis button hides a debate, and in the UI it fades using JS. If the test was fast enought and the expect assertion executes before the CSS class changes, Capybara won't find any id that matches `#debates_#{debate.id}.faded`; there is a div with id `#debate_5`, but it's not faded yet.\r\n\r\nTo make Capybara wait the stablished wait_time (capybara's `max_wait_time`, by default 2 secs), I changed the assertion. Instead of using `have_css(...)`, I used `find(...)`, that, according to [this](https://www.urbanbound.com/make/fix-flaky-feature-tests-by-using-capybaras-apis-properly), waits for the element to appear in the screen.\r\nSo, it expects to find and object and then checks if that object has a text (the debate title in this case)\r\n\r\nVisual Changes\r\n=======================\r\nThere aren't, it's a flaky.\r\n\r\nNotes\r\n=====================\r\nNothing to mention.\r\n"},"comment":{"url":"https://api.github.com/repos/consul/consul/issues/comments/375001698","html_url":"https://github.com/consul/consul/pull/2542#issuecomment-375001698","issue_url":"https://api.github.com/repos/consul/consul/issues/2542","id":375001698,"user":{"login":"bertocq","id":983242,"avatar_url":"https://avatars1.githubusercontent.com/u/983242?v=4","gravatar_id":"","url":"https://api.github.com/users/bertocq","html_url":"https://github.com/bertocq","followers_url":"https://api.github.com/users/bertocq/followers","following_url":"https://api.github.com/users/bertocq/following{/other_user}","gists_url":"https://api.github.com/users/bertocq/gists{/gist_id}","starred_url":"https://api.github.com/users/bertocq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bertocq/subscriptions","organizations_url":"https://api.github.com/users/bertocq/orgs","repos_url":"https://api.github.com/users/bertocq/repos","events_url":"https://api.github.com/users/bertocq/events{/privacy}","received_events_url":"https://api.github.com/users/bertocq/received_events","type":"User","site_admin":false},"created_at":"2018-03-21T16:16:52Z","updated_at":"2018-03-21T16:16:52Z","author_association":"OWNER","body":"Great @iagirre !"}}
{"actor":{"display_login":"bertocq"}}