From 4d63b91152fde6c115df257121d5c820ef3c1a58 Mon Sep 17 00:00:00 2001 From: Jdlrobson Date: Wed, 28 Feb 2018 21:17:27 +0000 Subject: [PATCH] Revert "Move Selenium test from mediawiki/core" This reverts commit 68292ad0a8bcbfd4d28f051522d6b8cca9641c8b. This test seems to be running on other skins that it should not run on - for example Minerva. I'm not sure if this is configuration related or test related. I will follow up and restore these personally. Bug: T188553 Change-Id: I4aa58fd021aceab1a01c288782111faeb52723f2 --- tests/selenium/.eslintrc.json | 11 ----- tests/selenium/README.md | 33 -------------- .../selenium/pageobjects/usermessage.page.js | 7 --- tests/selenium/specs/user.js | 45 ------------------- 4 files changed, 96 deletions(-) delete mode 100644 tests/selenium/.eslintrc.json delete mode 100644 tests/selenium/README.md delete mode 100644 tests/selenium/pageobjects/usermessage.page.js delete mode 100644 tests/selenium/specs/user.js 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).' ); - - } ); - -} );