Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Steur <thomas.steur@googlemail.com>2014-09-08 20:22:01 +0400
committerThomas Steur <thomas.steur@googlemail.com>2014-09-08 20:22:01 +0400
commit6f61d168125d7af036e8e0eb7b6b4d1e60b7242f (patch)
treebb554e2eb01ed63a03b2cece4a4023a26b765c69 /tests/javascript/content-fixtures
parent6bbcdd6e7482b95fe9ca461d32a7afa47d024338 (diff)
refs #4996 many new tests and bugfixes. Also fixed > 100 JSlint errors but still 4 or 5 errors I could not fix so far
Diffstat (limited to 'tests/javascript/content-fixtures')
-rw-r--r--tests/javascript/content-fixtures/trackerInternals.html64
-rw-r--r--tests/javascript/content-fixtures/visibleNodes.html50
2 files changed, 114 insertions, 0 deletions
diff --git a/tests/javascript/content-fixtures/trackerInternals.html b/tests/javascript/content-fixtures/trackerInternals.html
new file mode 100644
index 0000000000..acb35f4cc5
--- /dev/null
+++ b/tests/javascript/content-fixtures/trackerInternals.html
@@ -0,0 +1,64 @@
+<div id="ex101" data-track-content>
+ <a id="ignoreInteraction1" href="http://www.example.com"
+ class="piwikContentTarget piwikContentIgnoreInteraction">Link</a>
+</div>
+<div id="ex102" data-track-content data-content-ignoreinteraction>
+ <a id="ignoreInteraction2" href="http://www.example.com">Link</a>
+</div>
+<div id="ex103" data-track-content>
+ <a title="Target Title" href="http://target.example.com" data-content-target>Lorem ipsum dolor sit amet...</a>
+ <span id="notClickedTargetNode" title="Piece Title">Lorem ipsum dolor sit amet...</span>
+</div>
+<div id="ex104" data-track-content>
+ <img src="img.jpg" data-content-piece/>
+ <a id="ex104_inner" href="http://www.example.com">Link</a>
+</div>
+<div id="ex105" data-track-content>
+ <img src="img.jpg" data-content-piece/>
+ <a id="ex105_target" data-content-target="" href="http://www.example.com">
+ <span id="ex105_withinTarget">test</span>Link</a>
+</div>
+<!-- click event should be added to target node -->
+<div id="ex106" data-track-content data-content-name="My Ad">
+ <a id="ex106_target" href="/anylink" data-content-target>Add to shopping cart</a>
+</div>
+<!-- click event should be added to content block node which is target node -->
+<a id="ex107" data-track-content data-content-name="My Ad">
+ <img src="img.jpg" data-content-piece/>
+</a>
+<!-- trackContentImpressionClickInteraction, should be tracked as outlink -->
+<a id="ex108" href="http://ad.example.com" data-track-content>
+ <img src="http://www.example.com/path/xyz.jpg" data-content-piece />
+</a>
+<!-- trackContentImpressionClickInteraction, should be tracked as download -->
+<a id="ex109" href="/file.pdf" data-track-content>
+ <img src="http://www.example.com/path/xyz.jpg" data-content-piece />
+</a>
+<!-- trackContentImpressionClickInteraction, should be tracked using redirect as internal page link -->
+<a id="ex110" href="/example" data-track-content data-content-name="MyName">
+ <img src="http://www.example.com/path/xyz.jpg" data-content-piece="img.jpg" />
+</a>
+<!-- trackContentImpressionClickInteraction, if a link to tracker is already set we do not alter this link even if link is wrong -->
+<a id="ex111" href="piwik.php?xyz=makesnosense" data-track-content data-content-name="MyName">
+ <img src="http://www.example.com/path/xyz.jpg" data-content-piece="img.jpg" />
+</a>
+<!-- trackContentImpressionClickInteraction, should be tracked as XHR as link within same page -->
+<a id="ex112" href="#example" data-track-content>
+ <img src="http://www.example.com/path/xyz.jpg" data-content-piece="img.jpg" />
+</a>
+<!-- trackContentImpressionClickInteraction, target link is not an A or AREA element -->
+<div id="ex113" data-track-content>
+ <img id="ex113_target" src="http://www.example.com/path/xyz.jpg" data-content-target data-content-piece="img.jpg" />
+</div>
+<!-- trackContentImpressionClickInteraction, target link is link element but does not have href, we track it via xhr -->
+<a id="ex114" onclick="void 0" data-track-content data-content-target="/test">
+ <img src="http://www.example.com/path/xyz.jpg" data-content-piece="imgnohref.jpg" />
+</a>
+
+<!-- some nodes are visible, some not -->
+<a id="ex115" href="http://www.example.com" data-track-content class="assertSize">
+ <img src="img115.jpg" data-content-piece />
+</a>
+<a id="ex116_hidden" href="http://www.example.com" data-track-content class="assertSize" style="display:none">
+ <img src="img116.jpg" data-content-piece />
+</a> \ No newline at end of file
diff --git a/tests/javascript/content-fixtures/visibleNodes.html b/tests/javascript/content-fixtures/visibleNodes.html
new file mode 100644
index 0000000000..66b49badaa
--- /dev/null
+++ b/tests/javascript/content-fixtures/visibleNodes.html
@@ -0,0 +1,50 @@
+<div class="assertSize" id="ex1"></div> <!-- visible -->
+<div class="assertSize" id="ex2" style="opacity: 0"></div>
+<div class="assertSize" id="ex3" style="visibility: hidden"></div>
+<div class="assertSize" id="ex4" style="display: none"></div>
+<div class="assertSize" id="ex5" style="width: 0px;"></div>
+<div class="assertSize" id="ex6" style="height: 0px;"></div>
+<div class="assertSize" id="ex7" style="width: 0px;overflow: hidden;"></div>
+<div class="assertSize" id="ex8" style="height: 0px;overflow: hidden;"></div>
+
+<div id="ex9" style="margin-left: -110px;width: 50px;">Test</div>
+<div id="ex10" style="margin-left: 1000000px; width: 50px;">Test</div>
+
+<!-- The elements itself are visible but hidden by a parent -->
+<div class="assertSize" style="opacity: 0"><div class="assertSize" id="ex13"></div></div>
+<div class="assertSize" style="visibility: hidden"><div class="assertSize" id="ex14"></div></div>
+<div class="assertSize" style="display: none"><div class="assertSize" id="ex15"></div></div>
+<div class="assertSize" style="width: 0px;overflow: hidden;"><div class="assertSize" id="ex16"></div></div>
+<div class="assertSize" style="height: 0px;overflow: hidden;"><div class="assertSize" id="ex17"></div></div>
+
+<!-- at least one pixel has to be visible of the element -->
+<div id="ex18" style="margin-left: -118px;width: 110px;">Test</div>
+<div id="ex19" style="margin-left: -118px; width: 111px;">Test</div>
+
+<!-- positioned absolute -->
+<div id="ex20" style="height: 20px;width: 20px;position: absolute;left: 1px;top: -19px;"></div>
+<div id="ex21" style="height: 20px;width: 20px;position: absolute;left: -19px;top: 0px;"></div>
+<div id="ex22" style="height: 20px;width: 20px;position: absolute;right: -19px;top: 0px;"></div>
+<div id="ex23" style="height: 20px;width: 20px;position: absolute;left: 1px;bottom: -19px;"></div>
+
+<div id="ex24" style="height: 20px;width: 20px;position: absolute;left: 1px;top: -20px;"></div>
+<div id="ex25" style="height: 20px;width: 20px;position: absolute;left: -20px;top: 0px;"></div>
+<div id="ex26" style="height: 20px;width: 20px;position: absolute;right: -20px;top: 0px;"></div>
+<div id="ex27" style="height: 20px;width: 20px;position: absolute;left: 1px;bottom: -20px;"></div>
+
+<!-- positioned fixed -->
+<div id="ex28" style="height: 20px;width: 20px;position: fixed;left: 1px;top: -19px;"></div>
+<div id="ex29" style="height: 20px;width: 20px;position: fixed;left: -19px;top: 0px;"></div>
+<div id="ex30" style="height: 20px;width: 20px;position: fixed;right: -19px;top: 0px;"></div>
+<div id="ex31" style="height: 20px;width: 20px;position: fixed;left: 1px;bottom: -19px;"></div>
+
+<div id="ex32" style="height: 20px;width: 20px;position: fixed;left: 1px;top: -20px;"></div>
+<div id="ex33" style="height: 20px;width: 20px;position: fixed;left: -20px;top: 0px;"></div>
+<div id="ex34" style="height: 20px;width: 20px;position: fixed;right: -20px;top: 0px;"></div>
+<div id="ex35" style="height: 20px;width: 20px;position: fixed;left: 1px;bottom: -20px;"></div>
+
+<!-- nodes whose parent is scrollable -->
+<div class="assertSize" id="ex36" style="overflow: scroll;position: fixed;top:0px;left:0px;width:20px;height: 20px;">
+ <div class="assertSize" id="ex37" style="height:30px;"></div>
+ <div class="assertSize" id="ex38" style="height:5px;"></div>
+</div>