'use strict';
const assert = require( 'assert' ),
+ EditPage = require( '../pageobjects/edit.page' ),
HistoryPage = require( '../pageobjects/history.page' ),
- EditPage = require( '../pageobjects/edit.page' );
+ UserLoginPage = require( '../pageobjects/userlogin.page' );
describe( 'Page', function () {
var content,
name;
+ function getTestString() {
+ return Math.random().toString() + '-öäü-♠♣♥♦';
+ }
+
+ before( function () {
+ // disable VisualEditor welcome dialog
+ UserLoginPage.open();
+ browser.localStorage( 'POST', { key: 've-beta-welcome-dialog', value: '1' } );
+ } );
+
beforeEach( function () {
- content = Math.random().toString();
- name = Math.random().toString();
+ browser.deleteCookie();
+ content = getTestString();
+ name = getTestString();
} );
it( 'should be creatable', function () {
it( 'should be editable', function () {
- var content2 = Math.random().toString();
-
// create
- EditPage.edit( name, content );
+ browser.call( function () {
+ return EditPage.apiEdit( name, content );
+ } );
// edit
- EditPage.edit( name, content2 );
+ EditPage.edit( name, content );
- // check content
+ // check
assert.equal( EditPage.heading.getText(), name );
- assert.equal( EditPage.displayedContent.getText(), content2 );
+ assert.equal( EditPage.displayedContent.getText(), content );
} );
it( 'should have history', function () {
// create
- EditPage.edit( name, content );
+ browser.call( function () {
+ return EditPage.apiEdit( name, content );
+ } );
// check
HistoryPage.open( name );