2020-06-02 21:21:44 +00:00
|
|
|
'use strict';
|
|
|
|
|
2022-02-16 13:24:57 +00:00
|
|
|
const
|
2019-04-08 23:45:11 +00:00
|
|
|
{
|
|
|
|
pageExists, iAmOnAPageThatDoesNotExist,
|
|
|
|
iAmUsingTheMobileSite,
|
|
|
|
iAmLoggedIntoTheMobileWebsite,
|
|
|
|
iAmOnPage
|
|
|
|
} = require( '../features/step_definitions/common_steps' ),
|
|
|
|
{
|
2019-10-17 22:46:07 +00:00
|
|
|
iClickTheAddTalkButton,
|
2019-04-08 23:45:11 +00:00
|
|
|
thereShouldBeASaveDiscussionButton,
|
|
|
|
thereShouldBeAnAddDiscussionButton,
|
2019-12-13 19:51:24 +00:00
|
|
|
thereShouldBeATalkTab,
|
2022-02-16 13:24:57 +00:00
|
|
|
thereShouldBeNoTalkButton
|
2019-04-08 23:45:11 +00:00
|
|
|
} = require( '../features/step_definitions/talk_steps' );
|
|
|
|
|
|
|
|
// @chrome @en.m.wikipedia.beta.wmflabs.org @firefox @test2.m.wikipedia.org @vagrant
|
|
|
|
describe( 'Talk', () => {
|
|
|
|
|
2019-05-07 16:14:52 +00:00
|
|
|
before( () => {
|
2019-04-08 23:45:11 +00:00
|
|
|
pageExists( 'Talk:Selenium talk test' );
|
|
|
|
pageExists( 'Selenium talk test' );
|
|
|
|
} );
|
|
|
|
|
2019-05-07 16:14:52 +00:00
|
|
|
beforeEach( () => {
|
|
|
|
iAmUsingTheMobileSite();
|
|
|
|
} );
|
|
|
|
|
2019-10-17 22:46:07 +00:00
|
|
|
it( 'Talk button not visible as logged out user', () => {
|
2019-04-08 23:45:11 +00:00
|
|
|
iAmOnPage( 'Selenium talk test' );
|
|
|
|
thereShouldBeNoTalkButton();
|
|
|
|
} );
|
|
|
|
|
|
|
|
// @login
|
2019-12-13 19:51:24 +00:00
|
|
|
it( 'Talk tab visible as logged in user', () => {
|
2019-04-08 23:45:11 +00:00
|
|
|
iAmLoggedIntoTheMobileWebsite();
|
|
|
|
iAmOnPage( 'Selenium talk test' );
|
2019-12-13 19:51:24 +00:00
|
|
|
thereShouldBeATalkTab();
|
2019-04-08 23:45:11 +00:00
|
|
|
} );
|
|
|
|
|
|
|
|
// @login
|
|
|
|
it( 'Talk on a page that doesn\'t exist (bug 64268)', () => {
|
|
|
|
iAmLoggedIntoTheMobileWebsite();
|
|
|
|
iAmOnAPageThatDoesNotExist();
|
2019-12-13 19:51:24 +00:00
|
|
|
thereShouldBeATalkTab();
|
2019-04-08 23:45:11 +00:00
|
|
|
} );
|
|
|
|
|
|
|
|
// @smoke @login
|
2019-10-17 22:46:07 +00:00
|
|
|
it( 'Add discussion button shows on talk pages for logged in users', () => {
|
2019-04-08 23:45:11 +00:00
|
|
|
iAmLoggedIntoTheMobileWebsite();
|
2019-10-17 22:46:07 +00:00
|
|
|
iAmOnPage( 'Talk:Selenium talk test' );
|
2019-04-08 23:45:11 +00:00
|
|
|
thereShouldBeAnAddDiscussionButton();
|
|
|
|
} );
|
|
|
|
|
|
|
|
// @smoke @login
|
2019-10-17 22:46:07 +00:00
|
|
|
it( 'Add discussion for talk page possible as logged in user', () => {
|
2019-04-08 23:45:11 +00:00
|
|
|
iAmLoggedIntoTheMobileWebsite();
|
|
|
|
iAmOnPage( 'Talk:Selenium talk test' );
|
2019-10-17 22:46:07 +00:00
|
|
|
iClickTheAddTalkButton();
|
2019-04-08 23:45:11 +00:00
|
|
|
thereShouldBeASaveDiscussionButton();
|
|
|
|
} );
|
|
|
|
|
|
|
|
} );
|