2 const assert
= require( 'assert' ),
3 HistoryPage
= require( '../pageobjects/history.page' ),
4 EditPage
= require( '../pageobjects/edit.page' );
6 describe( 'Page', function () {
11 beforeEach( function () {
12 content
= Math
.random().toString();
13 name
= Math
.random().toString();
16 it( 'should be creatable', function () {
19 EditPage
.edit( name
, content
);
22 assert
.equal( EditPage
.heading
.getText(), name
);
23 assert
.equal( EditPage
.displayedContent
.getText(), content
);
27 it( 'should be editable', function () {
29 var content2
= Math
.random().toString();
32 EditPage
.edit( name
, content
);
35 EditPage
.edit( name
, content2
);
38 assert
.equal( EditPage
.heading
.getText(), name
);
39 assert
.equal( EditPage
.displayedContent
.getText(), content2
);
43 it( 'should have history', function () {
46 EditPage
.edit( name
, content
);
49 HistoryPage
.open( name
);
50 assert
.equal( HistoryPage
.comment
.getText(), `(Created page with "${content}")` );