Commit graph

460 commits

Author SHA1 Message Date
Timo Tijhof 7ae8401c22 Avoid use of deprecated QUnit.asyncTest and QUnit.start/stop
Change-Id: I9cc132f71df072c724b6cff6f1d935abbe092596
2017-07-25 17:59:27 -07:00
Timo Tijhof 5bf1466e7f Remove use of QUnit.test(, testCount, )
* Removed deprecated testCount, which is no longer supported in this way.
  It's only useful when wanting to explicitly expect 0 assertions (normally
  considered an error).
* Replaced use of testCount = 0, with assert.expect( 0 ).

Change-Id: I8fe82032d3af2a1ad2ed7febdb90a95d56dd3fc4
2017-07-26 00:12:06 +00:00
jenkins-bot 17485a4989 Merge "Replace all direct localStorage interaction by mw.storage" 2017-07-05 14:11:00 +00:00
Matthias Mullie 31c93b79fa Fix buttons fadeOut when coming back from fullscreen
Bug: T164410
Change-Id: I4275c15733b10cff68a20b19e5fb195a88fafebf
2017-06-07 17:09:01 +02:00
Matthias Mullie 3e5ad4c83a Replace all direct localStorage interaction by mw.storage
Meanwhile I also updated a few places where a non-string was
passed to/expected from localStorage - this could’ve led to
inconsistencies because localStorage stringifies everything.

And I also removed CP.canSetMediaViewerEnabledOnClick, which
was no longer used anywhere except for a test case.

Bug: T137777
Change-Id: I21ad4ba15ca751bb03e5e2c523d09a45c0444ccf
2017-06-02 11:52:34 +02:00
Ed Sanders 2264e5fdec build: Update eslint to 0.4.0 and make a pass
Change-Id: I444cfd511121a0547901ed87c9aedd410e7920bd
2017-05-17 11:30:45 +01:00
Ed Sanders 9514e3107a Code lint: Throw errors, no strings
Change-Id: I4bb4de96a5e61b67b7a4c8f16a22f67f53cb034f
2017-05-17 11:28:53 +01:00
Matthias Mullie 19fdcc86f3 Fix mmv.model.TaskQueue qunit tests
Bug: T164473
Change-Id: Iaefae1d00a0469f11ddb3fcecb4f831346ac0eec
2017-05-17 11:53:34 +02:00
Matthias Mullie 4c3302d957 Fix mmv.lightboxInterface qunit tests
Bug: T164473
Change-Id: I5d2ddba1e1a5cb69de276d790841536fde77d108
2017-05-16 14:55:17 +00:00
Matthias Mullie 65c00b388c Fix mmv.logging.DurationLogger qunit tests
Bug: T164473
Change-Id: I9787948e26d27e8fcee934e05e2c200eeec5d82f
2017-05-16 14:55:05 +00:00
Matthias Mullie 5bc3a2d90e Fix mmv.logging.PerformanceLogger qunit tests
Bug: T164473
Change-Id: I6ae5c0170bf12fb076ddc505299ceeb7b9c292e8
2017-05-16 16:54:43 +02:00
Matthias Mullie 651476ccfb Fix mmv.logging.ActionLogger qunit tests
Bug: T164473
Change-Id: I41f207519e27f63338298f68411fc2eb3eb7f13a
2017-05-16 16:53:39 +02:00
Matthias Mullie 934ed2d2dd Fix mmv.logging.ViewLogger qunit tests
Bug: T164473
Change-Id: I11849743773e0382354009ccec1c8cb39c466aef
2017-05-16 14:52:49 +00:00
Matthias Mullie 47d67a6e66 Fix mmv.model.TaskQueue qunit tests
Bug: T164473
Change-Id: I849a81c02886c8f80f7bedef40f7a4504d3632f7
2017-05-16 14:52:38 +00:00
Matthias Mullie d96a587a38 Fix mmw.ui.metadataPanel qunit tests
Bug: T164473
Change-Id: Iefad324be86c59ac9bf44363bcbbb98a70769499
2017-05-16 14:52:25 +00:00
Matthias Mullie 93f1c9f79e Fix mmv qunit tests
This heavily relied on deferreds getting resolved synchroneously,
which (for .then) is no longer the case with jQuery 3.
There's also a difference in how chained .then's get resolved,
and $.when no longer propagates notify().

The changes in here are basically:
* fix use of $.when, manually passing along notify()
* use .then in some places, instead of .done, .fail, .progress
* fix progress bar hiding in setupProgressBar, which assumed sync
* fixed tests, mostly by using fake timers to give async stuff a
  chance to execute

Bug: T164473
Change-Id: Ib51ddd8bc6254a477861588fb16f57565353afe1
2017-05-16 16:51:52 +02:00
Matthias Mullie d204ecc99a Fix mmv.bootstrap qunit tests
This heavily relied on deferreds getting resolved synchroneously,
which (for .then) is no longer the case with jQuery 3.
There's also a difference in how chained .then's get resolved.

These tests did not wait for the deferreds to get resolved async,
so that had to change. Worse even: some functionality was tested
by assuming a handler would not be called (= the test in that
handler would not be called), which didn't make the test run,
because we never even waited for it to be called.

The changes in here are basically:
* make mmv.bootstrap.js correctly use .then instead of .done & fail
* let mmw.bootstrap.test.js tests wait for unresolved async promises
* check call counts instead of running tests inside of callbacks
* limit use of fake timer to the 1 test that needs it (it interferes
  with async, which otherwise don't get resolved)

Bug: T164473
Change-Id: I3ca4f786890ad1646f71fe336afdb61e5c3b01c7
2017-05-16 16:48:20 +02:00
Prateek Saxena 45110a7090 Use <button> instead of <div>
* Buttons are semantically better.
* Neither <div> nor <button> elements can have the 'alt' attribute
  so switching to 'title' instead.

Reverts parts of I6ea62124018b1a0ec5110bb500f690cb2368f102.

Bug: T58471
Change-Id: I991b40d3387f8d6dd7cdad8ccc5cc9660b9f139a
2017-03-22 12:06:15 +05:30
Ed Sanders d7ea64137c build: Replace jshint/jscs with eslint
Change-Id: I423add157245353031e36b7e44fee7ace7c753c7
2017-01-10 10:24:39 -08:00
Fomafix 660503b7a7 Change mw.Map( false ) to mw.Map()
The parameter [global=false] is the default.

Change-Id: I61df2b95308c2fa21d5ed28c2ef1d8ddefdf69e8
2016-11-19 11:10:58 +01:00
Gergő Tisza 789ccdeae6 Fix broken tests
The signature of mw.Map was changed in I7ff0b230.

Bug: T150575
Bug: T146432
Change-Id: I464162549ef9b1decafc42f483c35a2c8e930a3b
2016-11-19 03:00:31 +00:00
Andrew H 0c3b0a5056 Shorten clickable link text in HTML credit lines
Previously, the clickable text in the generated HTML credit lines
was the entire link to the article. This is shortened to a localized
version of "Link".

Bug: T119686
Change-Id: I708f65a85bfa26c264cdd06a265096027266240c
2016-09-26 17:07:09 -07:00
jenkins-bot eba412d432 Merge "Update beta test URL to use HTTPS" 2016-08-18 00:25:59 +00:00
jenkins-bot 0716876c6d Merge "Make embed text short URL into a link in HTML mode" 2016-08-11 19:19:19 +00:00
Gergő Tisza e223deb583 Update beta test URL to use HTTPS
Maybe related to T142423. Maybe not, but no harm in it in any case.

Change-Id: I121fedbcc2c7546e1be138f4d966003d975834bb
2016-08-08 12:01:37 -07:00
Timo Tijhof 65bd9ff4a0 Update unit tests to use non-bits favicon urls
Bug: T107430
Change-Id: Ie2001d12202353e6e9e76ddd7ab697ec801f6005
2016-08-03 14:51:56 -07:00
Gergő Tisza 8b8dfe4633 Make embed text short URL into a link in HTML mode
Bug: T138142
Change-Id: Ide6d9b164cdcbafacf08631536cadb04a45ce3dd
2016-08-01 15:17:25 -07:00
jenkins-bot b5f0de95b7 Merge "build: Introduce jshint & jscs and make a pass" 2016-07-19 21:02:24 +00:00
Ed Sanders b46529d1b2 build: Introduce jshint & jscs and make a pass
These replace the hard-coded jshint task in CI.

Change-Id: Id14eec1ecba4ceae735ffd10f9114233a580302f
2016-07-19 13:48:06 -07:00
jenkins-bot d8984a6ab8 Merge "Limit image search to content firing event" 2016-07-19 14:44:39 +00:00
Ed Sanders db6c74a232 Limit image search to content firing event
Bug: T140574
Change-Id: I3c504c09b2b382e094ab2be1fa388efa7ec827b1
2016-07-19 11:33:53 +01:00
Ed Sanders c029295c41 Use simple English in test descriptions (legit->valid)
Change-Id: I01142b85abd4fb2bb16213d753c4b513327bb9bb
2016-07-18 11:39:29 +01:00
Gergő Tisza dba273ac31 Add HtmlUtils.makeLinkText utility function
Change-Id: I2697c2d865dc8dd23883a59ca0c38229c2e7b6e9
2016-06-19 17:22:52 +02:00
Željko Filipin 54aa54c15c Disable Cucumber feature that is broken in daily Jenkins jobs
Performance feature failed 8 times in a row for Chrome.

Bug: T94150
Change-Id: If459929a717a1e6d0da59a333a80ffc41592d282
2016-05-16 18:23:51 +02:00
jenkins-bot a0e97aab78 Merge "Make Media Viewer pluggable for the 3D extension" 2016-05-09 20:14:35 +00:00
Željko Filipin 2eedcb4240 Do not run unstable tests daily
Bug: T128190
Change-Id: Ifc8b03b96b68c81183067cab2bedc56b599dfdf4
2016-05-05 12:50:45 +02:00
Željko Filipin afe0397991 Migration of browsertests* Jenkins jobs to selenium* jobs
selenium* jobs are a new way of running Ruby based Selenium tests. The
jobs are triggered daily.

Bug: T128190
Change-Id: If0e6b61c9e3d52005d1851ca49ef65babd002919
2016-04-25 19:15:12 +02:00
Gilles Dubuc 53a3d9a379 Make Media Viewer pluggable for the 3D extension
Some of the code encountered accessed mw.config directly,
I cleaned that up by migrating to mmv.Config, which is an
abstraction added to avoid peeking at mw.config directly.

Bug: T132064
Change-Id: I2a95ba703e6c7f46296f8e435bceec769dceebf9
2016-04-15 16:43:45 +02:00
Antoine Musso 61fdd5e528 Browser test: update mw.org tag to use canonical URL
The browser test job uses 'www.mediawiki.org' to hit the API which is
then passed to cucumber for tag filter.

Update the scenario tag to match the canonical URL.

Bug: T128079
Change-Id: I68217b3e9867b768ccbba24bbffaa431c1c3035f
2016-03-10 10:18:13 +01:00
Željko Filipin 20e7873250 Fix browsertests-MultimediaViewer-mediawiki.org-linux-firefox-sauce Jenkins job
The job was failing with `301 Moved Permanently`. The problem was that
`mediawiki_url` was not `https` and was missing `www`.

Bug: T128079
Change-Id: I4f142c4ed17826b1e4051846395940e139e47689
2016-03-07 15:14:52 +00:00
Željko Filipin aa0a725a0e Do not run browser tests that fail with Internet Explorer 8 daily
Bug: T128072
Change-Id: If3cc10004c9d3a9f93307dffb41e82f33853b5fd
2016-02-25 14:44:41 +01:00
Željko Filipin 13adb73273 Set a user-agent in browser tests
We used to rely on the env variable BROWSER_USERAGENT for tests
requiring a customer user agent. 2c3ac55a6 got rid of it in favor of
loading the :browser_useragent from environments.yml where it has not
been set. That in turns caused tests to fail with:

    "missing configuration for browser_useragent"

Set browser_useragent to 'test-user-agent' in the environments.yml

Also drop unused test2 env and add mediawiki-org

Bug: T128064
Change-Id: I720d590505dd5e30c6e9435de456563b8d36f9ea
2016-02-25 13:25:03 +01:00
Željko Filipin 66b0020525 Fix "undefined method test_name" error message in Selenium tests
`test_name` method was removed in mediawiki_selenium 1.6.0.

Bug: T125072
Change-Id: Iac7725b601e099a3567d4e3f4a8743babdadfee5
2016-02-24 15:53:22 +01:00
jdlrobson 5736f8e0a9 Add integration tests to each commit
Additional changes:
* Add a step to check JS has loaded
* Update selector to work on non-vagrant instances

Bug: T113620
Change-Id: Ib7579a43adc37b6e4add8b0ab75f99b6ab994bb6
2016-01-27 10:12:19 -08:00
Andrew H 1b2866df0d Shorten MediaViewer credit lines
Drop the title and site name. Use a shortened URL
created using the pageID for the curid query parameter.

Add pageID property to mmv.model.Image, using value already
fetched from an existing API request.

Bug: T119686
Depends-On: I0f00b986e6095bdb9b8d6af6fbc5b01995227e02
Change-Id: I9189f00bfbf7639974d66cf1921773855a77a865
2016-01-10 23:44:23 +00:00
Julius Alphonso a9758d21e0 Remove uploader's name from MediaViewer
Only last uploader's name is shows, this turns out to be
more confusing than useful.

Bug: T59308
Change-Id: I7d06b72c581fe8738bffc64b5e36be9983b01ccf
2015-12-29 10:56:08 +05:30
Željko Filipin c8237daa5b Fixed Style/StringLiterals RuboCop offense
See:
https://github.com/bbatsov/ruby-style-guide#consistent-string-literals
Bug: T117984

Change-Id: I5388aa3f7c47b9667a03d905f6562dfe6939a70e
2015-12-09 17:21:54 +01:00
Željko Filipin 810506a063 Fixed Style/VariableName RuboCop offense
See:
https://github.com/bbatsov/ruby-style-guide#snake-case-symbols-methods-v
ars
Bug: T117984

Change-Id: I51b5ee142bc845b799b53e356a604aefb13d7f7d
2015-12-09 17:17:24 +01:00
Željko Filipin fba53b776c Fixed Style/TrailingBlankLines RuboCop offense
Change-Id: I7cbfd6d148982039c720fc4fb72e410372a0cbde
See: https://github.com/bbatsov/ruby-style-guide#newline-eof
Bug: T117984
2015-12-09 17:09:10 +01:00
Željko Filipin 346275f751 Fixed Style/Semicolon RuboCop offense
Change-Id: Ib01751f81e921beb3c7e157f9e8037859eb1b3f6
See: https://github.com/bbatsov/ruby-style-guide#no-semicolon
Bug: T117984
2015-12-09 17:08:01 +01:00