mediawiki-extensions-Visual.../tests/selenium/specs/content_editable.js
Esther Akinloose 1e030bcde5 selenium: Check if content editable is editable
Bug: T296187
Change-Id: I7a7808bf5cabdccc3f0a01ccecfdadeb7fdc9b91
2022-05-02 13:11:57 +01:00

34 lines
933 B
JavaScript

'use strict';
const assert = require( 'assert' );
const EditPage = require( '../pageobjects/edit.page' );
const Util = require( 'wdio-mediawiki/Util' );
const LoginPage = require( 'wdio-mediawiki/LoginPage' );
describe( 'Content Editable', function () {
it( 'should load when an url is opened', async function () {
await LoginPage.loginAdmin();
const name = Util.getTestString();
await EditPage.openForEditing( name );
await EditPage.activationComplete();
assert( await EditPage.toolbar.isDisplayed() );
} );
it( 'should be editable', async function () {
await LoginPage.loginAdmin();
const name = Util.getTestString();
const content = Util.getTestString();
await EditPage.openForEditing( name );
await EditPage.activationComplete();
await EditPage.veRootNode.setValue( content );
const expectedContent = await EditPage.veRootNode.getText();
assert.equal( expectedContent, content );
} );
} );