var content,
name;
- function getTestString() {
- return Math.random().toString() + '-öäü-♠♣♥♦';
+ function getTestString( suffix = 'defaultsuffix' ) {
+ return Math.random().toString() + '-Iñtërnâtiônàlizætiøn☃-' + suffix;
}
before( function () {
beforeEach( function () {
browser.deleteCookie();
- content = getTestString();
- name = getTestString();
+ content = getTestString( 'beforeEach-content' );
+ name = getTestString( 'beforeEach-name' );
} );
it( 'should be creatable', function () {
EditPage.edit( name, content );
// check
- assert.equal( EditPage.heading.getText(), name );
- assert.equal( EditPage.displayedContent.getText(), content );
+ assert.strictEqual( EditPage.heading.getText(), name );
+ assert.strictEqual( EditPage.displayedContent.getText(), content );
} );
it( 'should be re-creatable', function () {
- let initialContent = getTestString();
+ let initialContent = getTestString( 'initialContent' );
// create
browser.call( function () {
EditPage.edit( name, content );
// check
- assert.equal( EditPage.heading.getText(), name );
- assert.equal( EditPage.displayedContent.getText(), content );
+ assert.strictEqual( EditPage.heading.getText(), name );
+ assert.strictEqual( EditPage.displayedContent.getText(), content );
} );
it( 'should be editable', function () {
} );
// edit
- EditPage.edit( name, content );
+ let editContent = getTestString( 'editContent' );
+ EditPage.edit( name, editContent );
// check
- assert.equal( EditPage.heading.getText(), name );
- assert.equal( EditPage.displayedContent.getText(), content );
+ assert.strictEqual( EditPage.heading.getText(), name );
+ assert.strictEqual( EditPage.displayedContent.getText(), editContent );
} );
it( 'should have history', function () {
// check
HistoryPage.open( name );
- assert.equal( HistoryPage.comment.getText(), `(Created page with "${content}")` );
+ assert.strictEqual( HistoryPage.comment.getText(), `(Created page with "${content}")` );
} );
it( 'should be deletable', function () {
DeletePage.delete( name, content + '-deletereason' );
// check
- assert.equal(
+ assert.strictEqual(
DeletePage.displayedContent.getText(),
'"' + name + '" has been deleted. See deletion log for a record of recent deletions.\nReturn to Main Page.'
);
RestorePage.restore( name, content + '-restorereason' );
// check
- assert.equal( RestorePage.displayedContent.getText(), name + ' has been restored\nConsult the deletion log for a record of recent deletions and restorations.' );
+ assert.strictEqual( RestorePage.displayedContent.getText(), name + ' has been restored\nConsult the deletion log for a record of recent deletions and restorations.' );
} );
} );