testcentricity_web 4.1.6 → 4.1.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (116) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/.rspec +2 -1
  4. data/.ruby-version +1 -0
  5. data/.simplecov +5 -1
  6. data/CHANGELOG.md +43 -0
  7. data/README.md +14 -13
  8. data/Rakefile +99 -21
  9. data/config/cucumber.yml +32 -11
  10. data/config/locales/en-US.yml +56 -0
  11. data/config/test_data/LOCAL_data.json +15 -0
  12. data/config/test_data/LOCAL_data.xls +0 -0
  13. data/config/test_data/LOCAL_data.yml +11 -0
  14. data/config/test_data/data.json +25 -0
  15. data/config/test_data/data.xls +0 -0
  16. data/config/test_data/data.yml +20 -0
  17. data/{docker-compose-v3.yml → docker-compose.yml} +2 -2
  18. data/features/basic_form_page_css.feature +54 -0
  19. data/features/basic_form_page_xpath.feature +26 -0
  20. data/features/custom_controls.feature +29 -0
  21. data/features/media_players.feature +67 -0
  22. data/features/step_definitions/generic_steps.rb.rb +87 -0
  23. data/features/step_definitions/media_steps.rb +30 -0
  24. data/features/support/data/form_data.rb +43 -0
  25. data/features/support/env.rb +18 -10
  26. data/features/support/hooks.rb +26 -1
  27. data/features/support/pages/base_test_page.rb +22 -0
  28. data/features/support/pages/{basic_css_test_page.rb → basic_css_form_page.rb} +12 -8
  29. data/features/support/pages/{basic_test_page.rb → basic_form_page.rb} +227 -36
  30. data/features/support/pages/{basic_xpath_test_page.rb → basic_xpath_form_page.rb} +12 -7
  31. data/features/support/pages/custom_controls_page.rb +263 -0
  32. data/features/support/pages/indexed_sections_page.rb +57 -0
  33. data/features/support/pages/media_test_page.rb +207 -0
  34. data/features/support/sections/header_nav.rb +48 -0
  35. data/features/support/sections/product_card.rb +39 -0
  36. data/features/support/world_data.rb +12 -0
  37. data/features/support/world_pages.rb +5 -2
  38. data/lib/testcentricity_web/appium_server.rb +5 -0
  39. data/lib/testcentricity_web/browser_helper.rb +0 -6
  40. data/lib/testcentricity_web/data_objects/data_objects_helper.rb +7 -0
  41. data/lib/testcentricity_web/data_objects/environment.rb +14 -0
  42. data/lib/testcentricity_web/data_objects/excel_helper.rb +60 -59
  43. data/lib/testcentricity_web/version.rb +1 -1
  44. data/lib/testcentricity_web/web_core/drag_drop_helper.rb +4 -0
  45. data/lib/testcentricity_web/web_core/page_object.rb +1 -8
  46. data/lib/testcentricity_web/web_core/page_objects_helper.rb +4 -2
  47. data/lib/testcentricity_web/web_core/page_section.rb +1 -1
  48. data/lib/testcentricity_web/web_core/webdriver_helper.rb +60 -44
  49. data/lib/testcentricity_web/web_elements/checkbox.rb +49 -19
  50. data/lib/testcentricity_web/web_elements/file_field.rb +9 -5
  51. data/lib/testcentricity_web/web_elements/image.rb +2 -1
  52. data/lib/testcentricity_web/web_elements/media.rb +46 -12
  53. data/lib/testcentricity_web/web_elements/radio.rb +51 -16
  54. data/lib/testcentricity_web/web_elements/select_list.rb +12 -12
  55. data/lib/testcentricity_web/web_elements/ui_elements_helper.rb +22 -9
  56. data/lib/testcentricity_web/web_elements/video.rb +2 -2
  57. data/spec/fixtures/page_object.rb +22 -0
  58. data/spec/fixtures/section_object.rb +21 -0
  59. data/spec/spec_helper.rb +31 -0
  60. data/spec/testcentricity_web/browser_spec.rb +41 -0
  61. data/spec/testcentricity_web/elements/audio_spec.rb +68 -0
  62. data/spec/testcentricity_web/elements/button_spec.rb +18 -0
  63. data/spec/testcentricity_web/elements/checkbox_spec.rb +33 -0
  64. data/spec/testcentricity_web/elements/file_field_spec.rb +13 -0
  65. data/spec/testcentricity_web/elements/image_spec.rb +33 -0
  66. data/spec/testcentricity_web/elements/label_spec.rb +18 -0
  67. data/spec/testcentricity_web/elements/link_spec.rb +23 -0
  68. data/spec/testcentricity_web/elements/list_spec.rb +13 -0
  69. data/spec/testcentricity_web/elements/radio_spec.rb +28 -0
  70. data/spec/testcentricity_web/elements/ui_element_spec.rb +125 -0
  71. data/spec/testcentricity_web/elements/video_spec.rb +68 -0
  72. data/spec/testcentricity_web/helper_specs/object_helpers_spec.rb +39 -0
  73. data/spec/testcentricity_web/helper_specs/string_helpers_spec.rb +49 -0
  74. data/spec/testcentricity_web/page_object_spec.rb +90 -0
  75. data/spec/testcentricity_web/section_object_spec.rb +72 -0
  76. data/spec/testcentricity_web/version_spec.rb +7 -0
  77. data/spec/testcentricity_web/webdriver_connect/grid_webdriver_spec.rb +72 -0
  78. data/spec/testcentricity_web/webdriver_connect/local_webdriver_spec.rb +86 -0
  79. data/spec/testcentricity_web/webdriver_connect/mobile_webdriver_spec.rb +65 -0
  80. data/test_site/basic_test_page.html +51 -1
  81. data/test_site/chosen-sprite.png +0 -0
  82. data/test_site/chosen-sprite@2x.png +0 -0
  83. data/test_site/chosen.css +496 -0
  84. data/test_site/chosen.jquery.js +1359 -0
  85. data/test_site/chosen.jquery.min.js +3 -0
  86. data/test_site/chosen.min.css +11 -0
  87. data/test_site/chosen.proto.js +1399 -0
  88. data/test_site/chosen.proto.min.js +3 -0
  89. data/test_site/composer.json +36 -0
  90. data/test_site/custom_controls_page.html +629 -0
  91. data/test_site/docsupport/chosen.png +0 -0
  92. data/test_site/docsupport/init.js +11 -0
  93. data/test_site/docsupport/init.proto.js +16 -0
  94. data/test_site/docsupport/jquery-1.12.4.min.js +5 -0
  95. data/test_site/docsupport/jquery-3.2.1.min.js +4 -0
  96. data/test_site/docsupport/oss-credit.png +0 -0
  97. data/test_site/docsupport/prism.css +108 -0
  98. data/test_site/docsupport/prism.js +9 -0
  99. data/test_site/docsupport/prototype-1.7.0.0.js +6082 -0
  100. data/test_site/docsupport/style.css +219 -0
  101. data/test_site/images/Blouse_Black.jpg +0 -0
  102. data/test_site/images/Printed_Dress.jpg +0 -0
  103. data/test_site/images/T-shirt.jpg +0 -0
  104. data/test_site/images/jeans3.jpg +0 -0
  105. data/test_site/indexed_sections_page.html +215 -0
  106. data/test_site/media/MIB2-subtitles-pt-BR.vtt +49 -0
  107. data/test_site/media/MIB2.mp4 +0 -0
  108. data/test_site/media/bbc_scotland_report.mp3 +0 -0
  109. data/test_site/media/count_and_bars.mp4 +0 -0
  110. data/test_site/media_page.html +60 -7
  111. data/testcentricity_web.gemspec +14 -8
  112. metadata +197 -25
  113. data/Gemfile.lock +0 -170
  114. data/features/basic_test_page_css.feature +0 -24
  115. data/features/basic_test_page_xpath.feature +0 -24
  116. data/features/support/pages/media_page.rb +0 -11
@@ -0,0 +1,108 @@
1
+ /**
2
+ * okaidia theme for JavaScript, CSS and HTML
3
+ * Loosely based on Monokai textmate theme by http://www.monokai.nl/
4
+ * @author ocodia
5
+ */
6
+
7
+ code[class*="language-"],
8
+ pre[class*="language-"] {
9
+ color: #f8f8f2;
10
+ text-shadow: 0 1px rgba(0,0,0,0.3);
11
+ font-family: Consolas, Monaco, 'Andale Mono', monospace;
12
+ direction: ltr;
13
+ text-align: left;
14
+ white-space: pre;
15
+ word-spacing: normal;
16
+
17
+ -moz-tab-size: 4;
18
+ -o-tab-size: 4;
19
+ tab-size: 4;
20
+
21
+ -webkit-hyphens: none;
22
+ -moz-hyphens: none;
23
+ -ms-hyphens: none;
24
+ hyphens: none;
25
+ }
26
+
27
+ /* Code blocks */
28
+ pre[class*="language-"] {
29
+ padding: 1em;
30
+ margin: .5em 0;
31
+ overflow: auto;
32
+ border-radius: 0.3em;
33
+ }
34
+
35
+ :not(pre) > code[class*="language-"],
36
+ pre[class*="language-"] {
37
+ background: #272822;
38
+ }
39
+
40
+ /* Inline code */
41
+ :not(pre) > code[class*="language-"] {
42
+ padding: .1em;
43
+ border-radius: .3em;
44
+ }
45
+
46
+ .token.comment,
47
+ .token.prolog,
48
+ .token.doctype,
49
+ .token.cdata {
50
+ color: slategray;
51
+ }
52
+
53
+ .token.punctuation {
54
+ color: #f8f8f2;
55
+ }
56
+
57
+ .namespace {
58
+ opacity: .7;
59
+ }
60
+
61
+ .token.property,
62
+ .token.tag {
63
+ color: #f92672;
64
+ }
65
+
66
+ .token.boolean,
67
+ .token.number{
68
+ color: #ae81ff;
69
+ }
70
+
71
+ .token.selector,
72
+ .token.attr-name,
73
+ .token.string {
74
+ color: #a6e22e;
75
+ }
76
+
77
+
78
+ .token.operator,
79
+ .token.entity,
80
+ .token.url,
81
+ .language-css .token.string,
82
+ .style .token.string {
83
+ color: #f8f8f2;
84
+ }
85
+
86
+ .token.atrule,
87
+ .token.attr-value
88
+ {
89
+ color: #e6db74;
90
+ }
91
+
92
+
93
+ .token.keyword{
94
+ color: #66d9ef;
95
+ }
96
+
97
+ .token.regex,
98
+ .token.important {
99
+ color: #fd971f;
100
+ }
101
+
102
+ .token.important {
103
+ font-weight: bold;
104
+ }
105
+
106
+ .token.entity {
107
+ cursor: help;
108
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Prism: Lightweight, robust, elegant syntax highlighting
3
+ * MIT license http://www.opensource.org/licenses/mit-license.php/
4
+ * @author Lea Verou http://lea.verou.me
5
+ */(function(){var e=/\blang(?:uage)?-(?!\*)(\w+)\b/i,t=self.Prism={util:{type:function(e){return Object.prototype.toString.call(e).match(/\[object (\w+)\]/)[1]},clone:function(e){var n=t.util.type(e);switch(n){case"Object":var r={};for(var i in e)e.hasOwnProperty(i)&&(r[i]=t.util.clone(e[i]));return r;case"Array":return e.slice()}return e}},languages:{extend:function(e,n){var r=t.util.clone(t.languages[e]);for(var i in n)r[i]=n[i];return r},insertBefore:function(e,n,r,i){i=i||t.languages;var s=i[e],o={};for(var u in s)if(s.hasOwnProperty(u)){if(u==n)for(var a in r)r.hasOwnProperty(a)&&(o[a]=r[a]);o[u]=s[u]}return i[e]=o},DFS:function(e,n){for(var r in e){n.call(e,r,e[r]);t.util.type(e)==="Object"&&t.languages.DFS(e[r],n)}}},highlightAll:function(e,n){var r=document.querySelectorAll('code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code');for(var i=0,s;s=r[i++];)t.highlightElement(s,e===!0,n)},highlightElement:function(r,i,s){var o,u,a=r;while(a&&!e.test(a.className))a=a.parentNode;if(a){o=(a.className.match(e)||[,""])[1];u=t.languages[o]}if(!u)return;r.className=r.className.replace(e,"").replace(/\s+/g," ")+" language-"+o;a=r.parentNode;/pre/i.test(a.nodeName)&&(a.className=a.className.replace(e,"").replace(/\s+/g," ")+" language-"+o);var f=r.textContent;if(!f)return;f=f.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ");var l={element:r,language:o,grammar:u,code:f};t.hooks.run("before-highlight",l);if(i&&self.Worker){var c=new Worker(t.filename);c.onmessage=function(e){l.highlightedCode=n.stringify(JSON.parse(e.data),o);t.hooks.run("before-insert",l);l.element.innerHTML=l.highlightedCode;s&&s.call(l.element);t.hooks.run("after-highlight",l)};c.postMessage(JSON.stringify({language:l.language,code:l.code}))}else{l.highlightedCode=t.highlight(l.code,l.grammar,l.language);t.hooks.run("before-insert",l);l.element.innerHTML=l.highlightedCode;s&&s.call(r);t.hooks.run("after-highlight",l)}},highlight:function(e,r,i){return n.stringify(t.tokenize(e,r),i)},tokenize:function(e,n,r){var i=t.Token,s=[e],o=n.rest;if(o){for(var u in o)n[u]=o[u];delete n.rest}e:for(var u in n){if(!n.hasOwnProperty(u)||!n[u])continue;var a=n[u],f=a.inside,l=!!a.lookbehind,c=0;a=a.pattern||a;for(var h=0;h<s.length;h++){var p=s[h];if(s.length>e.length)break e;if(p instanceof i)continue;a.lastIndex=0;var d=a.exec(p);if(d){l&&(c=d[1].length);var v=d.index-1+c,d=d[0].slice(c),m=d.length,g=v+m,y=p.slice(0,v+1),b=p.slice(g+1),w=[h,1];y&&w.push(y);var E=new i(u,f?t.tokenize(d,f):d);w.push(E);b&&w.push(b);Array.prototype.splice.apply(s,w)}}}return s},hooks:{all:{},add:function(e,n){var r=t.hooks.all;r[e]=r[e]||[];r[e].push(n)},run:function(e,n){var r=t.hooks.all[e];if(!r||!r.length)return;for(var i=0,s;s=r[i++];)s(n)}}},n=t.Token=function(e,t){this.type=e;this.content=t};n.stringify=function(e,r,i){if(typeof e=="string")return e;if(Object.prototype.toString.call(e)=="[object Array]")return e.map(function(t){return n.stringify(t,r,e)}).join("");var s={type:e.type,content:n.stringify(e.content,r,i),tag:"span",classes:["token",e.type],attributes:{},language:r,parent:i};s.type=="comment"&&(s.attributes.spellcheck="true");t.hooks.run("wrap",s);var o="";for(var u in s.attributes)o+=u+'="'+(s.attributes[u]||"")+'"';return"<"+s.tag+' class="'+s.classes.join(" ")+'" '+o+">"+s.content+"</"+s.tag+">"};if(!self.document){self.addEventListener("message",function(e){var n=JSON.parse(e.data),r=n.language,i=n.code;self.postMessage(JSON.stringify(t.tokenize(i,t.languages[r])));self.close()},!1);return}var r=document.getElementsByTagName("script");r=r[r.length-1];if(r){t.filename=r.src;document.addEventListener&&!r.hasAttribute("data-manual")&&document.addEventListener("DOMContentLoaded",t.highlightAll)}})();;
6
+ Prism.languages.markup={comment:/&lt;!--[\w\W]*?-->/g,prolog:/&lt;\?.+?\?>/,doctype:/&lt;!DOCTYPE.+?>/,cdata:/&lt;!\[CDATA\[[\w\W]*?]]>/i,tag:{pattern:/&lt;\/?[\w:-]+\s*(?:\s+[\w:-]+(?:=(?:("|')(\\?[\w\W])*?\1|\w+))?\s*)*\/?>/gi,inside:{tag:{pattern:/^&lt;\/?[\w:-]+/i,inside:{punctuation:/^&lt;\/?/,namespace:/^[\w-]+?:/}},"attr-value":{pattern:/=(?:('|")[\w\W]*?(\1)|[^\s>]+)/gi,inside:{punctuation:/=|>|"/g}},punctuation:/\/?>/g,"attr-name":{pattern:/[\w:-]+/g,inside:{namespace:/^[\w-]+?:/}}}},entity:/&amp;#?[\da-z]{1,8};/gi};Prism.hooks.add("wrap",function(e){e.type==="entity"&&(e.attributes.title=e.content.replace(/&amp;/,"&"))});;
7
+ Prism.languages.css={comment:/\/\*[\w\W]*?\*\//g,atrule:{pattern:/@[\w-]+?.*?(;|(?=\s*{))/gi,inside:{punctuation:/[;:]/g}},url:/url\((["']?).*?\1\)/gi,selector:/[^\{\}\s][^\{\};]*(?=\s*\{)/g,property:/(\b|\B)[\w-]+(?=\s*:)/ig,string:/("|')(\\?.)*?\1/g,important:/\B!important\b/gi,ignore:/&(lt|gt|amp);/gi,punctuation:/[\{\};:]/g};Prism.languages.markup&&Prism.languages.insertBefore("markup","tag",{style:{pattern:/(&lt;|<)style[\w\W]*?(>|&gt;)[\w\W]*?(&lt;|<)\/style(>|&gt;)/ig,inside:{tag:{pattern:/(&lt;|<)style[\w\W]*?(>|&gt;)|(&lt;|<)\/style(>|&gt;)/ig,inside:Prism.languages.markup.tag.inside},rest:Prism.languages.css}}});;
8
+ Prism.languages.clike={comment:{pattern:/(^|[^\\])(\/\*[\w\W]*?\*\/|(^|[^:])\/\/.*?(\r?\n|$))/g,lookbehind:!0},string:/("|')(\\?.)*?\1/g,"class-name":{pattern:/((?:(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[a-z0-9_\.\\]+/ig,lookbehind:!0,inside:{punctuation:/(\.|\\)/}},keyword:/\b(if|else|while|do|for|return|in|instanceof|function|new|try|catch|finally|null|break|continue)\b/g,"boolean":/\b(true|false)\b/g,"function":{pattern:/[a-z0-9_]+\(/ig,inside:{punctuation:/\(/}}, number:/\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?)\b/g,operator:/[-+]{1,2}|!|&lt;=?|>=?|={1,3}|(&amp;){1,2}|\|?\||\?|\*|\/|\~|\^|\%/g,ignore:/&(lt|gt|amp);/gi,punctuation:/[{}[\];(),.:]/g};;
9
+ Prism.languages.javascript=Prism.languages.extend("clike",{keyword:/\b(var|let|if|else|while|do|for|return|in|instanceof|function|new|with|typeof|try|catch|finally|null|break|continue)\b/g,number:/\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?|NaN|-?Infinity)\b/g});Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:/(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\r\n])+\/[gim]{0,3}(?=\s*($|[\r\n,.;})]))/g,lookbehind:!0}});Prism.languages.markup&&Prism.languages.insertBefore("markup","tag",{script:{pattern:/(&lt;|<)script[\w\W]*?(>|&gt;)[\w\W]*?(&lt;|<)\/script(>|&gt;)/ig,inside:{tag:{pattern:/(&lt;|<)script[\w\W]*?(>|&gt;)|(&lt;|<)\/script(>|&gt;)/ig,inside:Prism.languages.markup.tag.inside},rest:Prism.languages.javascript}}});;