aboutsummaryrefslogtreecommitdiffstats
path: root/tests/selenium/specs/recentchanges.js
diff options
context:
space:
mode:
authorŽeljko Filipin <zeljko.filipin@gmail.com>2021-05-20 19:46:09 +0200
committerŽeljko Filipin <zeljko.filipin@gmail.com>2021-05-20 19:46:09 +0200
commit00582fa7a8a0e8b016a536b2df1c2426dac95b81 (patch)
treef689b7c47374d8c94dbd57f24dfedd15b1572030 /tests/selenium/specs/recentchanges.js
parentf6508708a6b97b66404d6de8979179c4a5f39475 (diff)
downloadmediawikicore-00582fa7a8a0e8b016a536b2df1c2426dac95b81.tar.gz
mediawikicore-00582fa7a8a0e8b016a536b2df1c2426dac95b81.zip
selenium: Simplify spec file names
Remove `special` from `recentchanges.js` and `watchlist.js`. The entire `spec` folder has only four files. The two mentioned and `page.js` and `user.js`. If that was a folder with a lot of files, it would make sense to use `special`. Now it just makes file names long. Additionally, files in `pageobjects` folder are already using simpler names, `recentchanges.page.js` and `watchlist.page.js`, without `special`. Bug: T210726 Change-Id: I156f436e2de345586a25174c630ad60259504115
Diffstat (limited to 'tests/selenium/specs/recentchanges.js')
-rw-r--r--tests/selenium/specs/recentchanges.js40
1 files changed, 40 insertions, 0 deletions
diff --git a/tests/selenium/specs/recentchanges.js b/tests/selenium/specs/recentchanges.js
new file mode 100644
index 000000000000..e086546aca8b
--- /dev/null
+++ b/tests/selenium/specs/recentchanges.js
@@ -0,0 +1,40 @@
+'use strict';
+
+const assert = require( 'assert' );
+const Api = require( 'wdio-mediawiki/Api' );
+const RecentChangesPage = require( '../pageobjects/recentchanges.page' );
+const Util = require( 'wdio-mediawiki/Util' );
+
+describe( 'Special:RecentChanges', function () {
+ let content, name, bot;
+
+ before( async () => {
+ bot = await Api.bot();
+ } );
+
+ beforeEach( function () {
+ browser.deleteAllCookies();
+ content = Util.getTestString();
+ name = Util.getTestString();
+ } );
+
+ it( 'shows page creation', function () {
+ browser.call( async () => {
+ await bot.edit( name, content );
+ } );
+
+ browser.waitUntil( async () => {
+ const result = await bot.request( {
+ action: 'query',
+ list: 'recentchanges',
+ rctitle: name
+ } );
+ return result.query.recentchanges.length > 0;
+ } );
+
+ RecentChangesPage.open();
+
+ assert.strictEqual( RecentChangesPage.titles[ 0 ].getText(), name );
+ } );
+
+} );