Commit graph

42 commits

Author SHA1 Message Date
Gilles Dubuc 40c7284911 Make media viewer use the same prefix as mobile
Keep responding to the legacy prefix, since many links on the web
are referencing it.

Bug: T87769
Change-Id: I0936ada35141ddd85e0aa232b833d315e3246ce3
2015-02-25 21:22:05 +01:00
Gilles Dubuc 94ac32835d Click in the top-left corner of the image when trying to close the download dialog
This should fix the failures happening in IE.

Bug: T89087
Change-Id: Ia0128a9c85891e8f2d89098c898d5927f01fbedd
2015-02-13 12:21:56 +01:00
Gilles Dubuc 8c37b7abb4 Wait for the download menu to appear before closing it
In practice doing this quickly still works, but the browser test in IE
catches the menu at exactly the wrong time (when it appears briefly
before disappearing).

Bug: T89087
Change-Id: I4076943bf33a566ec882f69d17f6a3a9f1a28002
2015-02-11 20:28:13 +01:00
Gilles Dubuc e3b222ffa2 Attempt to improve reliability of cucumber tests
Bug: T87831
Change-Id: I4c1049037f788630c84d4780309d683682fe756f
2015-01-28 16:46:27 -08:00
Cmcmahon c3a7bb5782 QA: back button workaround for Safari
Bug T85802

Change-Id: I4a3b360ffddbab5c22ca1eb3b03c45159425de70
2015-01-05 09:43:23 -07:00
Cmcmahon 711e2837fc QA: update navigation test for rspec
This should be pretty straightforward

* use RSpec3 expect() syntax
* prefer string to regex as argument to match() when appropriate
* use Selenium $browser.back instead of inline javascript

Change-Id: I2e214752224397859a00f11bf9acc5bdc7685464
2014-12-17 15:02:38 -07:00
Cmcmahon 32cd6c7892 QA: WIP update tests for RSpec3 syntax etc.
Add back a sleep to make the test pass

* make a Then statement with no assertion into a When
* remove Then statements assertions from Given steps
* prefer single quotes per rubocop
* use strings instead of regexes where appropriate for match operator
* use appropriate wait_until syntax
* remove redundant steps that call a single other step
* sort invisible selection criteria from steps to Feature input
* add when_present polling because test is now much faster

Change-Id: I24435362836945833942e87d7caee49c9b34368d
2014-12-15 16:42:34 -07:00
Cmcmahon 021391f0e8 QA: wait for element to appear
prevent false failures like
https://integration.wikimedia.org/ci/view/BrowserTests/view/-All/job/browsertests-MultimediaViewer-en.wikipedia.beta.wmflabs.org-linux-firefox-sauce/lastCompletedBuild/testReport/(root)/Download%20menu/The_medium_download_option_has_the_correct_information/

Change-Id: I122a82a5ec802c0c0eec90b55757153a2ab58ef7
2014-11-20 13:03:37 -07:00
Trevor Parscal a8838e4bae Update OOjs UI Class Names (549ff9ab7d)
Changes were generated by running this script:
https://gist.github.com/trevorparscal/92ccdc4c49ab033d9ba8

File content changes:
Scripts (*.js)
- TextInputMenuWidget → TextInputMenuSelectWidget
- MenuWidget → MenuSelectWidget
- MenuItemWidget → MenuOptionWidget
- MenuSectionItemWidget → MenuSectionOptionWidget
- OutlineWidget → OutlineSelectWidget
- OutlineItemWidget → OutlineOptionWidget
Styles (*.less)
- textInputMenuWidget → textInputMenuSelectWidget
- menuWidget → menuSelectWidget
- menuItemWidget → menuOptionWidget
- menuSectionItemWidget → menuSectionOptionWidget
- outlineWidget → outlineSelectWidget
- outlineItemWidget → outlineOptionWidget

Change-Id: I19ad3990837c0c565773fbb4c3d9d4d18e5f616e
2014-11-20 01:04:32 +00:00
Gergő Tisza 7a791cc4e5 Fix RuboCop warnings about multiline block syntax
Change-Id: I96f3e90c35cbd081367b2b532851b310f9e410e9
2014-11-12 14:17:12 +00:00
Gergő Tisza 3a18515163 Replace filename with caption/description
* when the caption is available, use it as the image title
* otherwise, fall back to description if available
* otherwise, fall back to filename
* if both caption and description are available, show caption as
  title and show description below the fold; otherwise don't show anything
  below the fold.

Change-Id: I9738ca46620d7cf3b30f6e46790a37966d4b9eaf
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/589
2014-11-11 15:33:15 +00:00
Gergő Tisza f792a42f93 Change above-the-fold layout - step 2
* move license and terms link from title area to attribution area
* remove some ineffective styling for elements which have already been removed
  in earlier changes

Change-Id: I5bd41e337a4c8133bfa27e4c4d03162b2d6e35bb
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/833
2014-10-28 21:18:53 +00:00
Mark Holmquist feb8e43571 Add tests for viewing options panel
Change-Id: Ic7a856ac4d94f4a65224f4c6373938da7b05f0fd
2014-10-19 00:35:36 +02:00
Gilles Dubuc c4fd6c3740 E2E tests for download menu
Change-Id: I3435366133a9b5fd6079c3a5bad270ee19da8daf
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/445
2014-10-15 23:07:21 +02:00
Gilles Dubuc abd38f8ae0 Fix repo/details check of E2E test
Change-Id: I116080a4047799cc883faa2b3d91141bedeaff01
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/923
2014-09-30 13:40:34 +02:00
Dan Duvall c5a245309d QA: Refactored performance tests
Fixed up feature indentation and clauses and moved global methods into
the page-object classes.

Added @custom-browser tag to avoid starting multiple browser sessions
and updated mediawiki_selenium dependency for fix to custom browser
instantiation with SauceLabs.

Change-Id: I9741afb8d13ee8729f72210eb7617d9446311a8e
2014-09-23 14:19:16 -07:00
Cmcmahon 15705664dd QA: add tags to run in IE builds
Also add tags to run all tests in beta and test2. Let's see
what happens and remove them later if necessary.

NOTE: one test had no tags and ostensibly should run only on mw.o
We may have to remove them later, but let's see what happens for
now

Change-Id: I9c4adc7803afc975d9643a35631801bbac459eb7
2014-09-12 09:46:44 -07:00
jenkins-bot 32429a7723 Merge "Revert "Change image load check strategy"" 2014-09-12 05:38:44 +00:00
Gergő Tisza ea0689a7e9 Revert "Change image load check strategy"
Experimental revert of commit 
d6c142fd2b to see if it caused
the weirdness in the versus charts:
http://multimedia-metrics.wmflabs.org/dashboards/mmv#media_viewer_vs_file_page-graphs-tab

That commit affecting file page load times is extremely unlikely. 
A change in the test environment which exactly coincided with it is 
equally unlikely. This is an easy way  to tell which is the case.

Change-Id: I3581abd36d25494ca294db892480e25f6f4c5a73
2014-09-11 12:48:38 +00:00
Gilles Dubuc 2ef45b3058 Remove categories
Change-Id: I309b01592e874579d50bf5fc0810c238d47748f5
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/835
2014-09-09 13:23:50 +00:00
Gilles Dubuc caa624d711 Remove file usage
Change-Id: I538f7734e1c06a179ee98a5cd843ccee4d91349f
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/835
2014-09-05 08:14:52 +02:00
Gilles Dubuc d6c142fd2b Change image load check strategy
Using the "complete" property worked for the file page, but not
for media viewer because change the src of an img doesn't reset
the prop.

This introduces a custom event that cucumber can listen to in order
to know when the full resolution image had been loaded in media
viewer.

Change-Id: I40875166e70badbb35106c4a3536c706a7c815b4
2014-08-28 07:33:58 +02:00
Gilles Dubuc eef5fe7897 Add Safari to browser tags
The test passes on Cloudbees, we can now add the tag to make
it official

Change-Id: Id0ada2fbdb7e3fea1429d0cbec52b24e5815c4ac
2014-06-25 21:43:29 +00:00
Gergő Tisza 2616546468 Change "learn more" to "more details about this file"
Several people complained that "Learn more on Wikimedia Commons"
is not clear: it can be interpreted as a link to the Commons
main page, the text does not suggest that the link will be related
to this specific file. The new wording tries to address this.

Change-Id: Ia605cc30c4ca57598f7cebdde60061800a10b6e7
2014-06-18 19:10:11 +00:00
Gilles Dubuc eedc57c1c9 Wait some more for the close button to appear
During the warmup steps Media Viewer might take some time
to open, which might be why the close button won't appear in
less than 5 seconds

Change-Id: I3b17d46c3343f2b1ff33aaaf55faa4adb71cb218
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/618
2014-05-16 11:36:12 +02:00
Gilles Dubuc c6411d3c6a Add 1 pixel of tolerance to the basic test.
This is the first failure that the E2E test is running into when being
run on IE9

Change-Id: I60fe8764196ecc60e2c365576349cf902a069ddb
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/577
2014-05-15 20:41:08 +00:00
Gilles Dubuc e4a9b6c62c User custom user agent to identify production test runs
It's important that when we generate the graphs based on
EventLogging data, we have a foolproof way to filter out
local runs that happened during development.

Change-Id: Ifc65d3b4bfb96946a8e8d59d080a6c5ee6552533
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/509
2014-04-24 16:52:13 +02:00
Gilles Dubuc 353ce92d79 Set correct license link location in E2E test
* Remove login since it's not longer needed
* Point to a new smaller test page instead of Lightbox_demo
 which should make the tests run much faster
* Tweak selenium scroll workaround which seems to be speed-dependant

Change-Id: I247ae6a5044ecc93b6f3839f1b9ed955b488b5a7
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/475
2014-04-24 15:50:06 +02:00
Gilles Dubuc bf213ed978 Test to compare the performance of MMV and the Commons File: page
- Runs combinations of cold/warm browser cache and average/large window size
- Sends events with EventLogging that will allow us to generate limn graphs

This should run separately from the other cucumber test we already
have. This one needs different environment variables  because it needs
to run against production wikis instead of beta wikipedia

Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/378
Change-Id: I53b521ca2759c493aae6fe6e59be8d448e0f15d7
2014-04-17 12:32:15 +02:00
Gilles Dubuc ac9f5d8c96 Add history back button test to E2E
The scrolling logic has broken specifically when navigating with the
back button (as opposed to pressing the "close" button). This change
aims to test that scenario.

Change-Id: Ibe31b319c882b7de2a84ae143652144093c50f1c
2014-04-15 16:25:22 +02:00
Gilles Dubuc fe399fc71c Fix E2E scroll assertion logic
It turns out that cucumber/selenium will automatically scroll
to the element you want it to click on. As a result we have to do
the same in order for the assertion to be correct when coming back to
the article.

Change-Id: I7d3b6609cfe7cdae9c08a6d723d652ad1a6a7055
2014-04-15 16:09:18 +02:00
Gilles Dubuc 09374fc9dd Restore article scroll after closing Media Viewer
There used to be a CSS trick with the order we added things to the
page and removed them from it, but it doesn't seem possible anymore
with the new order of execution, with the overlay appearing
immediately and being taken care of inside bootstrap.

The main cause of the bug, however, was the hash reset happening
after the interface was closed.

Doing the scroll restore with jQuery.scrollTo is more future-proof
and testable in QUnit.

Additions were also made to the cucumber E2E test because QUnit
alone wouldn't have caught the hash issue.

This also cleans up custom events a little and reintroduces
pushState on browsers that support the history API.

Change-Id: I63187383b632a2e8793f05380c18db2713856865
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/439
Bug: 63892
2014-04-14 18:04:30 +00:00
Gergő Tisza 95111d2b73 Use mw-mmv CSS prefix consistently for all things
With apologies to anyone who gets a hundred merge conflicts
because of this :)

We had several different prefix styles (mlb-, mw-mlb-, mw-mmv-,
mw-mmv-mmv-, a few unprefixed), which was getting annoying,
and will be confusing to wiki editors who are trying to figure out
where a given style comes from. Such changes are better done before
going live because it breaks all local CSS tweaks on the wiki,
so I am renaming things now (also removing some stuff which wasnt
used anywhere).

Change-Id: I00447a25f0028e234169c6db941bedc99622eb8d
2014-03-31 21:33:12 +00:00
Gilles Dubuc 773ed3673b Point the navigation E2E test to the right image
Since we shuffled content around on Lightbox_demo,
the test was trying to read the wrong image.

Change-Id: I4ccaa0a1ab354aa4c19bc3870fb54b0ea11ff086
2014-03-11 16:02:18 +01:00
Gilles Dubuc 28b8f5095e Use cross-origin img attribute instead of data URI
After lots of experimenting with Wireshark and
current Chrome + Firefox on Ubuntu 13.10, this is my
current understanding of the caching when preloading images
with AJAX requests:

* on Chrome, the image request always comes from browser cache
* Firefox makes two separate requests by default
* Firefox with img.crossOrigin = 'anonymous' makes two separate
  requests, but the second one is a 304 (does not load the
  image twice)
* when the image has already been cached by the browser (but not in
  this session), Chrome skips both requests; Firefox skips the AJAX
  request, but sends the normal one, and it returns with 304.

"wish I knew this when I started" things:
* the Chrome DevTools has an option to disable cache. When this is
  enabled, requests in the same document context still come from
  cache (so if I load the page, fire an AJAX request, then without
  reloading the page, fire an AJAX request to the same URL, then the
  second request will be cached), but an AJAX request - image request
  pair is an exception from this.
* when using Ctrl-F5 in Firefox, requests on that page will never hit
  the cache (even AJAX request fired after user activity; even if
  two identical requests follow each other). When using clear cache
  + normal reload, this is not the case.
* if the image does not have an Allow-Origin header and is loaded
  with crossOrigin=true, Firefox will refuse to load it. Chrome will
  log an error in the console saying it refused to load it, but will
  actually load it.
* Wireshark rocks.

Pushed some tech debt (browser + domain whitelist) into other tickets:
https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/232
https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/233

Reverted commits:
    8a8d74f01d.
    63021d0b0e.

Change-Id: I84ab2f3ac0a9706926adf7fe8726ecd9e9f843e0
Bug: 61542
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/207
2014-02-24 07:56:40 +00:00
Aaron Arcos 8a1bf00ef0 Remove fire_event("onfocus") from next/previous/exit actions, not needed
As suggested by Chrismcmahon, I confirmed that there is no need
to fire the onfocus event. We also remove the convenient functions
around this logic.

Change-Id: I00ce04c758e496f76bd5c2a43ad933c952acc5fb
2014-02-20 14:00:26 -08:00
Aaron Arcos bd07e7e7a6 Improve e2e tests to check metadata content
The first version of the e2e tests just checked the presence
of some DOM sections. This 2d version actually verifies the
values for most of the components in the viewer.

Change-Id: Iabfd544f05182e86a16cf6bda162bb0abc5cf260
2014-02-19 18:46:28 -08:00
Aaron Arcos 63021d0b0e Fix e2e tests to support data:URIs
We are using data:URIs to measure performace. This
change broke e2e tests that were trying to match plain urls.

Change-Id: I8220801472cde595dd6651ef2796468eba484071
2014-02-19 12:00:47 -08:00
Zeljko Filipin ad9768dfde Moved Ruby code that multiple repositories use to mediawiki_selenium Ruby gem
Bug: 56088
Change-Id: I126fe93ac511570594cfc1ba684b33bd2b356b34
2014-02-11 15:14:30 +01:00
Zeljko Filipin bede2da4a7 Renamed mediawiki-selenium Ruby gem to mediawiki_selenium
Bug: 60820
Change-Id: Ifdb2f788fd8d57599b663960adfa917c026de4fd
2014-02-07 13:35:23 +01:00
Zeljko Filipin f876b87d56 @login tag is required for tests to be able to log in at Jenkins machine
Change-Id: I4302518543a7f7e4bd02132d444f870a1fcea54f
2014-01-22 14:51:17 +01:00
Jeff Hall 47cfaf62bd Initial setup for Multimedia Viewer browser tests and first basic e2e test.
Did some clean-up for Cucumber tags and code conventions.

Change-Id: Ifc954f60a50c41211043493fd64c2dcfa64848ff
Mingle: Multimedia card #100
Bug: 60049
2014-01-18 18:41:26 -08:00