diff --git a/tests/selenium/.eslintrc.json b/tests/selenium/.eslintrc.json deleted file mode 100644 index b2d0bdd9f..000000000 --- a/tests/selenium/.eslintrc.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "extends": "../../.eslintrc.json", - "env": { - "es6": true, - "mocha": true, - "node": true - }, - "globals": { - "browser": false - } -} diff --git a/tests/selenium/README.md b/tests/selenium/README.md deleted file mode 100644 index bcb0d06c5..000000000 --- a/tests/selenium/README.md +++ /dev/null @@ -1,33 +0,0 @@ -# Selenium tests - -Please see tests/selenium/README.md file in mediawiki/core repository (usually at mediawiki/vagrant/mediawiki). - -## Usage - -Set up MediaWiki-Vagrant: - - cd mediawiki/vagrant - vagrant up - vagrant provision - cd mediawiki - npm install - -Run both mediawiki/core and skin tests from mediawiki/core folder: - - npm run selenium - -To run only skin tests, first in one terminal tab (or window) start Chromedriver: - - chromedriver --url-base=wd/hub --port=4444 - -Then, in another terminal tab (or window) go to mediawiki/core folder: - - ./node_modules/.bin/wdio tests/selenium/wdio.conf.js --spec skins/SKIN-NAME/tests/selenium/specs/*.js - -Run only one skin test file from mediawiki/core folder: - - ./node_modules/.bin/wdio tests/selenium/wdio.conf.js --spec skins/SKIN-NAME/tests/selenium/specs/FILE-NAME.js - -To run only one skin test from mediawiki/core folder (name contains string 'TEST-NAME'): - - ./node_modules/.bin/wdio tests/selenium/wdio.conf.js --spec skins/SKIN-NAME/tests/selenium/specs/FILE-NAME.js --mochaOpts.grep preferences TEST-NAME diff --git a/tests/selenium/pageobjects/usermessage.page.js b/tests/selenium/pageobjects/usermessage.page.js deleted file mode 100644 index cc474dc0b..000000000 --- a/tests/selenium/pageobjects/usermessage.page.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; -const Page = require( '../../../../../tests/selenium/pageobjects/page' ); - -class UserMessagePage extends Page { - get usermessage() { return browser.element( 'div.usermessage' ); } -} -module.exports = new UserMessagePage(); diff --git a/tests/selenium/specs/user.js b/tests/selenium/specs/user.js deleted file mode 100644 index 8e7868a7a..000000000 --- a/tests/selenium/specs/user.js +++ /dev/null @@ -1,45 +0,0 @@ -'use strict'; -const assert = require( 'assert' ), - CreateAccountPage = require( '../../../../../tests/selenium/pageobjects/createaccount.page' ), - EditPage = require( '../../../../../tests/selenium/pageobjects/edit.page' ), - UserLoginPage = require( '../../../../../tests/selenium/pageobjects/userlogin.page' ), - UserMessagePage = require( '../pageobjects/usermessage.page' ); - -describe( 'User', function () { - - var password, - username; - - before( function () { - // disable VisualEditor welcome dialog - UserLoginPage.open(); - browser.localStorage( 'POST', { key: 've-beta-welcome-dialog', value: '1' } ); - } ); - - beforeEach( function () { - browser.deleteCookie(); - username = `User-${Math.random().toString()}`; - password = Math.random().toString(); - } ); - - it( 'should be able to view new message banner', function () { - - // create user - browser.call( function () { - return CreateAccountPage.apiCreateAccount( username, password ); - } ); - - // create talk page with content - browser.call( function () { - return EditPage.apiEdit( 'User_talk:' + username, Math.random().toString() ); - } ); - - // log in - UserLoginPage.login( username, password ); - - // check - assert.equal( UserMessagePage.usermessage.getText(), 'You have a new message (last change).' ); - - } ); - -} );