wiki.techinc.nl/tests/selenium/pageobjects/preferences.page.js

21 lines
419 B
JavaScript
Raw Normal View History

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
2016-12-19 16:39:29 +00:00
'use strict';
const Page = require( './page' );
class PreferencesPage extends Page {
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 486e566cfef612de6773df435a74d5fc37e27174. * Revert "Preferences: Show preview of edit fonts in edit font selector" This reverts commit 6634ff729dc7f6d0f541639dbdf3c4d9f786ddf6. * Revert "Follow-Up Iae63b6994: Add missing editfont dependency" This reverts commit ce42fdf151c39f91cf4077673219fa6228a54d7f. * Revert "Preferences: Improve visual appearance by “unboxing” sections" This reverts commit c9415bb0059f4dae4abc5e39a8af844328333120. * Revert "Remove box-shadow from preference panels for ooui-apex" This reverts commit a934b82ca27971e8f0553a7ab7c8ee30fccf3283. * Revert "Preferences: Don't show the watchlist token; just link to ResetTokens" This reverts commit e8c9102fc7b66460c33f643b0dea7190cb89ac83. * Revert "mw.special.preferences: Make the "Basic information" section more compact" This reverts commit d48b7260f30c1ec57046a1f8e4c82057aed45e5f. * Revert "mw.special.preferences: Widen the dropdown of the "Time zone" field" This reverts commit afd5f1417efdd463d86186257c4ec77dd4a442ce. Bug: T117781 Bug: T180538 Change-Id: I44b5daea1828f71881b5bd35218f5ecb7ab7f36e
2017-12-02 21:15:35 +00:00
get realName() { return browser.element( '#mw-input-wprealname' ); }
get save() { return browser.element( '#prefcontrol' ); }
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
2016-12-19 16:39:29 +00:00
open() {
super.open( 'Special:Preferences' );
}
changeRealName( realName ) {
this.open();
this.realName.setValue( realName );
this.save.click();
}
}
module.exports = new PreferencesPage();