Page MenuHomePhabricator

Create browser tests for hovering link and showing hovercard
Closed, ResolvedPublic

Description

Create a browser test for the basic feature, visiting a page, hovering a link, seeing a hovercard, mouseout and card is hidden.

AC

  • Browser test about hovering and showing/hiding a hover card

Event Timeline

Change 283566 had a related patch set uploaded (by Jhernandez):
Add browser test for hovering link

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

Change 283566 merged by Phuedx:
Add browser test for hovering link

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

Do these tests run anywhere? Should we setup @integration tests?

They don't at the moment. Yes we should. T133018 is related.

phuedx claimed this task.
phuedx subscribed.

Given that the scope of this task is to add "browser [tests] about hovering and showing/hiding a hover card", I'm happy to close this as Resolved.

Given the browser test is failing on Jenkins (and fails for me when I run locally) I think closing this was premature.

Change 284449 had a related patch set uploaded (by Bmansurov):
QA: Correctly enable the beta feature

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

Weird. I ran these tests a number of times while fixing up @bmansurov's patch during code review and saw them pass consistently. I guess it was timing sensitive. Regardless, we have a fix! Woo!

I suspect it depends if you are using user factory or not - if you do a new user gets created each time. If you don't your user a dedicated user who may already have the beta feature enabled.

Weird. I ran these tests a number of times while fixing up @bmansurov's patch during code review and saw them pass consistently. I guess it was timing sensitive. Regardless, we have a fix! Woo!

It turns out that we weren't installing TextExtracts and PageImages before running the tests. This has since been fixed.

Change 284495 had a related patch set uploaded (by Phuedx):
[WIP] Enable Hovercards beta feature in browser tests

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

Change 284495 merged by jenkins-bot:
QA: Enable Hovercards beta feature in browser tests

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

The test seems to pass in Jenkins, but for completeness I would recommend we also review/merge https://gerrit.wikimedia.org/r/284449 given that browser tests are failing for me locally.

As we've seen browser tests can be flakey if you let them but I defer to @Jhernandez whether he wants to sign off with or without this.

Change 284449 merged by jenkins-bot:
QA: Updates to browser tests to avoid flakiness

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

Thanks all, I see they work fine https://integration.wikimedia.org/ci/job/mwext-mw-selenium/5696/console

I personally can't run them locally, I'm getting this error:

Feature: Popups core

  Background:                                       # features/popups_core.feature:3
    Given the hover cards test page is installed    # features/support/step_definitions/common_steps.rb:1
    And I am logged in                              # mediawiki_selenium-1.6.5/lib/mediawiki_selenium/step_definitions/login_steps.rb:1
      {"errorMessage":"Can only set Cookies for the current domain","request":{"headers":{"Accept":"application/json","Accept-Encoding":"gzip;q=1.0,deflate;q=0.6,identity;q=0.3","Connection":"close","Content-Length":"117","Content-Type":"application/json; charset=utf-8","Host":"127.0.0.1:8910","User-Agent":"Ruby"},"httpVersion":"1.1","method":"POST","post":"{\"cookie\":{\"name\":\"wiki_session\",\"value\":\"535dip29ued4m41bihieqr3mp5eej6p0\",\"secure\":false,\"path\":\"/\",\"domain\":null}}","url":"/cookie","urlParsed":{"anchor":"","query":"","file":"cookie","directory":"/","path":"/cookie","relative":"/cookie","port":"","host":"","password":"","user":"","userInfo":"","authority":"","protocol":"","source":"/cookie","queryKey":{},"chunks":["cookie"]},"urlOriginal":"/session/d73a6e80-07d8-11e6-9e6e-69332d2220b2/cookie"}} (org.openqa.selenium.InvalidCookieDomainException) (Selenium::WebDriver::Error::InvalidCookieDomainError)
      features/popups_core.feature:5:in `And I am logged in'

I'll dig in more when I have a moment, but I'm going to sign off on this.

@Jhernandez: Are you using phantomjs? Try running them with env BROWSER=chrome (chromedriver) or firefox. I tend to use chromedriver as that's what we use in the build environment.