mediawiki-skins-MinervaNeue/tests/selenium/features/step_definitions/user_page_steps.js
Vaughn Walters 677ce50b24 selenium: Refactor WebdriverIO tests from sync to async mode
WebdriverIO has dropped support of sync mode, hence changed to async.

Update npm packages: @wdio/*, wdio-mediawiki
because async mode needs at least @wdio v7.9.

Remove npm packages: @wdio/dot-reporter and @wdio/sync.

Bug: T293084
Change-Id: I5babbdadf21e9f951f69de93bfca5213a50965aa
2023-04-08 16:18:28 -05:00

27 lines
899 B
JavaScript

'use strict';
const assert = require( 'assert' );
const { ArticlePage } = require( '../support/world.js' );
const { iAmOnPage } = require( './common_steps' );
const { theTextOfTheFirstHeadingShouldBe } = require( './editor_steps' );
const username = browser.config.mwUser.replace( /_/g, ' ' );
const iVisitMyUserPage = async () => {
await iAmOnPage( `User:${username}` );
};
const iShouldBeOnMyUserPage = async () => {
await theTextOfTheFirstHeadingShouldBe( username );
};
const thereShouldBeALinkToMyContributions = async () => {
assert.strictEqual( await ArticlePage.contributions_link_element.isDisplayed(), true );
};
const thereShouldBeALinkToMyTalkPage = async () => {
assert.strictEqual( await ArticlePage.talk_tab_element.isDisplayed(), true );
};
module.exports = { iVisitMyUserPage, iShouldBeOnMyUserPage,
thereShouldBeALinkToMyContributions, thereShouldBeALinkToMyTalkPage };