2 const assert
= require( 'assert' ),
3 EditPage
= require( '../pageobjects/edit.page' ),
4 HistoryPage
= require( '../pageobjects/history.page' );
6 describe( 'Page', function () {
11 beforeEach( function () {
12 browser
.deleteCookie();
13 content
= Math
.random().toString();
14 name
= Math
.random().toString();
17 it( 'should be creatable', function () {
20 EditPage
.edit( name
, content
);
23 assert
.equal( EditPage
.heading
.getText(), name
);
24 assert
.equal( EditPage
.displayedContent
.getText(), content
);
28 it( 'should be editable', function () {
30 var content2
= Math
.random().toString();
33 browser
.call( function () {
34 return EditPage
.apiEdit( name
, content
);
38 EditPage
.edit( name
, content2
);
41 assert
.equal( EditPage
.heading
.getText(), name
);
42 assert
.equal( EditPage
.displayedContent
.getText(), content2
);
46 it( 'should have history', function () {
49 browser
.call( function () {
50 return EditPage
.apiEdit( name
, content
);
54 HistoryPage
.open( name
);
55 assert
.equal( HistoryPage
.comment
.getText(), `(Created page with "${content}")` );