From 6a1d5b2b25bf34731401e83efb5eb664f77f7c15 Mon Sep 17 00:00:00 2001 From: Myhailo Date: Mon, 27 Jun 2016 17:41:59 +0300 Subject: [PATCH 01/24] success criterias --- tests/testaudience.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/testaudience.js b/tests/testaudience.js index a600ac2..d1a9a7e 100644 --- a/tests/testaudience.js +++ b/tests/testaudience.js @@ -1,6 +1,9 @@ /** * @fileoverview Defines tests for audience engagement. - * + * Success criterias: + * - each element from (nodes) array should exist; + * - content of the array element should exist and match the PATTERN; + * - content of the array element can't be equal to 'N/A'. * @see http://google.github.io/styleguide/javascriptguide.xml * @see http://developers.google.com/closure/compiler/docs/js-for-compiler */ From 298de19e5b22d888116ffd0024e68ba2fa1a71e8 Mon Sep 17 00:00:00 2001 From: Myhailo Date: Mon, 27 Jun 2016 17:58:27 +0300 Subject: [PATCH 02/24] small reworks --- tests/testaudience.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/testaudience.js b/tests/testaudience.js index d1a9a7e..544f2d9 100644 --- a/tests/testaudience.js +++ b/tests/testaudience.js @@ -3,7 +3,7 @@ * Success criterias: * - each element from (nodes) array should exist; * - content of the array element should exist and match the PATTERN; - * - content of the array element can't be equal to 'N/A'. + * - content of the array element can not be equal to 'N/A'. * @see http://google.github.io/styleguide/javascriptguide.xml * @see http://developers.google.com/closure/compiler/docs/js-for-compiler */ From 9d66df440f4355125a2d82c552d36882ac244278 Mon Sep 17 00:00:00 2001 From: Myhailo Date: Wed, 29 Jun 2016 10:01:11 +0300 Subject: [PATCH 03/24] audince test update --- tests/testaudience.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/testaudience.js b/tests/testaudience.js index 544f2d9..bd33f18 100644 --- a/tests/testaudience.js +++ b/tests/testaudience.js @@ -1,9 +1,9 @@ /** * @fileoverview Defines tests for audience engagement. * Success criterias: - * - each element from (nodes) array should exist; - * - content of the array element should exist and match the PATTERN; - * - content of the array element can not be equal to 'N/A'. + * - Each element from (nodes) array should exist; + * - Content of the array element should exist and match the (PATTERN); + * - Content of the array element can't be equal to 'N/A'. * @see http://google.github.io/styleguide/javascriptguide.xml * @see http://developers.google.com/closure/compiler/docs/js-for-compiler */ From 69130e89a2a68822e8de2b484facea113243ebd5 Mon Sep 17 00:00:00 2001 From: Roman Date: Wed, 29 Jun 2016 18:10:25 +0300 Subject: [PATCH 04/24] reworked --- tests/testaudience.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/testaudience.js b/tests/testaudience.js index bd33f18..74c1839 100644 --- a/tests/testaudience.js +++ b/tests/testaudience.js @@ -28,6 +28,7 @@ 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; @@ -35,11 +36,10 @@ function testAudience() { element = document.getElementById(nodes[--length]); content = element && element.textContent.trim(); - if (!content || !(PATTERN.test(content) || 'N/A' == content)) { - return true; + if (content && PATTERN.test(content) && content !== 'N/A') { + return result; } } - return false; } From 83fa5d40e0e559ac90db8fe55c2fb5116081635f Mon Sep 17 00:00:00 2001 From: Roman Date: Thu, 30 Jun 2016 13:42:55 +0300 Subject: [PATCH 05/24] fixed --- tests/testaudience.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/testaudience.js b/tests/testaudience.js index 74c1839..8399cbb 100644 --- a/tests/testaudience.js +++ b/tests/testaudience.js @@ -13,7 +13,7 @@ /** - * @return {boolean} Returns "true" if test failed. + * @return {boolean} Returns "false" if test passed. */ function testAudience() { /** @type {!Array.} */ var nodes = [ From 2cd2d101da364603aaf418a7bcf557011194e49b Mon Sep 17 00:00:00 2001 From: Roman Date: Thu, 30 Jun 2016 14:28:50 +0300 Subject: [PATCH 06/24] reworked --- tests/testaudience.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/testaudience.js b/tests/testaudience.js index 8399cbb..3c5b7b2 100644 --- a/tests/testaudience.js +++ b/tests/testaudience.js @@ -13,7 +13,7 @@ /** - * @return {boolean} Returns "false" if test passed. + * @return {boolean} Returns "true" if test failed. */ function testAudience() { /** @type {!Array.} */ var nodes = [ @@ -28,7 +28,7 @@ function testAudience() { 'audience-engagement-bounce-rate-delta' ]; /** @type {number} */ var length = nodes.length; - /** @type {boolean} */ var result = false; + /** @type {boolean} */ var result = true; /** @type {Element} */ var element; /** @type {string} */ var content; @@ -37,9 +37,10 @@ function testAudience() { content = element && element.textContent.trim(); if (content && PATTERN.test(content) && content !== 'N/A') { - return result; + result = false; } } + return result; } From 4ef890efe184fde26e04141bbe2d214d2467cff1 Mon Sep 17 00:00:00 2001 From: Roman Date: Thu, 30 Jun 2016 16:20:29 +0300 Subject: [PATCH 07/24] fixed --- tests/testaudience.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/testaudience.js b/tests/testaudience.js index 3c5b7b2..6579387 100644 --- a/tests/testaudience.js +++ b/tests/testaudience.js @@ -28,7 +28,7 @@ function testAudience() { 'audience-engagement-bounce-rate-delta' ]; /** @type {number} */ var length = nodes.length; - /** @type {boolean} */ var result = true; + /** @type {boolean} */ var result = false; /** @type {Element} */ var element; /** @type {string} */ var content; @@ -36,8 +36,9 @@ function testAudience() { element = document.getElementById(nodes[--length]); content = element && element.textContent.trim(); - if (content && PATTERN.test(content) && content !== 'N/A') { - result = false; + if (!content || !PATTERN.test(content) || content == 'N/A') { + result = true; + break; } } return result; From 49ea4bb74357e74c491c5ac69d5399750c6b4304 Mon Sep 17 00:00:00 2001 From: Roman Date: Thu, 30 Jun 2016 17:19:57 +0300 Subject: [PATCH 08/24] fixed --- tests/testaudience.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/testaudience.js b/tests/testaudience.js index 6579387..ca99169 100644 --- a/tests/testaudience.js +++ b/tests/testaudience.js @@ -36,7 +36,7 @@ function testAudience() { element = document.getElementById(nodes[--length]); content = element && element.textContent.trim(); - if (!content || !PATTERN.test(content) || content == 'N/A') { + if (!content || !(PATTERN.test(content) || 'N/A' == content)) { result = true; break; } From df0b4a185e4baa977df5c67e67c0bfb43f6d8029 Mon Sep 17 00:00:00 2001 From: Roman Date: Thu, 7 Jul 2016 10:30:46 +0300 Subject: [PATCH 09/24] reworked description to the audience test --- tests/testaudience.js | 55 +++++++++++++++++++++++++++++++++++++++---- 1 file changed, 51 insertions(+), 4 deletions(-) diff --git a/tests/testaudience.js b/tests/testaudience.js index ca99169..a62107b 100644 --- a/tests/testaudience.js +++ b/tests/testaudience.js @@ -1,9 +1,35 @@ /** - * @fileoverview Defines tests for audience engagement. + * @fileoverview Defines test for Audience engagement. * Success criterias: - * - Each element from (nodes) array should exist; - * - Content of the array element should exist and match the (PATTERN); - * - Content of the array element can't be equal to 'N/A'. + * - Elements with ID 'audience-engagement-visitors-value', + * 'audience-engagement-pageviews-value', + * 'audience-engagement-pageviews-delta', + * 'audience-engagement-time-on-site-value', + * 'audience-engagement-time-on-site-delta', + * 'audience-engagement-search-visits-value', + * 'audience-engagement-search-visits-delta', + * 'audience-engagement-bounce-rate-value', + * 'audience-engagement-bounce-rate-delta' should exist should exist; + * - Elements with ID 'audience-engagement-visitors-value', + * 'audience-engagement-pageviews-value', + * 'audience-engagement-pageviews-delta', + * 'audience-engagement-time-on-site-value', + * 'audience-engagement-time-on-site-delta', + * 'audience-engagement-search-visits-value', + * 'audience-engagement-search-visits-delta', + * 'audience-engagement-bounce-rate-value', + * 'audience-engagement-bounce-rate-delta' should contain content and + * format of it should be the 'Number dot Number and %' or + * 'Number and %' or 'Number : Number' or 'Number'; + * - Content of elements with ID 'audience-engagement-visitors-value', + * 'audience-engagement-pageviews-value', + * 'audience-engagement-pageviews-delta', + * 'audience-engagement-time-on-site-value', + * 'audience-engagement-time-on-site-delta', + * 'audience-engagement-search-visits-value', + * 'audience-engagement-search-visits-delta', + * 'audience-engagement-bounce-rate-value', + * 'audience-engagement-bounce-rate-delta' can't be equal to 'N/A'. * @see http://google.github.io/styleguide/javascriptguide.xml * @see http://developers.google.com/closure/compiler/docs/js-for-compiler */ @@ -16,6 +42,15 @@ * @return {boolean} Returns "true" if test failed. */ function testAudience() { + // Elements with ID 'audience-engagement-visitors-value', + // 'audience-engagement-pageviews-value', + // 'audience-engagement-pageviews-delta', + // 'audience-engagement-time-on-site-value', + // 'audience-engagement-time-on-site-delta', + // 'audience-engagement-search-visits-value', + // 'audience-engagement-search-visits-delta', + // 'audience-engagement-bounce-rate-value', + // 'audience-engagement-bounce-rate-delta' should exist should exist. /** @type {!Array.} */ var nodes = [ 'audience-engagement-visitors-value', 'audience-engagement-pageviews-value', @@ -36,6 +71,18 @@ function testAudience() { element = document.getElementById(nodes[--length]); content = element && element.textContent.trim(); + // Elements with ID 'audience-engagement-visitors-value', + // 'audience-engagement-pageviews-value', + // 'audience-engagement-pageviews-delta', + // 'audience-engagement-time-on-site-value', + // 'audience-engagement-time-on-site-delta', + // 'audience-engagement-search-visits-value', + // 'audience-engagement-search-visits-delta', + // 'audience-engagement-bounce-rate-value', + // 'audience-engagement-bounce-rate-delta' should contain content and + // format of it should be the 'Number dot Number and %' or + // 'Number and %' or 'Number : Number' or 'Number'; + // Content can't be equal to 'N/A'. if (!content || !(PATTERN.test(content) || 'N/A' == content)) { result = true; break; From 655b2d10954bcfed0f74185439ded2b02e18a388 Mon Sep 17 00:00:00 2001 From: Roman Date: Thu, 7 Jul 2016 11:02:15 +0300 Subject: [PATCH 10/24] fixed --- tests/testaudience.js | 18 +++++++++--------- tests/testmediaqueries.js | 5 +++-- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/tests/testaudience.js b/tests/testaudience.js index a62107b..01ed38c 100644 --- a/tests/testaudience.js +++ b/tests/testaudience.js @@ -1,6 +1,6 @@ /** * @fileoverview Defines test for Audience engagement. - * Success criterias: + * Success criteria: * - Elements with ID 'audience-engagement-visitors-value', * 'audience-engagement-pageviews-value', * 'audience-engagement-pageviews-delta', @@ -9,7 +9,7 @@ * 'audience-engagement-search-visits-value', * 'audience-engagement-search-visits-delta', * 'audience-engagement-bounce-rate-value', - * 'audience-engagement-bounce-rate-delta' should exist should exist; + * 'audience-engagement-bounce-rate-delta' should exist; * - Elements with ID 'audience-engagement-visitors-value', * 'audience-engagement-pageviews-value', * 'audience-engagement-pageviews-delta', @@ -19,8 +19,8 @@ * 'audience-engagement-search-visits-delta', * 'audience-engagement-bounce-rate-value', * 'audience-engagement-bounce-rate-delta' should contain content and - * format of it should be the 'Number dot Number and %' or - * 'Number and %' or 'Number : Number' or 'Number'; + * the format should adhere to the following examples: 10.1% or 10% or + * 10:1 or 10”; * - Content of elements with ID 'audience-engagement-visitors-value', * 'audience-engagement-pageviews-value', * 'audience-engagement-pageviews-delta', @@ -29,7 +29,7 @@ * 'audience-engagement-search-visits-value', * 'audience-engagement-search-visits-delta', * 'audience-engagement-bounce-rate-value', - * 'audience-engagement-bounce-rate-delta' can't be equal to 'N/A'. + * 'audience-engagement-bounce-rate-delta' can't equal 'N/A'. * @see http://google.github.io/styleguide/javascriptguide.xml * @see http://developers.google.com/closure/compiler/docs/js-for-compiler */ @@ -50,7 +50,7 @@ function testAudience() { // 'audience-engagement-search-visits-value', // 'audience-engagement-search-visits-delta', // 'audience-engagement-bounce-rate-value', - // 'audience-engagement-bounce-rate-delta' should exist should exist. + // 'audience-engagement-bounce-rate-delta' should exist. /** @type {!Array.} */ var nodes = [ 'audience-engagement-visitors-value', 'audience-engagement-pageviews-value', @@ -80,9 +80,9 @@ function testAudience() { // 'audience-engagement-search-visits-delta', // 'audience-engagement-bounce-rate-value', // 'audience-engagement-bounce-rate-delta' should contain content and - // format of it should be the 'Number dot Number and %' or - // 'Number and %' or 'Number : Number' or 'Number'; - // Content can't be equal to 'N/A'. + // the format should adhere to the following examples: 10.1% or 10% or + // 10:1 or 10”; + // Content can't can't equal 'N/A'. if (!content || !(PATTERN.test(content) || 'N/A' == content)) { result = true; break; diff --git a/tests/testmediaqueries.js b/tests/testmediaqueries.js index d729d2b..8c1f0c5 100644 --- a/tests/testmediaqueries.js +++ b/tests/testmediaqueries.js @@ -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'. From c4baff70e23a88a074297fa380e961eaa1563080 Mon Sep 17 00:00:00 2001 From: Roman Date: Mon, 11 Jul 2016 13:44:19 +0300 Subject: [PATCH 11/24] rewrote success criteria --- tests/testaudience.js | 58 ++++++++----------------------------------- 1 file changed, 10 insertions(+), 48 deletions(-) diff --git a/tests/testaudience.js b/tests/testaudience.js index 01ed38c..9834191 100644 --- a/tests/testaudience.js +++ b/tests/testaudience.js @@ -1,35 +1,12 @@ /** * @fileoverview Defines test for Audience engagement. * Success criteria: - * - Elements with ID 'audience-engagement-visitors-value', - * 'audience-engagement-pageviews-value', - * 'audience-engagement-pageviews-delta', - * 'audience-engagement-time-on-site-value', - * 'audience-engagement-time-on-site-delta', - * 'audience-engagement-search-visits-value', - * 'audience-engagement-search-visits-delta', - * 'audience-engagement-bounce-rate-value', - * 'audience-engagement-bounce-rate-delta' should exist; - * - Elements with ID 'audience-engagement-visitors-value', - * 'audience-engagement-pageviews-value', - * 'audience-engagement-pageviews-delta', - * 'audience-engagement-time-on-site-value', - * 'audience-engagement-time-on-site-delta', - * 'audience-engagement-search-visits-value', - * 'audience-engagement-search-visits-delta', - * 'audience-engagement-bounce-rate-value', - * 'audience-engagement-bounce-rate-delta' should contain content and + * - Elements with ID prefix 'audience-engagement-‘ should exist; + * - Elements with ID prefix 'audience-engagement-‘ should contain content and * the format should adhere to the following examples: 10.1% or 10% or * 10:1 or 10”; - * - Content of elements with ID 'audience-engagement-visitors-value', - * 'audience-engagement-pageviews-value', - * 'audience-engagement-pageviews-delta', - * 'audience-engagement-time-on-site-value', - * 'audience-engagement-time-on-site-delta', - * 'audience-engagement-search-visits-value', - * 'audience-engagement-search-visits-delta', - * 'audience-engagement-bounce-rate-value', - * 'audience-engagement-bounce-rate-delta' can't equal 'N/A'. + * - Content of elements with ID prefix 'audience-engagement-‘ can't + * equal 'N/A'. * @see http://google.github.io/styleguide/javascriptguide.xml * @see http://developers.google.com/closure/compiler/docs/js-for-compiler */ @@ -42,15 +19,7 @@ * @return {boolean} Returns "true" if test failed. */ function testAudience() { - // Elements with ID 'audience-engagement-visitors-value', - // 'audience-engagement-pageviews-value', - // 'audience-engagement-pageviews-delta', - // 'audience-engagement-time-on-site-value', - // 'audience-engagement-time-on-site-delta', - // 'audience-engagement-search-visits-value', - // 'audience-engagement-search-visits-delta', - // 'audience-engagement-bounce-rate-value', - // 'audience-engagement-bounce-rate-delta' should exist. + // Elements with ID prefix 'audience-engagement-‘ should exist. /** @type {!Array.} */ var nodes = [ 'audience-engagement-visitors-value', 'audience-engagement-pageviews-value', @@ -71,18 +40,11 @@ function testAudience() { element = document.getElementById(nodes[--length]); content = element && element.textContent.trim(); - // Elements with ID 'audience-engagement-visitors-value', - // 'audience-engagement-pageviews-value', - // 'audience-engagement-pageviews-delta', - // 'audience-engagement-time-on-site-value', - // 'audience-engagement-time-on-site-delta', - // 'audience-engagement-search-visits-value', - // 'audience-engagement-search-visits-delta', - // 'audience-engagement-bounce-rate-value', - // 'audience-engagement-bounce-rate-delta' should contain content and - // the format should adhere to the following examples: 10.1% or 10% or - // 10:1 or 10”; - // Content can't can't equal 'N/A'. + // Elements with ID prefix 'audience-engagement-‘ should contain content and + // the format should adhere to the following examples: 10.1% or 10% or + // 10:1 or 10” + // Content of elements with ID prefix 'audience-engagement-‘ can't + // equal 'N/A'. if (!content || !(PATTERN.test(content) || 'N/A' == content)) { result = true; break; From e412644b210b5c046a52b6468500e11c5ea4acbd Mon Sep 17 00:00:00 2001 From: Roman Date: Mon, 11 Jul 2016 14:11:46 +0300 Subject: [PATCH 12/24] reworked --- tests/testmediaqueries.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/testmediaqueries.js b/tests/testmediaqueries.js index 8c1f0c5..8aad35a 100644 --- a/tests/testmediaqueries.js +++ b/tests/testmediaqueries.js @@ -28,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 From bde7ac645f345bfadeaa42298d3030f43ee9aaef Mon Sep 17 00:00:00 2001 From: Roman Date: Wed, 13 Jul 2016 12:32:58 +0300 Subject: [PATCH 13/24] fixed comments --- tests/testaudience.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/testaudience.js b/tests/testaudience.js index 9834191..db7ccf2 100644 --- a/tests/testaudience.js +++ b/tests/testaudience.js @@ -4,7 +4,7 @@ * - Elements with ID prefix 'audience-engagement-‘ should exist; * - Elements with ID prefix 'audience-engagement-‘ should contain content and * the format should adhere to the following examples: 10.1% or 10% or - * 10:1 or 10”; + * 10:1 or 10; * - Content of elements with ID prefix 'audience-engagement-‘ can't * equal 'N/A'. * @see http://google.github.io/styleguide/javascriptguide.xml @@ -42,7 +42,7 @@ function testAudience() { // Elements with ID prefix 'audience-engagement-‘ should contain content and // the format should adhere to the following examples: 10.1% or 10% or - // 10:1 or 10” + // 10:1 or 10; // Content of elements with ID prefix 'audience-engagement-‘ can't // equal 'N/A'. if (!content || !(PATTERN.test(content) || 'N/A' == content)) { From f09d0711e473d962abccd00e3b726b68a652bf33 Mon Sep 17 00:00:00 2001 From: Roman Date: Wed, 13 Jul 2016 12:40:59 +0300 Subject: [PATCH 14/24] reworked --- tests/testaudience.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/testaudience.js b/tests/testaudience.js index db7ccf2..f0d2c71 100644 --- a/tests/testaudience.js +++ b/tests/testaudience.js @@ -40,8 +40,8 @@ function testAudience() { element = document.getElementById(nodes[--length]); content = element && element.textContent.trim(); - // Elements with ID prefix 'audience-engagement-‘ should contain content and - // the format should adhere to the following examples: 10.1% or 10% or + // Elements with ID prefix 'audience-engagement-‘ should contain content + // and the format should adhere to the following examples: 10.1% or 10% or // 10:1 or 10; // Content of elements with ID prefix 'audience-engagement-‘ can't // equal 'N/A'. From 8e112a7c028d9777bded1a14ab749246263dbbb2 Mon Sep 17 00:00:00 2001 From: Roman Date: Thu, 14 Jul 2016 11:32:29 +0300 Subject: [PATCH 15/24] fixed comments --- tests/testaudience.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/testaudience.js b/tests/testaudience.js index f0d2c71..66d9180 100644 --- a/tests/testaudience.js +++ b/tests/testaudience.js @@ -5,8 +5,8 @@ * - Elements with ID prefix 'audience-engagement-‘ should contain content and * the format should adhere to the following examples: 10.1% or 10% or * 10:1 or 10; - * - Content of elements with ID prefix 'audience-engagement-‘ can't - * equal 'N/A'. + * - If in elements with ID prefix 'audience-engagement-‘ isn't data, + * content should be equal 'N/A'. * @see http://google.github.io/styleguide/javascriptguide.xml * @see http://developers.google.com/closure/compiler/docs/js-for-compiler */ @@ -43,9 +43,9 @@ function testAudience() { // Elements with ID prefix 'audience-engagement-‘ should contain content // and the format should adhere to the following examples: 10.1% or 10% or // 10:1 or 10; - // Content of elements with ID prefix 'audience-engagement-‘ can't - // equal 'N/A'. - if (!content || !(PATTERN.test(content) || 'N/A' == content)) { + // If in elements with ID prefix 'audience-engagement-‘ isn't data, + // content should be equal 'N/A' + if (!(content && (PATTERN.test(content) || 'N/A' == content))) { result = true; break; } From 78aa65a03d310d80acb1c28c8cf6020b37951e98 Mon Sep 17 00:00:00 2001 From: Roman Date: Thu, 14 Jul 2016 12:37:52 +0300 Subject: [PATCH 16/24] fixed comments --- tests/testaudience.js | 13 +++++++------ tests/testwebfiles.js | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/tests/testaudience.js b/tests/testaudience.js index 66d9180..37ecf64 100644 --- a/tests/testaudience.js +++ b/tests/testaudience.js @@ -5,8 +5,8 @@ * - Elements with ID prefix 'audience-engagement-‘ should contain content and * the format should adhere to the following examples: 10.1% or 10% or * 10:1 or 10; - * - If in elements with ID prefix 'audience-engagement-‘ isn't data, - * content should be equal 'N/A'. + * - If in elements with ID prefix 'audience-engagement-‘ isn't data, + * content should be equal 'N/A' or '-'. * @see http://google.github.io/styleguide/javascriptguide.xml * @see http://developers.google.com/closure/compiler/docs/js-for-compiler */ @@ -40,12 +40,13 @@ function testAudience() { element = document.getElementById(nodes[--length]); content = element && element.textContent.trim(); - // Elements with ID prefix 'audience-engagement-‘ should contain content + // Elements with ID prefix 'audience-engagement-‘ should contain content // and the format should adhere to the following examples: 10.1% or 10% or // 10:1 or 10; - // If in elements with ID prefix 'audience-engagement-‘ isn't data, - // content should be equal 'N/A' - if (!(content && (PATTERN.test(content) || 'N/A' == content))) { + // If in elements with ID prefix 'audience-engagement-‘ isn't data, + // content should be equal 'N/A' or '-'. + if (!(content && (PATTERN.test(content) || 'N/A' == content || + '-' == content))) { result = true; break; } diff --git a/tests/testwebfiles.js b/tests/testwebfiles.js index df0a258..a428a5b 100644 --- a/tests/testwebfiles.js +++ b/tests/testwebfiles.js @@ -2,7 +2,7 @@ * @fileoverview Defines test for Web files. * Success criteria: * - Element with ID 'webfiles-container' should exist; - * - Element with ID 'webfiles-container' should contain elements with tag + * - Element with ID 'webfiles-container' should contain elements with tag * name 'h4'; * - In element with tag name 'h4' should be one of the next HTTP status code: * 0, 100, 101, 102, 200, 201, 202, 203, 204, 205, 206, 207, 208, 226, 300, From ece8964ce2842b58d8ecbda8a42bdb2417d6cd89 Mon Sep 17 00:00:00 2001 From: Roman Date: Fri, 15 Jul 2016 12:07:44 +0300 Subject: [PATCH 17/24] fixed --- tests/testaudience.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/testaudience.js b/tests/testaudience.js index 37ecf64..4aa4ca3 100644 --- a/tests/testaudience.js +++ b/tests/testaudience.js @@ -41,8 +41,8 @@ function testAudience() { content = element && element.textContent.trim(); // Elements with ID prefix 'audience-engagement-‘ should contain content - // and the format should adhere to the following examples: 10.1% or 10% or - // 10:1 or 10; + // and the format should adhere to the following examples: 10.1% or + // 10% or 10:1 or 10; // If in elements with ID prefix 'audience-engagement-‘ isn't data, // content should be equal 'N/A' or '-'. if (!(content && (PATTERN.test(content) || 'N/A' == content || From 40a23e9bfd604b19d6349c3781f396877e4718c7 Mon Sep 17 00:00:00 2001 From: Roman Date: Fri, 15 Jul 2016 16:03:23 +0300 Subject: [PATCH 18/24] reworked --- tests/testaudience.js | 10 +++++----- tests/testtags.js | 4 ++-- tests/testtechnologyextractor.js | 8 ++++---- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/tests/testaudience.js b/tests/testaudience.js index 4aa4ca3..223686f 100644 --- a/tests/testaudience.js +++ b/tests/testaudience.js @@ -5,8 +5,8 @@ * - Elements with ID prefix 'audience-engagement-‘ should contain content and * the format should adhere to the following examples: 10.1% or 10% or * 10:1 or 10; - * - If in elements with ID prefix 'audience-engagement-‘ isn't data, - * content should be equal 'N/A' or '-'. + * - If element with ID prefix 'audience-engagement-‘ is empty, then + * it's content should be equal 'N/A' or '-'. * @see http://google.github.io/styleguide/javascriptguide.xml * @see http://developers.google.com/closure/compiler/docs/js-for-compiler */ @@ -41,10 +41,10 @@ function testAudience() { content = element && element.textContent.trim(); // Elements with ID prefix 'audience-engagement-‘ should contain content - // and the format should adhere to the following examples: 10.1% or + // and the format should adhere to the following examples: 10.1% or // 10% or 10:1 or 10; - // If in elements with ID prefix 'audience-engagement-‘ isn't data, - // content should be equal 'N/A' or '-'. + // If element with ID prefix 'audience-engagement-‘ is empty, then + // it's content should be equal 'N/A' or '-'. if (!(content && (PATTERN.test(content) || 'N/A' == content || '-' == content))) { result = true; diff --git a/tests/testtags.js b/tests/testtags.js index 5faf49a..166fea7 100644 --- a/tests/testtags.js +++ b/tests/testtags.js @@ -15,7 +15,7 @@ * contain element with CSS classes 'rule not' and shouldn't contain * element with CSS classes 'rule not true'; * - If element with CSS class 'widget-deprecated-tags' isn't empty, - * elements with tag name 'tr' should contain elements with tag name 'th' + * elements with tag name 'tr' should contain elements with tag name 'th' * and 'td'; * - In element with tag name 'tr' first element should contain string, * second element should contain number. @@ -69,7 +69,7 @@ function testTags() { for (; length;) { result = !result; // If element with CSS class 'widget-deprecated-tags' isn't empty, - // elements with tag name 'tr' should contain elements with + // elements with tag name 'tr' should contain elements with // tag name 'th' and 'td'. cells = nodes[--length].querySelectorAll('th, td'); number = cells[1].textContent.trim(); diff --git a/tests/testtechnologyextractor.js b/tests/testtechnologyextractor.js index a83de99..38354c4 100644 --- a/tests/testtechnologyextractor.js +++ b/tests/testtechnologyextractor.js @@ -5,7 +5,7 @@ * - Element with CSS class 'widget-technologies' should contain element with * ID 'technology-data-table'; * - If element with CSS class 'widget-technologies' is not empty it should - * contain element with CSS class 'rule' and it shouldn't contain element + * contain element with CSS class 'rule' and it shouldn't contain element * with CSS class 'true'; * - If element with CSS class 'widget-technologies' is empty it should contain * element with CSS classes 'rule true'; @@ -39,12 +39,12 @@ function testTechnologyExtractor() { /** @type {Element} */ var table = document.getElementById(TABLE_ID); - // If element with CSS class 'widget-technologies' is empty it should + // If element with CSS class 'widget-technologies' is empty it should // contain element with CSS classes 'rule true'. - /** @type {boolean} */ + /** @type {boolean} */ var result = element && !element.querySelector(FAIL_SELECTOR); - // If element with CSS class 'widget-technologies' is not empty, element + // If element with CSS class 'widget-technologies' is not empty, element // with ID 'technology-data-table' should contain elements with tag name 'tr'. /** @type {NodeList} */ var elements = element && element.getElementsByTagName('tr'); From 2e021a477261a600954a3a47f93760a4f15b63ec Mon Sep 17 00:00:00 2001 From: Roman Date: Fri, 15 Jul 2016 17:09:04 +0300 Subject: [PATCH 19/24] reworked success criteria --- tests/testaudience.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/testaudience.js b/tests/testaudience.js index 223686f..36e3265 100644 --- a/tests/testaudience.js +++ b/tests/testaudience.js @@ -6,7 +6,7 @@ * the format should adhere to the following examples: 10.1% or 10% or * 10:1 or 10; * - If element with ID prefix 'audience-engagement-‘ is empty, then - * it's content should be equal 'N/A' or '-'. + * it's content should equal 'N/A' or '-'. * @see http://google.github.io/styleguide/javascriptguide.xml * @see http://developers.google.com/closure/compiler/docs/js-for-compiler */ From 7a017d0af54b2c6870d9c536a3989a30a10f6342 Mon Sep 17 00:00:00 2001 From: Roman Date: Fri, 15 Jul 2016 17:26:02 +0300 Subject: [PATCH 20/24] reworked success criteria --- tests/testaudience.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/tests/testaudience.js b/tests/testaudience.js index 36e3265..0547e43 100644 --- a/tests/testaudience.js +++ b/tests/testaudience.js @@ -2,9 +2,9 @@ * @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 and - * the format should adhere to the following examples: 10.1% or 10% or - * 10:1 or 10; + * - 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 element with ID prefix 'audience-engagement-‘ is empty, then * it's content should equal 'N/A' or '-'. * @see http://google.github.io/styleguide/javascriptguide.xml @@ -41,10 +41,8 @@ function testAudience() { content = element && element.textContent.trim(); // Elements with ID prefix 'audience-engagement-‘ should contain content - // and the format should adhere to the following examples: 10.1% or - // 10% or 10:1 or 10; - // If element with ID prefix 'audience-engagement-‘ is empty, then - // it's content should be equal 'N/A' or '-'. + // 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; From a46d4b3988ab5467ac12cb527626485a334235f2 Mon Sep 17 00:00:00 2001 From: Roman Date: Mon, 18 Jul 2016 10:55:01 +0300 Subject: [PATCH 21/24] reworked --- tests/testaudience.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/testaudience.js b/tests/testaudience.js index 0547e43..7edafa4 100644 --- a/tests/testaudience.js +++ b/tests/testaudience.js @@ -2,8 +2,8 @@ * @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%', + * - 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 element with ID prefix 'audience-engagement-‘ is empty, then * it's content should equal 'N/A' or '-'. @@ -40,8 +40,8 @@ function testAudience() { element = document.getElementById(nodes[--length]); content = element && element.textContent.trim(); - // Elements with ID prefix 'audience-engagement-‘ should contain content - // equal 'N/A' or '-' or one of following string: '10.1%', '10%', + // 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))) { From c625d18a4ce767780274a44751cd20e64ba4ae46 Mon Sep 17 00:00:00 2001 From: Roman Date: Mon, 18 Jul 2016 16:07:00 +0300 Subject: [PATCH 22/24] fixed --- build/jstest.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/jstest.sh b/build/jstest.sh index 162eba2..b601597 100755 --- a/build/jstest.sh +++ b/build/jstest.sh @@ -32,7 +32,7 @@ readonly USER_AGENT="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit # function config() { echo "var page = require('webpage').create(); - var url = 'http://pageportrait.com/dev/portrait?url=${TEST_URL}&mode=test'; + var url = 'http://pageportrait.com/portrait?url=${TEST_URL}&mode=test'; var fs = require('fs'); var CWD = fs.workingDirectory; var TIMEOUT = 30; // in seconds From e41c63a8bd3875cc1d151204ec7b9aa477617af5 Mon Sep 17 00:00:00 2001 From: Roman Date: Mon, 18 Jul 2016 16:18:17 +0300 Subject: [PATCH 23/24] reworked test and merged with master --- tests/testaudience.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/testaudience.js b/tests/testaudience.js index 7edafa4..94697be 100644 --- a/tests/testaudience.js +++ b/tests/testaudience.js @@ -5,8 +5,6 @@ * - 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 element with ID prefix 'audience-engagement-‘ is empty, then - * it's content should equal 'N/A' or '-'. * @see http://google.github.io/styleguide/javascriptguide.xml * @see http://developers.google.com/closure/compiler/docs/js-for-compiler */ From 204648e8f40dccfdbe651aac183ade1e35f989a9 Mon Sep 17 00:00:00 2001 From: Roman Date: Mon, 18 Jul 2016 16:31:18 +0300 Subject: [PATCH 24/24] fixed --- tests/testaudience.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/testaudience.js b/tests/testaudience.js index 94697be..b0f62fc 100644 --- a/tests/testaudience.js +++ b/tests/testaudience.js @@ -2,8 +2,8 @@ * @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%', + * - 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 @@ -38,8 +38,8 @@ function testAudience() { element = document.getElementById(nodes[--length]); content = element && element.textContent.trim(); - // Elements with ID prefix 'audience-engagement-‘ should contain content - // equal 'N/A' or '-' or one of following string: '10.1%', '10%', + // 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))) {