From: addshore Date: Fri, 8 Jun 2018 12:08:49 +0000 (+0100) Subject: selenium: page spec, make it easier to see where strings come from X-Git-Tag: 1.34.0-rc.0~5093 X-Git-Url: https://git.cyclocoop.org/%20%27.%28%24debut%20%20%20%24par_page%29.%27?a=commitdiff_plain;h=09536c527df0266453a7a38786781abaaf35dded;p=lhc%2Fweb%2Fwiklou.git selenium: page spec, make it easier to see where strings come from Having randomly generated strings is great, but sometimes it can help to allow a human to easily see where the string is actually being generated in code, so add an optional suffix to the string being generated. Change-Id: Ibfe45f74b4880a70a76c01223a787dabcd43607e --- diff --git a/tests/selenium/specs/page.js b/tests/selenium/specs/page.js index dfc6fa1ae8..bc5f1009d7 100644 --- a/tests/selenium/specs/page.js +++ b/tests/selenium/specs/page.js @@ -10,8 +10,8 @@ describe( 'Page', function () { var content, name; - function getTestString() { - return Math.random().toString() + '-öäü-♠♣♥♦'; + function getTestString( suffix = 'defaultsuffix' ) { + return Math.random().toString() + '-öäü-♠♣♥♦-' + suffix; } before( function () { @@ -22,8 +22,8 @@ describe( 'Page', function () { beforeEach( function () { browser.deleteCookie(); - content = getTestString(); - name = getTestString(); + content = getTestString( 'beforeEach-content' ); + name = getTestString( 'beforeEach-name' ); } ); it( 'should be creatable', function () { @@ -36,7 +36,7 @@ describe( 'Page', function () { } ); it( 'should be re-creatable', function () { - let initialContent = getTestString(); + let initialContent = getTestString( 'initialContent' ); // create browser.call( function () {