kraken-mobile 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 399b50618849eced648c4b30c302d1e18f391dbe
4
- data.tar.gz: 5f5ab7721e8a6989e5a0c0a8f67c627cdf190f96
3
+ metadata.gz: bc931cd463cf275dd15848f6f5751461275b72c8
4
+ data.tar.gz: 83c25030dcf11cd2bd403b2f31b76948c73fea07
5
5
  SHA512:
6
- metadata.gz: 7ea770b4431e9c528ae6f86408b085ec2afaa99ae8809629d1c02b83060e94dca1aaa51e04e86347106226f3ea6220527023a9b87263e2cc94006d59127f962b
7
- data.tar.gz: cd9924ac842fbce5e3f0f482f215c4d539249c89d0432e5872db50c5764f7e2acbde99465f64f6fb829db25b89def174cdd52ab4f1507b4e5bd90327ec764757
6
+ metadata.gz: 99bf9ad2a91215798445e26e16fe0377bd8ba6dc0cea908166592c23819362444e082120562743663e299004df7918667cec8454ff375778b79f5e354b7fc5b5
7
+ data.tar.gz: e4d9af2856eef33da3d740a1cbf642492383490947a00bae2c765f13553efa863c8739fdd95bb571e38b279c456bf67cfd59238c0c69da27e7c7a872c848fb39
data/README.md CHANGED
@@ -1,7 +1,5 @@
1
1
  <p align="center">
2
- <a href="https://getbootstrap.com/">
3
- <img src="https://raw.githubusercontent.com/ravelinx22/KrakenMobile/master/reporter/assets/images/kraken.png" alt="Bootstrap logo" width="140" height="193">
4
- </a>
2
+ <img src="https://raw.githubusercontent.com/ravelinx22/KrakenMobile/master/reporter/assets/images/kraken.png" alt="kraken logo" width="140" height="193">
5
3
  </p>
6
4
 
7
5
  <h3 align="center">Kraken Mobile</h3>
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
  # encoding: utf-8
3
3
  module KrakenMobile
4
- VERSION = "1.0.1"
4
+ VERSION = "1.0.2"
5
5
  end
@@ -459,3 +459,23 @@ background-color: #E74C3C;
459
459
  padding: 50px 0;
460
460
  text-align: center;
461
461
  }
462
+
463
+ .step_title {
464
+ margin-bottom: 10px;
465
+ white-space:nowrap;
466
+ overflow-x: hidden;
467
+ text-overflow: ellipsis;
468
+ }
469
+
470
+ .step_title_icon {
471
+ margin-right: 5px;
472
+ }
473
+
474
+ .not_available {
475
+ text-align: center;
476
+ width: 100%;
477
+ }
478
+
479
+ .step_image {
480
+ cursor: pointer;
481
+ }
@@ -110,11 +110,21 @@
110
110
  return 10;
111
111
  })
112
112
  .style("fill", e)
113
+ .style("cursor", function(t) {
114
+ if(t.image) {
115
+ return "pointer";
116
+ } else {
117
+ return "default";
118
+ }
119
+ })
113
120
  .on("mouseover", function(t) {
114
121
  mouseover(t, i);
115
122
  }).on("mouseout", function(t) {
116
123
  mouseout(t, i);
117
124
  })
125
+ .on("click", function(t) {
126
+ click(t, i);
127
+ })
118
128
  },
119
129
  exit: function() {
120
130
  this.remove()
@@ -442,7 +452,7 @@ function mouseover(d, contexter) {
442
452
  computedHeight = boundingRect.height;
443
453
 
444
454
  let xPosition = d.x + margins.left + d.dx + 10;
445
- let yPosition = margins.top;
455
+ let yPosition = d.y + d.dy/2;
446
456
  let endXPosition = xPosition + computedWidth;
447
457
 
448
458
  if(endXPosition > width) {
@@ -457,38 +467,50 @@ function mouseover(d, contexter) {
457
467
  im.id = "scene" + d.id;
458
468
  im.src = "data:image/png;base64," + d.image
459
469
  im.onload = function(e) {
460
- var w = this.width;
461
- var h = this.height;
470
+ var h = 100;
462
471
  var ixPosition = d.x + margins.left + d.dx + 10; // 10 of separation from node
463
- var iyPosition = computedHeight + 10; // 10 of separation from label
464
- let endiXPosition = ixPosition + w;
465
- let endiYPosition = iyPosition + h;
466
-
467
- var i = 1
468
- while(w/i > 100 || h/i > 100) {
469
- i++;
470
- }
471
-
472
- h = h/i;
473
- w = w/i;
474
-
475
- endiXPosition = ixPosition + w;
476
- endiYPosition = iyPosition + h;
472
+ var iyPosition = d.y + d.dy/2 + 10; // 10 of separation from label
477
473
 
478
- if(endiXPosition > width) {
479
- ixPosition -= (endiXPosition-width)
480
- }
481
-
482
- contexter.base.append("image")
474
+ image = contexter.base.append("image")
483
475
  .data([this])
484
476
  .attr("x", ixPosition)
485
477
  .attr("y", iyPosition)
478
+ .attr("height", 100)
479
+ .attr("width", 50)
480
+ .style("width", "auto")
486
481
  .attr("xlink:href", this.src)
487
482
  .attr("transform", null)
488
483
  .attr("id", this.id)
489
484
  .attr("class", "scene-image")
490
- .attr("width", w)
491
- .attr("height", h)
485
+
486
+ imageBoundingRect = image.node().getBoundingClientRect();
487
+ computedImageWidth = imageBoundingRect.width;
488
+ computedImageHeight = imageBoundingRect.height;
489
+ let endImageXPosition = ixPosition + computedImageWidth;
490
+ let endImageYPosition = iyPosition + computedImageHeight;
491
+
492
+ if(endImageXPosition > width) {
493
+ ixPosition -= (endImageXPosition-width)
494
+ }
495
+
496
+ if(endImageYPosition > height + margins.bottom) {
497
+ iyPosition -= (endImageYPosition-(height+margins.bottom))
498
+ }
499
+
500
+ image.attr("x", ixPosition)
501
+ .attr("y", iyPosition);
502
+
503
+ text.attr("y", iyPosition - 10);
504
+
505
+ contexter.base.append('rect')
506
+ .attr('class', 'scene-image')
507
+ .attr('width', computedImageWidth)
508
+ .attr('height', computedImageHeight)
509
+ .attr('fill', 'transparent')
510
+ .attr('stroke', 'black')
511
+ .style('opacity', 0.25)
512
+ .attr("x", ixPosition)
513
+ .attr("y", iyPosition);
492
514
  }
493
515
  }
494
516
  }
@@ -497,6 +519,16 @@ function mouseout(d, svg) {
497
519
  d3.selectAll("[class=\"scene-image\"]").remove();
498
520
  }
499
521
 
522
+ function click(d, svg) {
523
+ if(d.image) {
524
+ var im = new Image();
525
+ im.src = "data:image/png;base64," + d.image
526
+ var w = window.open("",'_blank');
527
+ w.document.write(im.outerHTML);
528
+ w.document.close();
529
+ }
530
+ }
531
+
500
532
  function label(node) {
501
533
  return node.name.replace(/\s*\(.*?\)$/, '');
502
534
  }
@@ -643,7 +643,8 @@
643
643
  }
644
644
  devices = Array.from(devicesSet);
645
645
  // GRAPH
646
- var height = 150*(devices.length-1);
646
+ let devicesLength = devices.length > 1 ? (devices.length-1) : 1;
647
+ var height = 150*devicesLength;
647
648
  var c20c = d3.scale.category10();
648
649
  d3.select("#chart_row" + (i+1))
649
650
  .text(jsonObject["name"])
@@ -125,9 +125,42 @@
125
125
  </div>
126
126
  </div>
127
127
  </div>
128
- </div>
128
+ </div> <!-- Closes scenario row -->
129
+
130
+ <div class="row">
131
+ <div class="col-md-12 col-sm-12 col-xs-12">
132
+ <div class="x_panel" style="height: auto;">
133
+ <div class="x_title">
134
+ <h2>Screenshots</h2>
135
+ <div class="clearfix"></div>
136
+ </div>
137
+ <div class="x_content">
138
+ <div class="container">
139
+ <div class="row">
140
+ <% f["steps"].each do |s| %>
141
+ <div class="col-md-2">
142
+ <div class="step_title">
143
+ <i class="fa fa-arrow-right step_title_icon"></i>
144
+ <%= s["keyword"] %> <%= s["name"] %>
145
+ </div>
146
+ <% if(s["after"] && s["after"].count > 0 && s["after"].first["embeddings"] && s["after"].first["embeddings"].count > 0) %>
147
+ <% step_image = s["after"].first["embeddings"].first["data"] %>
148
+ <img src='<%= "data:image/png;base64,#{step_image}" %>' alt="" class="img-responsive step_image" onclick='<%= "openImageNewTab(\"#{step_image}\")" %>'>
149
+ <% else %>
150
+ <div class="not_available">
151
+ NO IMAGE AVAILABLE
152
+ </div>
153
+ <% end %>
154
+ </div>
155
+ <% end %>
156
+ </div>
157
+ </div>
158
+ </div>
159
+ </div>
160
+ </div>
161
+ </div> <!-- Closes screenshots row -->
162
+ <% end %>
129
163
  </div>
130
- <% end %>
131
164
 
132
165
  <script src="../../assets/js/jquery-3.2.1.min.js" ></script>
133
166
  <script src="../../assets/js/bootstrap.min.js"></script>
@@ -136,39 +169,48 @@
136
169
  <script src="../../assets/js/dataTables.responsive.min.js"></script>
137
170
  <script src="../../assets/js/Chart.min.js"></script>
138
171
  <script>
139
- $(document).ready(function () {
140
- passed_scenarios = parseInt("<%= passed_scenarios(@feature).count %>")
141
- failed_scenarios = parseInt("<%= failed_scenarios(@feature).count %>")
172
+ function openImageNewTab(imageData) {
173
+ var im = new Image();
174
+ im.src = "data:image/png;base64," + imageData
175
+ var w = window.open("",'_blank');
176
+ w.document.write(im.outerHTML);
177
+ w.document.close();
178
+ }
142
179
 
143
- scenarios_data = [passed_scenarios,failed_scenarios];
144
- var scenarioOptions = {
145
- legend: false,
146
- responsive: false
147
- };
180
+ $(document).ready(function () {
148
181
 
149
- new Chart(document.getElementById("scenario-chart"), {
150
- type: 'doughnut',
151
- tooltipFillColor: "rgba(51, 51, 51, 0.55)",
152
- data: {
153
- labels: [
154
- "Passed",
155
- "Failed"
156
- ],
157
- datasets: [{
158
- data: scenarios_data,
159
- backgroundColor: [
160
- "#26B99A",
161
- "#E74C3C"
162
- ]
163
- }]
164
- },
165
- options: scenarioOptions
166
- });
182
+ passed_scenarios = parseInt("<%= passed_scenarios(@feature).count %>")
183
+ failed_scenarios = parseInt("<%= failed_scenarios(@feature).count %>")
184
+
185
+ scenarios_data = [passed_scenarios,failed_scenarios];
186
+ var scenarioOptions = {
187
+ legend: false,
188
+ responsive: false
189
+ };
190
+
191
+ new Chart(document.getElementById("scenario-chart"), {
192
+ type: 'doughnut',
193
+ tooltipFillColor: "rgba(51, 51, 51, 0.55)",
194
+ data: {
195
+ labels: [
196
+ "Passed",
197
+ "Failed"
198
+ ],
199
+ datasets: [{
200
+ data: scenarios_data,
201
+ backgroundColor: [
202
+ "#26B99A",
203
+ "#E74C3C"
204
+ ]
205
+ }]
206
+ },
207
+ options: scenarioOptions
208
+ });
167
209
 
168
- $('body').tooltip({
169
- selector: '[data-toggle="tooltip"]'
210
+ $('body').tooltip({
211
+ selector: '[data-toggle="tooltip"]'
212
+ });
170
213
  });
171
- });
172
214
  </script>
173
215
  </body>
174
216
  </html>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kraken-mobile
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Ravelo M
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-05-20 00:00:00.000000000 Z
11
+ date: 2019-05-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cucumber
@@ -142,7 +142,7 @@ files:
142
142
  - reporter/feature_report.html.erb
143
143
  - reporter/index.html.erb
144
144
  - reporter/scenario_report.html.erb
145
- homepage: https://github.com/ravelinx22/KrakenMobile
145
+ homepage: https://github.com/TheSoftwareDesignLab/KrakenMobile
146
146
  licenses:
147
147
  - MIT
148
148
  metadata: {}