Commit graph

66 commits

Author SHA1 Message Date
Ž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
Reedy
c1ed53da6c Kill off pre php 5.3.2 back compat hacks
Change-Id: I5b806a5d8fd4ec6914e3786a4a9aefba4ad6faa6
2012-05-05 00:23:35 +01:00
Alex Monk
7b7d5d6df7 Renamed 'metawikipedia' interwiki link prefix to 'metawikimedia' - Meta-Wiki deals with more projects than just Wikipedia. See https://www.mediawiki.org/wiki/Wikipmediawiki
Change-Id: I995f0d0e6a3877f605fbabd4a49ec258d9fc08b6
2012-04-02 16:34:37 +01:00
Alex Monk
bc0446e8b5 Fixed some links from SVN to Git.
Change-Id: If425135e3601f11e42c0fc66b1eff7192b2a0704
2012-03-23 22:32:53 +00:00
Sam Reed
6906724935 Add, update, tweak documentation
Fix document comment blocks

Tweak some returns
2011-10-26 03:45:13 +00:00
Sam Reed
90e74042b4 Fix comment blocks that start /* to /** 2011-10-11 18:30:50 +00:00
Sam Reed
eda06e8593 * (bug 31204) Remove old user.user_options
Added run of ConvertUserOptions maintenance script into update.php before dropping the column

Removed usages of user_options in code

Marked User::decodeOptions() deprecated as of 1.19.

Made ConvertUserOptions drop out early if the user_options field doesn't exist

Made ConvertUserOptions update user_options to '' after migration of user options to mOptions
2011-09-28 18:08:48 +00:00
Siebrand Mazeland
75c6696aa8 Use consistent notation for "@todo FIXME". Should update http://svn.wikimedia.org/doc/todo.html nicely. 2011-05-17 22:03:20 +00:00
Sam Reed
ee6b559630 Fix unused variables
Decapitalise False
2011-05-13 16:16:44 +00:00
Markus Glaser
557a85891a Added triggerClientTestResources, which makes the use of separate test resourecs optional. Needed for testing installer functions. 2011-01-27 14:51:58 +00:00
Priyanka Dhanda
8d7c093ca5 New test database resource file with some test configuration changes for it. Follow up to r79421 and r79982 2011-01-11 01:01:54 +00:00
Alexandre Emsenhuber
d7e37fcdab svn:eol-style native 2011-01-04 13:23:18 +00:00
nadeesha
9097509e89 Change the xpath of the 'You can now Folder/index.php start using your wiki' text. 2011-01-03 09:18:21 +00:00
nadeesha
c0d76a084d Changed 'enter your wiki' link, environment ok text and remove 'Subscribe to the release announcements mailing list' check box verification section 2011-01-03 09:07:55 +00:00
nadeesha
00493acd76 Change the xpath of the 'Upgrade complete' text 2011-01-03 09:06:53 +00:00
nadeesha
a9d5f1fcc7 Remove verification for help field hint for 'Subscribe to the release announcements mailing list' as per the code review comment(MediaWiki r79089) 2011-01-03 09:05:58 +00:00
nadeesha
74bf56d58a Remove testOnlyBackButtonAvailability() function as per the code review comment (MediaWiki r78165 ) 2011-01-03 09:05:18 +00:00
Platonides
3662ccd949 I am fed up of selenium constants which aren't properly defined by all files using them.
Making those of SeleniumTestConstants.php into class constants.

for i in $(grep -o 'const [A-Z_]*' SeleniumTestConstants.php | cut -c 7-); do
find -name \*.php -and -not -name SeleniumTestConstants.php -exec sed -i s/$i/SeleniumTestConstants::$i/g \{\} +
done
2011-01-01 20:56:39 +00:00
Markus Glaser
1b7f9fc8b4 SimpleSeleniumTest now has its own resources (database and images dir) 2011-01-01 15:52:52 +00:00
Markus Glaser
2f45366156 test data for SimpleSeleniumTest 2011-01-01 15:51:54 +00:00
Markus Glaser
7b7f919d78 test data for SimpleSeleniumTest 2011-01-01 15:51:37 +00:00
Markus Glaser
c1bbdc2b05 typo in comment 2011-01-01 15:49:58 +00:00
Markus Glaser
1db7106fe7 changed path after relocation 2011-01-01 15:49:33 +00:00
nadeesha
2fe8e12075 Change the values taken from the SeleniumTestConstants.php 2010-12-31 10:05:15 +00:00
Platonides
46318874e1 Follow up r77654
These two files use constants from SeleniumTestConstants.php
I would be more confortable if all these defines were class variables, though.

Removed an empty statement.
2010-12-30 19:18:09 +00:00