-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(cherry picked from commit 3b3ca8d)
- Loading branch information
Showing
11 changed files
with
2,918 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
tests/selenium/log | ||
|
||
# npm dependencies | ||
/node_modules/ | ||
# We use yarn instead of npm | ||
package-lock.json | ||
|
||
# composer dependencies | ||
/vendor/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"root": true, | ||
"extends": ["wikimedia/selenium"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
'use strict'; | ||
const Page = require('wdio-mediawiki/Page'); | ||
|
||
class EchoPage extends Page { | ||
get notifications() { | ||
return $('#pt-notifications-all'); | ||
} | ||
get popup() { | ||
return $('.oo-ui-labelElement-label'); | ||
} | ||
} | ||
module.exports = new EchoPage(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
'use strict'; | ||
const Page = require('wdio-mediawiki/Page'); | ||
|
||
class FemiwikiPage extends Page { | ||
get gnbMenu() { | ||
return $('#fw-menu-toggle'); | ||
} | ||
} | ||
module.exports = new FemiwikiPage(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
'use strict'; | ||
|
||
const Api = require('wdio-mediawiki/Api'); | ||
const Femiwiki = require('../pageobjects/femiwiki.page'); | ||
const EchoPage = require('../pageobjects/echo.page'); | ||
const Util = require('wdio-mediawiki/Util'); | ||
const assert = require('assert'); | ||
const UserLoginPage = require('wdio-mediawiki/LoginPage'); | ||
const UserPreferences = require('../userpreferences'); | ||
const BlankPage = require('wdio-mediawiki/BlankPage'); | ||
describe('flyout for notifications appears when clicked @daily', function () { | ||
let bot; | ||
|
||
before(async () => { | ||
bot = await Api.bot(); | ||
}); | ||
|
||
it('checks for OOUI icon replacement @daily', function () { | ||
// Prepares accounts | ||
const username = Util.getTestString('User-'); | ||
const password = Util.getTestString(); | ||
browser.call(async () => { | ||
await Api.createAccount(bot, username, password); | ||
}); | ||
|
||
UserLoginPage.login(username, password); | ||
UserPreferences.enableFemiwiki(); | ||
// Refresh after changing the preference | ||
BlankPage.open(); | ||
Femiwiki.gnbMenu.click(); | ||
EchoPage.notifications.waitForDisplayed(); | ||
EchoPage.notifications.click(); | ||
EchoPage.popup.waitForDisplayed(); | ||
assert(EchoPage.popup.isExisting()); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
'use strict'; | ||
|
||
const BlankPage = require('wdio-mediawiki/BlankPage'); | ||
const Util = require('wdio-mediawiki/Util'); | ||
|
||
class UserPreferences { | ||
setPreferences(preferences) { | ||
BlankPage.open(); | ||
Util.waitForModuleState('mediawiki.base'); | ||
|
||
return browser.execute(function (prefs) { | ||
return mw.loader.using('mediawiki.api').then(function () { | ||
return new mw.Api().saveOptions(prefs); | ||
}); | ||
}, preferences); | ||
} | ||
|
||
enableFemiwiki() { | ||
this.setPreferences({ | ||
skin: 'femiwiki', | ||
}); | ||
} | ||
} | ||
|
||
module.exports = new UserPreferences(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
'use strict'; | ||
|
||
const { config } = require('wdio-mediawiki/wdio-defaults.conf.js'); | ||
|
||
exports.config = { | ||
...config, | ||
// Override, or add to, the setting from wdio-mediawiki. | ||
// Learn more at https://webdriver.io/docs/configurationfile/ | ||
// | ||
// Example: | ||
// logLevel: 'info', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.