mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-24 06:24:08 +00:00
api-testing: Add test for creating and saving a page
Testing the visualeditoredit action API for VisualEditor. Change-Id: I951ecf1c71e2ee66e3d1fc15a29b312b8fe9956e
This commit is contained in:
parent
77565dabf3
commit
db6cc66749
|
@ -6,6 +6,7 @@ describe( 'Visual Editor API', function () {
|
|||
// const titles = ( list ) => list.map( ( p ) => utils.dbkey( p.title ) );
|
||||
|
||||
const title = utils.title( 'VisualEditor' );
|
||||
const newPage = utils.title( 'VisualEditorNew' );
|
||||
|
||||
let alice;
|
||||
let pageInfo;
|
||||
|
@ -50,4 +51,22 @@ describe( 'Visual Editor API', function () {
|
|||
const result = await alice.action( 'visualeditor', { page: title, paction: 'wikitext' } );
|
||||
assert.equal( result.visualeditor.result, 'success' );
|
||||
} );
|
||||
|
||||
it( 'Should create page, edit and save page', async () => {
|
||||
const token = await alice.token();
|
||||
const html = '<p>save paction</p>';
|
||||
const summary = 'save test workflow';
|
||||
const result = await alice.action(
|
||||
'visualeditoredit',
|
||||
{
|
||||
page: newPage,
|
||||
paction: 'save',
|
||||
token: token,
|
||||
html: html,
|
||||
summary: summary
|
||||
},
|
||||
'post'
|
||||
);
|
||||
assert.equal( result.visualeditoredit.result, 'success' );
|
||||
} );
|
||||
} );
|
||||
|
|
Loading…
Reference in a new issue