Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
6a1d5b2
success criterias
Jun 27, 2016
298de19
small reworks
Jun 27, 2016
9d66df4
audince test update
Jun 29, 2016
69130e8
reworked
Jun 29, 2016
83fa5d4
fixed
Jun 30, 2016
2cd2d10
reworked
Jun 30, 2016
4ef890e
fixed
Jun 30, 2016
49ea4bb
fixed
Jun 30, 2016
b092a50
Merge branch 'master' into audienceTest
Jul 7, 2016
df0b4a1
reworked description to the audience test
Jul 7, 2016
655b2d1
fixed
Jul 7, 2016
c4baff7
rewrote success criteria
Jul 11, 2016
1849ffd
merged
Jul 11, 2016
e412644
reworked
Jul 11, 2016
bde7ac6
fixed comments
Jul 13, 2016
f09d071
reworked
Jul 13, 2016
8e112a7
fixed comments
Jul 14, 2016
78aa65a
fixed comments
Jul 14, 2016
1dfe492
Merge branch 'master' into audienceTest
vpodk Jul 14, 2016
17ee48a
merged with master
Jul 15, 2016
e7800f1
merged with master
Jul 15, 2016
ece8964
fixed
Jul 15, 2016
c43187b
Merge branch 'master' into audienceTest
vpodk Jul 15, 2016
ad051b8
Merge branch 'master' into audienceTest
vpodk Jul 15, 2016
40a23e9
reworked
Jul 15, 2016
b8dfb93
reworked
Jul 15, 2016
6927b54
reworked success criteria
Jul 15, 2016
3e27672
reworked success criteria
Jul 15, 2016
2e021a4
reworked success criteria
Jul 15, 2016
7a017d0
reworked success criteria
Jul 15, 2016
a46d4b3
reworked
Jul 18, 2016
c625d18
fixed
Jul 18, 2016
17ea5a3
pull
Jul 18, 2016
dd56917
merged with master
Jul 18, 2016
e41c63a
reworked test and merged with master
Jul 18, 2016
94238ad
Merge branch 'master' into audienceTest
Jul 18, 2016
204648e
fixed
Jul 18, 2016
f3bd061
Merge branch 'master' into audienceTest
vpodk Apr 23, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 16 additions & 5 deletions tests/testaudience.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
/**
* @fileoverview Defines tests for audience engagement.
*
* @fileoverview Defines test for Audience engagement.
* Success criteria:
* - Elements with ID prefix 'audience-engagement-‘ should exist;
* - Elements with ID prefix 'audience-engagement-‘ should contain content
* equal 'N/A' or '-' or one of following string: '10.1%', '10%',
* '10:1', '10';
* @see http://google.github.io/styleguide/javascriptguide.xml
* @see http://developers.google.com/closure/compiler/docs/js-for-compiler
*/
Expand All @@ -13,6 +17,7 @@
* @return {boolean} Returns "true" if test failed.
*/
function testAudience() {
// Elements with ID prefix 'audience-engagement-‘ should exist.
/** @type {!Array.<string>} */ var nodes = [
'audience-engagement-visitors-value',
'audience-engagement-pageviews-value',
Expand All @@ -25,18 +30,24 @@ function testAudience() {
'audience-engagement-bounce-rate-delta'
];
/** @type {number} */ var length = nodes.length;
/** @type {boolean} */ var result = false;
/** @type {Element} */ var element;
/** @type {string} */ var content;

for (; length;) {
element = document.getElementById(nodes[--length]);
content = element && element.textContent.trim();

if (!content || !(PATTERN.test(content) || 'N/A' == content)) {
return true;
// Elements with ID prefix 'audience-engagement-‘ should contain
// content equal 'N/A' or '-' or one of following string: '10.1%', '10%',
// '10:1', '10'.
if (!(content && (PATTERN.test(content) || 'N/A' == content ||
'-' == content))) {
result = true;
break;
}
}
return false;
return result;
}


Expand Down
9 changes: 5 additions & 4 deletions tests/testmediaqueries.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
/**
* @fileoverview Defines test for Media Queries widget.
* Success criterias:
* Success criteria:
* - Element with ID 'media-widget' should exist;
* - Element with ID 'media-widget' should contain element
* with ID 'media-data-table';
* - If element with ID 'media-widget' is not empty it shouldn't contain
* element with CSS classes '.rule.media-none' and rows in element with ID
* element with CSS classes '.rule.media-none'
* - If element with ID 'media-widget' is not empty rows in element with ID
* 'media-data-table' should start with text string '@media';
* - If element with ID 'media-widget' is empty it should contain element with
* CSS classes '.rule.media-none'.
Expand All @@ -27,8 +28,8 @@ function testMediaQueries() {
// Element with ID 'media-widget' should exist.
/** @type {Element} */ var element = document.getElementById(WIDGET_ID);

// Element with ID 'media-widget' should contain element
// with ID 'media-data-table'.
// Element with ID 'media-widget' should contain element with
// ID 'media-data-table'.
/** @type {Element} */ var table = document.getElementById(TABLE_ID);

// If element with ID 'media-widget' is not empty it shouldn't contain
Expand Down