mediawiki-extensions-Visual.../tests/selenium/specs/content_editable.js
Željko Filipin ba0b671fa9 selenium: Run only one test in Jenkins daily job
selenium-daily-beta-VisualEditor Jenkins daily job became really
unstable. Let's run just the simplest test for a few days to see if that
would help with job stability.

Bug: T296187
Change-Id: I858a3c5614277ea029fdabfd4468bb0d124e94d5
2022-06-02 15:43:43 +02:00

60 lines
1.7 KiB
JavaScript

'use strict';
const assert = require( 'assert' );
const EditPage = require( '../pageobjects/edit.page' );
const LoginPage = require( 'wdio-mediawiki/LoginPage' );
const Util = require( 'wdio-mediawiki/Util' );
describe( 'Content Editable', function () {
let name, content;
it( 'should load when an url is opened @daily', async function () {
content = Util.getTestString();
name = Util.getTestString();
await browser.deleteAllCookies();
await LoginPage.loginAdmin();
await EditPage.openForEditing( name );
await EditPage.activationComplete();
assert( await EditPage.toolbar.isDisplayed() );
} );
it( 'should be editable', async function () {
content = Util.getTestString();
name = Util.getTestString();
await browser.deleteAllCookies();
await LoginPage.loginAdmin();
await EditPage.openForEditing( name );
await EditPage.activationComplete();
await EditPage.veRootNode.setValue( content );
assert.equal( await EditPage.veRootNode.getText(), content );
// T269566: Popup with text
// 'Leave site? Changes that you made may not be saved. Cancel/Leave'
// appears after the browser tries to leave the page with the preview.
await browser.reloadSession();
} );
it( 'should save an edit', async function () {
content = Util.getTestString();
name = Util.getTestString();
await browser.deleteAllCookies();
await LoginPage.loginAdmin();
await EditPage.openForEditing( name );
await EditPage.activationComplete();
await EditPage.veRootNode.setValue( content );
await EditPage.savePageDots.click();
await EditPage.savePage.click();
assert( await EditPage.veBodyContent.isDisplayed() );
assert.equal( await EditPage.veBodyContent.getText(), content );
} );
} );