Commit graph

90 commits

Author SHA1 Message Date
Zfilipin
b6c4f60b0a Revert "Selenium: configuration file for beta cluster"
This reverts commit 3d2395a2af.

Change-Id: I4ad8958df097a1ef011c0f9d99ea9f7a0030c032
2018-03-20 11:12:27 +00:00
Željko Filipin
3d2395a2af Selenium: configuration file for beta cluster
Bug: T185011
Change-Id: Icf8588f0e82acf09e6654dd5dbf33479e4ecbbb7
2018-03-16 18:30:38 +01:00
Željko Filipin
30ebe529c0 Update README file for Selenium tests
Bug: T187862
Change-Id: Iadd41307a48a1b50f64a495e7efcee3b88d0ff68
2018-02-21 12:28:49 +01:00
Jdlrobson
33ba3cfebb Revert "selenium: add new message banner test to user spec"
This reverts commit 6ca3e221d1.
This is breaking CI for the Minerva skin and Echo as Echo changes how
this interaction works. When the browser test tries to locate the
div.usermessage it has moved so fails.

This test needs to be rewritten to take this into account.

On a side note, given usermessage is generated by all skins (and not
in core) there is a big argument to be made that this shouldn't be in
core but in the individual skins. MinervaNeue the mobile skin notably
does not use this class so this test would always fail on a mediawiki
instance which only uses the Minerva skin.

Bug: T185928
Change-Id: I43b6cf328aaf4a4fded0bb9746716c4cc9d8f364
2018-01-29 20:41:21 +00:00
addshore
6ca3e221d1 selenium: add new message banner test to user spec
Change-Id: I92dc612d215d1d3eb8dff02c2ff4d57da0105d69
2018-01-24 14:06:01 -08:00
addshore
817baf7e91 selenium: add re-creatable page test to page spec
Change-Id: I61c452246c29bd22000a06844901dfe8ca06fadd
2018-01-20 10:47:59 +00:00
addshore
9c7d876341 selenium, add restoration test to page spec
Change-Id: Ied06915f982e693b00edab14b8c29c978a5d6dff
2018-01-20 10:45:16 +00:00
addshore
52c7dc56df selenium: add deletion test to page spec
Change-Id: Ia17b52958778a09378eeb10c9f24ebe9229bd9f5
2018-01-20 10:41:41 +00:00
Željko Filipin
6e1b37c966 Page title is not used in Selenium tests
Bug: T182421
Change-Id: I0de9bf27f1227e7b29c5aaa28451823e80fa8ff1
2018-01-17 13:15:56 +01:00
Željko Filipin
ee6a408527 When running Selenium tests, use wd/hub
It works both on Mac and Windows. I am assuming it works on Linux too.

Bug: T182421
Change-Id: I85a9e7dbd9a66418c85585969adb5ac1548f5ef6
2018-01-16 18:40:33 +01:00
addshore
877c2e0a58 selenium, update page spec to include more chars
Bug: T184749
Change-Id: I3423011c467b0a6426cfa0dad522435618f24bd0
2018-01-15 10:36:34 +00:00
addshore
cff382d605 Selenium README note about --url-base on Windows
For me /wd/hub doesnt work and wd/hub must be used

Change-Id: Ic61d516b53c95b0d1351bcda7308870f5fc5171c
2018-01-15 10:03:00 +00:00
Željko Filipin
9cda6fa7a2 Remove ESLint inline comments in WebdriverIO configuration files
Comments are not needed. ESLint has configuration file(s).

Bug: T175179
Change-Id: Ieafd7b5666faaccb73b8ef7daa7aef3ed4114662
2017-12-21 16:38:42 +00:00
Bartosz Dziewoński
808e45d13d Revert "Special:Preferences: Use OOjs UI" and follow-ups
The number of issues with the new interface is unacceptable and we
will not be able to fix them reasonably quickly. See subtasks of
T180538 for the list of issues, raised both by the Wikimedia community
and by WMF employees.

I should have pushed back harder against the merging of this half-baked
change with the promise that we'll fix it later. I convinced myself
that the regressions were not so noticeable and that the issues that
were pointed out will in fact be fixed by someone. Predictably,
however, regressions were bad and the only person fixing the issues
was me.

I am not going to work nights to make this page decent again within a
reasonable timeframe; I'm not sure if I'd even be able to since many
issues are problems with the design rather than the implementation. No
one else seems to be working on improving it, therefore I am reverting
the change.

On the bright side, this work has resulted in a number of improvements
to HTMLForm and Preferences code, which are not being reverted here:
<https://gerrit.wikimedia.org/r/#/q/topic:T117781>.

If anyone reattempts this, I recommend gating the new interface behind
a configuration variable and URL parameter, like we did with
$wgOOUIEditPage in the past, and testing thoroughly in production
before enabling it for everyone.

* Revert "Special:Preferences: Use OOjs UI"
  This reverts commit 486e566cfe.
* Revert "Preferences: Show preview of edit fonts in edit font selector"
  This reverts commit 6634ff729d.
* Revert "Follow-Up Iae63b6994: Add missing editfont dependency"
  This reverts commit ce42fdf151.
* Revert "Preferences: Improve visual appearance by “unboxing” sections"
  This reverts commit c9415bb005.
* Revert "Remove box-shadow from preference panels for ooui-apex"
  This reverts commit a934b82ca2.
* Revert "Preferences: Don't show the watchlist token; just link to ResetTokens"
  This reverts commit e8c9102fc7.
* Revert "mw.special.preferences: Make the "Basic information" section more compact"
  This reverts commit d48b7260f3.
* Revert "mw.special.preferences: Widen the dropdown of the "Time zone" field"
  This reverts commit afd5f1417e.

Bug: T117781
Bug: T180538
Change-Id: I44b5daea1828f71881b5bd35218f5ecb7ab7f36e
2017-12-02 22:32:08 +01:00
jenkins-bot
240ca26324 Merge "Document how to run just one Selenium test" 2017-11-28 13:54:00 +00:00
Željko Filipin
6586f5f294 Document how to run just one Selenium test
Bug: T139740
Change-Id: Ieb5f27285046c33d77b615159dc2000d80ef644a
2017-11-28 14:26:42 +01:00
Željko Filipin
85f88747f2 ESLint ecmaVersion setting is not needed if env is es6
From ESLint documentation:

"Specifying Environments:
es6 - enable all ECMAScript 6 features except for modules
(this automatically sets the ecmaVersion parser option to 6)."

https://eslint.org/docs/user-guide/configuring#specifying-environments

Bug: T139740
Change-Id: Ie675a8a75c09857003d100d7ff92922deebe753e
2017-11-15 14:27:13 +01:00
Bartosz Dziewoński
486e566cfe Special:Preferences: Use OOjs UI
* Change the form to OOUI mode. Tweak some formatting to look better
  with this mode. Change various random links to be OOUI buttons.
* Rewrite custom tabs to use OO.ui.IndexLayout instead.
* Update styles and JS enhancements for OOUI widgets.
* Rename ResourceLoader modules so that old skin-specific styles
  (from $wgResourceModuleSkinStyles) no longer apply. They tend
  to make no sense with the OOUI styling.

Bug: T117781
Change-Id: Ie9396f0146f5020e52710c41e55ec86151ae0095
2017-11-13 20:51:09 +01:00
Željko Filipin
d1439a3e67 Selenium tests should log in before creating pages
MediaWiki Vagrant by default allows creating pages to anonymous users,
but other environments, like Beta Cluster, require user to log in
before creating pages.

Bug: T176315
Change-Id: I34eeaf3cc22a64be6580aa483b28885137ba60b6
2017-10-03 11:46:01 +02:00
Željko Filipin
9ce486e380 Run Selenium tests for skins
So far, only extension had Selenium tests, but now MinervaNeue skin also has them.

Bug: T174018
Change-Id: I6bac14f44e677cb0b1fdefc6474d08fb17a0b911
2017-08-25 16:51:05 +02:00
Ed Sanders
2c03d167fa build: Upgrade grunt-eslint from 19.0.0 to 20.0.0
Most indent and escaping fixes.

Change-Id: I210e2fc3c0ce3148327ef81f824e1ce9f1e269b6
2017-07-18 16:57:03 +01:00
Željko Filipin
fedebb1834 Disable VisualEditor welcome dialog when running Selenium tests
Bug: T164721
Change-Id: I7b5f73c6fbaaa221ac1b689344f9015fb903220f
2017-07-07 11:54:46 +02:00
Željko Filipin
853cba1deb Create users and pages for Selenium tests using action API
This will make tests slightly more robust.

Bug: T164721
Bug: T167502
Change-Id: I9b2fea77b28af4f7f521490a0105e7d04730bc87
2017-07-07 04:59:14 +00:00
Željko Filipin
4de830add6 Take screenshot if a Selenium test fails
Bug: T164721
Change-Id: I932fccb3fe523b526146df66950ee764bd33bac7
2017-07-06 10:54:21 +02:00
Željko Filipin
86b867f794 Make running Selenium tests using Sauce Labs easy
If SAUCE_USERNAME and SAUCE_ACCESS_KEY environment variables are not
defined, tests are run with `npm run selenium`, as usual.

https://www.mediawiki.org/wiki/Selenium/Node.js/Inside_MediaWiki-Vagrant
https://www.mediawiki.org/wiki/Selenium/Node.js/Target_MediaWiki-Vagrant

If the environment variables are defined, to run tests using Sauce Labs
and targeting Beta Cluster, run this:

```
export SAUCE_USERNAME=***
export SAUCE_ACCESS_KEY=***
export MW_SERVER=https://en.wikipedia.beta.wmflabs.org
./node_modules/.bin/wdio tests/selenium/wdio.conf.js
```

https://www.mediawiki.org/wiki/Selenium/Node.js/Target_beta_cluster_using_Sauce_Labs

Bug: T139740
Change-Id: I622d9c55ae595ab772e733388d209623e3a9f81e
2017-05-25 15:57:04 +00:00
Ed Sanders
ee3d5a014f build: Update eslint to 0.4.0 and make pass
Change-Id: Ib230392f332268ac801cf668f399fcefb1cb1cc5
2017-05-04 22:38:03 +00:00
Fomafix
7a3418ae33 Use consistent spaces at start and end of comments
Change-Id: Idbb09b69aa1ef4e46433319aaea62f34f0dbc038
2017-03-30 22:06:40 +02:00
Željko Filipin
7aee98758a Selenium tests in Node.js using WebdriverIO
Introduce the WebdriverIO browser testing framework driven by Node.js.
The overall intents are:
* have MediaWiki core to provide a platform to run tests that is shared
  between core and the extensions.
* phase out ruby driven browser tests eventually.

Code is namespaced in sub directory /tests/selenium
The 'pages' sub directory provides helper representing a MediaWiki page
such as Special:Login and human friendly helpers to interact with the
elements.

Add Grunt task webdriver:test.

Provide a npm script to easily spawn/dispose chromedriver and run above
grunt task.

wdio.conf.js provides all the configuration. It defaults to point to a
MediaWiki-Vagrant installation on http://127.0.0.1:8080. Can be
overriden with environment settings as needed.

glob patterns (specs) are made absolute paths from MediaWiki root path
that let us run the tests either from the root path (eg the npm
wrapper or from the tests/selenium directory when invoking wdio
directly. wdio assumes they are relative to the current working
directory, hence the normalization.

wdio.conf.jenkins.js extends the configuration and is used solely for
Jenkins.  The switch is done from the Gruntfile.js whenever JENKINS_HOME
is set.  Specially we want junit reports to be generated.

Provide a more specific eslint configuration.

References:

* MALU https://phabricator.wikimedia.org/source/malu/
* T151442 Research WebdriverIO
* T151443 Research Nightwatch.js

Bug: T139740
Signed-off-by: Antoine Musso <hashar@free.fr>
Change-Id: Ibe7a004a120e82af637ab3e31b725de743134c99
2017-03-14 12:20:32 +01:00
Chad Horohoe
0ca1132ea9 Remove Selenium tests from core
This never really worked properly, doesn't conform to coding
conventions, and isn't actually used by anyone for testing.

Our selenium stuff these days are in the qa/browsertests repo

Change-Id: I8f1efaa118fe41821fb3f4a6099d75a33681f17b
2013-06-14 16:20:09 -04:00
Alex Monk
a1f1ccee35 Gitweb -> Gitblit
Change-Id: I54387a6ca5ed020e66594d4bf410a042d4ae010f
2013-06-07 23:05:13 +01:00
Timo Tijhof
beb1c4a0ec phpcs: More require/include is not a function
Follows-up I1343872de7, Ia533aedf63 and I2df2f80b81.

Also updated usage in text in documentation and the
installer LocalSettingsGenerator.

Most of them were handled by this regex:
- find: (require|include|require_once|include_once)\s*\(\s*(.+?)\s*\)\s*;$
- replace: $1 $2;

Change-Id: I6b38aad9a5149c9c43ce18bd8edbab14b8ce43fa
2013-05-21 23:26:28 +02:00
Timo Tijhof
b7bec085ce Drop redundant attributes in hardcoded html
Follows-up 97caae596d which makes HTML5 the default
and removes support for XHTML 1.0 and HTML < 5.

* <script type>
* <style type>
* <html xmlns>
* Quick-closing slash in non-XML HTML5 documents

Change-Id: I71855fa8d4095a5a448ebdc3dc36506ddab6f70c
2013-05-21 01:05:12 +02:00
umherirrender
21751b9ba7 echo is not a function
Removed parenthesis after echo

Change-Id: Ia533aedf63b11d15dcc6a5cf75a56134a4b11d86
2013-05-09 19:52:45 +00:00
Timo Tijhof
50e7985d4d phpcs: Fix WhiteSpace.LanguageConstructSpacing warnings
Squiz.WhiteSpace.LanguageConstructSpacing:
   Language constructs must be followed by a single space;
   expected "require_once expression" but found
   "require_once(expression)"

It is a keyword (e.g. like `new`, `return` and `print`). As
such the parentheses don't make sense.

Per our code conventions, we use a space after keywords like
these. We appeared to have an unwritten exception for `require`
that doesn't make sense. About 60% of require/include usage
was missing the space and/or had superfluous parentheses.

It is as silly as print("foo") or return("foo"), it works
because keywords have no significance for whitespace between
it and the expression that follows, and since experessions can
be wrapped in parentheses for clarity (e.g. when doing string
concatenation or mathematical operations) the parenthesis
before and after basiclaly just ignored.

Change-Id: I2df2f80b8123714bea7e0771bf94b51ad5bb4b87
2013-05-09 05:56:26 +02:00
Siebrand Mazeland
483e29277f Remove unused local variables in tests
Change-Id: I71318eb7d8c00bfc1ce6d2fc636b498f7a695f42
2013-04-26 09:48:46 +02:00
Alexandre Emsenhuber
3d9baf3d33 Normalise documentation in tests/selenium
- Remove useless @addtogroup, all files already have @ingroup
- Make comments position and whitespaces consistent

Change-Id: Id8f68d53e00e7ed32a5da8681c0263a683eef724
2013-03-04 08:35:44 +01:00
jenkins-bot
019ede8717 Merge "Script calling cleanups" 2013-02-26 18:56:35 +00:00
jenkins-bot
4c57ea20f9 Merge "Concatenate two literals" 2013-02-26 01:50:44 +00:00
Platonides
d01be611d0 Script calling cleanups
· Use env(1) in shebangs instead of hardcoding paths.
· $IP is already set in the constructor of Maintenance classes.
· Add sapi guard to some phpunit files.

Change-Id: I6c6fd6c61e2861b5992f2ccd67a4e3f62e2c445e
2013-02-25 23:11:51 +01:00
Platonides
5377e1c9bf Concatenate two literals
Convert «'/' . 'MediaWikiInstallationCommonFunction.php'» into
«'/MediaWikiInstallationCommonFunction.php'»

Makes find-entries.php life easier.

Change-Id: I2952a14daa651099ff1d0b15a166880b710cad34
2013-02-21 00:14:17 +01:00
Platonides
18ac26561c PHPUnit/Framework.php was removed in 2010
Removed in 9e3aec (phpunit 3.5.1):
 9e3aec43cf

Deprecated since fb48a69 (phpunit 3.4.8):
 fb48a69ea6

Its usage was replaced with the autoloader.

Change-Id: Ib76ed6e9ec83e9e33c76ef423bb0caa0c37067e8
2013-02-20 23:35:19 +01:00
jenkins-bot
1a6a9dd4b1 Merge "phpcs: Normalize methods declarations to "[final abstract] [visibility]"." 2013-02-19 17:16:16 +00:00
Antoine Musso
6c35b02aa7 phpcs: Normalize methods declarations to "[final abstract] [visibility]".
CodeSniffer sniff is:
  [abstract final] [<visibility>] [static] function
As declared by:
  PSR2.Methods.MethodDeclaration.StaticBeforeVisibility
in:
  https://github.com/wikimedia/mediawiki-tools-codesniffer/blob/master/MediaWiki/ruleset.xml


Change-Id: Ifabd289e8668019ed752bdd711b3b43a9c346336
2013-02-19 16:56:35 +00:00
jenkins-bot
b42e252fd0 Merge "(bug 44385) move jquery.collapsibleTabs module to Vector extension" 2013-02-15 18:55:33 +00:00
MatmaRex
2b39348e2c (bug 44385) move jquery.collapsibleTabs module to Vector extension
It was entirely Vector-extension-specific (so very unlikely to have
been used by anything external), deeply interconnected with the
extension (its internal functions were overwritten by a script from
it, making it even more incompatible with other uses), and this
functionality (being really a partial workaround for low-res issues
with the skin) belongs to the extension instead of the skin anyway.

Corresponding Vector extension change: Ic6b622279

Change-Id: I7c0f42d922b20741f66014eea0a7593bc1950e0e
2013-02-15 19:48:37 +01:00
Siebrand Mazeland
69d4d69096 Update formatting
11 of n.

Change-Id: Ifdaf198b16bf72e1e0a3d3802c041d239096ae28
2013-02-15 13:41:06 +00:00
Siebrand Mazeland
63fffc4fcb Update formatting
10 of n.

Change-Id: I9c17088ac063c14544484176daa00272dcd607b8
2013-02-15 13:29:37 +00:00
Siebrand Mazeland
454d92fb7c Update formatting
8 of n.

Change-Id: I55551510e7afde5b6b981697d5c0efd7b9507585
2013-02-15 13:08:55 +00:00
Hoo man
8ffbb077b3 Use __DIR__ instead of dirname( __FILE__ )
Removed left over uses of dirname( __FILE__ ) to __DIR__, even in comments.
Running the PHP version test in maintenance/Maintenance.php earlier, so that
we no longer have to stay PHP < 5.3 compatible in there.

Change-Id: I5a00bd5c6af44b7f826c4e5576a7b3de7b5026d8
2012-08-27 23:58:28 +02:00
jeroendedauw
38c7f444e1 Use __DIR__ instead of dirname( __FILE__ )
We can now do this since we finally switched to PHP 5.3 for MW 1.20 and get rid of the silly dirname(__FILE__) stuff :)

Change-Id: Id9b2c9cd2e678197aa81c78adced5d1d31ff57b1
2012-08-27 21:45:00 +02:00