Page MenuHomePhabricator
Paste P13076

All tests passed: Outreachy (selenium microtasks, task #5)
ActivePublic

Authored by BlessingDickson on Oct 27 2020, 12:07 PM.
Tags
None
Referenced Files
F32417298: All tests passed: Outreachy (selenium microtasks, task #5)
Oct 28 2020, 9:34 AM
F32416714: raw-paste-data.txt
Oct 27 2020, 5:24 PM
F32416447: All tests passed: Outreachy (selenium microtasks,task #5)
Oct 27 2020, 12:07 PM
Subscribers
None
#MediaWiki
## Development setup
#### Clone mediaWiki/core
Run 'git clone "ssh://blessingdickson@gerrit.wikimedia.org:29418/mediawiki/core" && scp -p -P 29418 blessingdickson@gerrit.wikimedia.org:hooks/commit-msg "core/.git/hooks/" command to clone the repository
Cd into MediaWiki/core directory
#### Requirements
Setup and run Docker and Docker Compose locally:
- [docker-install]: https://docs.docker.com/install/
- [docker-compose]: https://docs.docker.com/compose/install/
Node version
- v12.18.2
Operating system
- Windows
#### Use Vector skin
Clone the skin to `skins/Vector`:
```sh
git clone "git clone https://gerrit.wikimedia.org/r/mediawiki/skins/Vector" into skins/Vector directory
```
Configure MediaWiki to use the skin:
```sh
echo "wfLoadSkin( 'Vector' );" >> LocalSettings.php
```
#### Configure environment variables
Create a `.env` file in the root of the MediaWiki core repository with these contents:
`
MW_DOCKER_PORT=8080
MW_SCRIPT_PATH=/w
MW_SERVER=http://localhost:8080
MEDIAWIKI_USER=Admin
MEDIAWIKI_PASSWORD=dockerpass
`
#### Start environment and install MediaWiki
Start the environment:
```sh
# -d is detached mode - runs containers in the background:
docker-compose up -d
```
Install Composer dependencies:
```sh
docker-compose exec mediawiki composer update
```
Install MediaWiki in the environment:
```sh
docker-compose exec mediawiki /bin/bash /docker/install.sh
```
#### Start mediawiki in the browser
Navigate to `http://localhost:8080/w`
## Running tests
#### Selenium tests
- For more information see https://www.mediawiki.org/wiki/Selenium
- [Selenium/Node.js](https://www.mediawiki.org/wiki/Selenium/Node.js) on mediawiki.org
#### Prerequisites
- [ChromeDriver](https://chromedriver.chromium.org/downloads)
Chromedriver has to run in one terminal window:
- chromedriver --url-base=wd/hub --port=4444
Node.js](https://nodejs.org/en/)
- Node v12.18.2
Run `npm ci`
Configure the following environment variables which decide where to find MediaWiki and how to login:
- export MW_SERVER=http://localhost:8080
- export MW_SCRIPT_PATH=/w
- export MEDIAWIKI_USER=Admin
- export MEDIAWIKI_PASSWORD=dockerpass
#### Run all specs
npm run selenium
#### Filter
Run a specific spec:
- npm run selenium -- --spec tests/selenium/specs/page.js
To filter by test case, e.g. with the name containing "preferences":
- npm run selenium -- --mochaOpts.grep preferences
------------------------------------------------------------------------------------------------------------
#### Terminal output for tests
> @ selenium /Users/USER/core
> bash ./tests/selenium/selenium.sh
Starting ChromeDriver 87.0.4280.20 (c99e81631faa0b2a448e658c0dbd8311fb04ddbd-refs/branch-heads/4280@{#355}) on port on port 4444
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.
> @ selenium-test /Users/USER/core
> wdio ./tests/selenium/wdio.conf.js
Execution of 6 spec files started at 2020-10-27T17:14:39.373Z
[0-0] RUNNING in chrome - /tests/selenium/wdio-mediawiki/specs/BlankPage.js
[0-0] (node:14044) DeprecationWarning: Got: "options.rejectUnauthorized" is now deprecated, please use "options.https.rejectUnauthorized"
[0-0]
Screenshot location: /Users/user/Documents/apps/core/tests/selenium/log/BlankPage-should-have-its-title-%40daily.png
[0-0] PASSED in chrome - /tests/selenium/wdio-mediawiki/specs/BlankPage.js
[0-1] RUNNING in chrome - /tests/selenium/specs/page.js
[0-1] (node:14166) DeprecationWarning: Got: "options.rejectUnauthorized" is now deprecated, please use "options.https.rejectUnauthorized"
[0-1] [16:19:59] [S] [MWBOT] Login successful: Admin@http://localhost:8080/w
[0-1]
Screenshot location: /Users/USER/core/tests/selenium/log/Page-should-be-previewable.png
[0-1]
Screenshot location: /Users/USER/core/tests/selenium/log/Page-should-be-creatable.png
[0-1]
Screenshot location: /Users/USER/core/tests/selenium/log/Page-should-be-re-creatable.png
[0-1]
Screenshot location: /Users/USER/core/tests/selenium/log/Page-should-be-editable-%40daily.png
[0-1]
Screenshot location: /Users/USER/core/tests/selenium/log/Page-should-have-history-%40daily.png
[0-1]
Screenshot location: /Users/USER/core/tests/selenium/log/Page-should-be-deletable.png
[0-1]
Screenshot location: /Users/USER/core/tests/selenium/log/Page-should-be-restorable.png
[0-1]
Screenshot location: /Users/USER/core/tests/selenium/log/Page-should-be-undoable.png
[0-1] PASSED in chrome - /tests/selenium/specs/page.js
[0-2] RUNNING in chrome - /tests/selenium/specs/rollback.js
[0-2] (node:14193) DeprecationWarning: Got: "options.rejectUnauthorized" is now deprecated, please use "options.https.rejectUnauthorized"
[0-2] PASSED in chrome - /tests/selenium/specs/rollback.js
[0-3] RUNNING in chrome - /tests/selenium/specs/specialrecentchanges.js
[0-3] (node:16114) DeprecationWarning: Got: "options.rejectUnauthorized" is now deprecated, please use "options.https.rejectUnauthorized"
[0-3] [16:21:05] [S] [MWBOT] Login successful: Admin@http://localhost:8080/w
[0-3]
Screenshot location: /Users/USER/core/tests/selenium/log/Special%3ARecentChanges-shows-page-creation.png
[0-3] PASSED in chrome - /tests/selenium/specs/specialrecentchanges.js
[0-4] RUNNING in chrome - /tests/selenium/specs/specialwatchlist.js
[0-4] (node:16126) DeprecationWarning: Got: "options.rejectUnauthorized" is now deprecated, please use "options.https.rejectUnauthorized"
[0-4] [16:22:10] [S] [MWBOT] Login successful: Admin@http://localhost:8080/w
[0-4]
Screenshot location: /Users/USER/core/tests/selenium/log/Special%3AWatchlist-should-show-page-with-new-edit.png
[0-4] PASSED in chrome - /tests/selenium/specs/specialwatchlist.js
[0-5] RUNNING in chrome - /tests/selenium/specs/user.js
[0-5] (node:16138) DeprecationWarning: Got: "options.rejectUnauthorized" is now deprecated, please use "options.https.rejectUnauthorized"
[0-5] [16:22:19] [S] [MWBOT] Login successful: Admin@http://localhost:8080/w
[0-5]
Screenshot location: /Users/USER/core/tests/selenium/log/User-should-be-able-to-create-account.png
[0-5]
Screenshot location: /Users/USER/core/tests/selenium/log/User-should-be-able-to-log-in-%40daily.png
[0-5] PASSED in chrome - /tests/selenium/specs/user.js
"dot" Reporter:
....................
Spec Files: 6 passed, 6 total (100% completed) in 00:02:59

Event Timeline

BlessingDickson changed the title of this paste from All tests passed: Outreachy (selenium microtasks,task #5) to untitled.Oct 27 2020, 5:24 PM
BlessingDickson edited the content of this paste. (Show Details)
BlessingDickson archived this paste.
BlessingDickson changed the title of this paste from untitled to All tests passed: Outreachy (selenium microtasks, task #5).Oct 28 2020, 9:34 AM
BlessingDickson edited the content of this paste. (Show Details)