2017-02-14 16:05:08 +00:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
var assert = require( 'assert' ),
|
2017-12-08 18:40:57 +00:00
|
|
|
Api = require( 'wdio-mediawiki/Api' ),
|
2017-02-14 16:05:08 +00:00
|
|
|
ReadMorePage = require( '../pageobjects/readmore.page' );
|
|
|
|
|
|
|
|
describe( 'ReadMore', function () {
|
2020-05-25 18:17:41 +00:00
|
|
|
let bot;
|
|
|
|
|
|
|
|
before( async () => {
|
|
|
|
bot = await Api.bot();
|
|
|
|
} );
|
2017-02-14 16:05:08 +00:00
|
|
|
|
2020-01-15 06:11:52 +00:00
|
|
|
const name = 'Related Articles 1';
|
2017-02-14 16:05:08 +00:00
|
|
|
|
|
|
|
before( function () {
|
|
|
|
// Create page needed for the tests
|
2020-05-25 18:17:41 +00:00
|
|
|
browser.call( async () => {
|
2020-01-15 06:11:52 +00:00
|
|
|
const content = '{{#related:related_articles_2}}';
|
2020-05-25 18:17:41 +00:00
|
|
|
await bot.edit( name, content );
|
2017-02-14 16:05:08 +00:00
|
|
|
} );
|
|
|
|
} );
|
|
|
|
|
|
|
|
it( 'ReadMore is not present on Vector', function () {
|
|
|
|
ReadMorePage.openDesktop( name );
|
|
|
|
assert( !ReadMorePage.isCardVisible(), 'No related pages cards are shown' );
|
|
|
|
} );
|
|
|
|
|
|
|
|
it( 'ReadMore is present in Minerva', function () {
|
|
|
|
ReadMorePage.openMobile( name );
|
|
|
|
assert( ReadMorePage.seeReadMore() );
|
|
|
|
} );
|
|
|
|
} );
|