allure-commandline
Advanced tools
Comparing version 2.13.0 to 2.13.8
@@ -59,2 +59,16 @@ 'use strict'; | ||
allure.api.addTranslation('nl', { | ||
tab: { | ||
behaviors: { | ||
name: 'Functionaliteit' | ||
} | ||
}, | ||
widget: { | ||
behaviors: { | ||
name: 'Features en story’s', | ||
showAll: 'Toon alle' | ||
} | ||
} | ||
}); | ||
allure.api.addTranslation('he', { | ||
@@ -79,6 +93,6 @@ tab: { | ||
} | ||
}, | ||
}, | ||
widget: { | ||
behaviors: { | ||
name: 'Funcionalidades por história', | ||
name: 'Funcionalidades por história', | ||
showAll: 'Mostrar tudo' | ||
@@ -131,2 +145,16 @@ } | ||
allure.api.addTranslation('fr', { | ||
tab: { | ||
behaviors: { | ||
name: 'Comportements' | ||
} | ||
}, | ||
widget: { | ||
behaviors: { | ||
name: 'Thèmes par histoires', | ||
showAll: 'Montrer tout' | ||
} | ||
} | ||
}); | ||
allure.api.addTab('behaviors', { | ||
@@ -153,2 +181,2 @@ title: 'tab.behaviors.name', icon: 'fa fa-list', | ||
showLinks: true | ||
})); | ||
})); |
@@ -35,2 +35,10 @@ 'use strict'; | ||
allure.api.addTranslation('nl', { | ||
tab: { | ||
packages: { | ||
name: 'Packages' | ||
} | ||
} | ||
}); | ||
allure.api.addTranslation('he', { | ||
@@ -76,2 +84,10 @@ tab: { | ||
allure.api.addTranslation('fr', { | ||
tab: { | ||
packages: { | ||
name: 'Paquets' | ||
} | ||
} | ||
}); | ||
allure.api.addTab('packages', { | ||
@@ -78,0 +94,0 @@ title: 'tab.packages.name', icon: 'fa fa-align-left', |
(function () { | ||
var settings = allure.getPluginSettings('screen-diff', {diffType: 'diff'}); | ||
var settings = allure.getPluginSettings('screen-diff', { diffType: 'diff' }); | ||
function renderImage(src) { | ||
return '<div class="screen-diff__container">' + | ||
'<img class="screen-diff__image" src="data/attachments/' + src + '">' + | ||
'</div>'; | ||
return ( | ||
'<div class="screen-diff__container">' + | ||
'<img class="screen-diff__image" src="' + | ||
src + | ||
'">' + | ||
'</div>' | ||
); | ||
} | ||
function renderDiffContent(type, data) { | ||
function findImage(name) { | ||
if (data.testStage && data.testStage.attachments) { | ||
return data.testStage.attachments.filter(function (attachment) { | ||
return attachment.name === name; | ||
})[0]; | ||
function findImage(data, name) { | ||
if (data.testStage && data.testStage.attachments) { | ||
var matchedImage = data.testStage.attachments.filter(function (attachment) { | ||
return attachment.name === name; | ||
})[0]; | ||
if (matchedImage) { | ||
return 'data/attachments/' + matchedImage.source; | ||
} | ||
return null; | ||
} | ||
return null; | ||
} | ||
var diffImage = findImage('diff'); | ||
var actualImage = findImage('actual'); | ||
var expectedImage = findImage('expected'); | ||
if (!diffImage && !actualImage && !expectedImage) { | ||
return '<span>Diff, actual and expected image have not been provided.</span>'; | ||
} | ||
function renderDiffContent(type, diffImage, actualImage, expectedImage) { | ||
if (type === 'diff') { | ||
if (!diffImage) { | ||
return renderImage(actualImage.source); | ||
if (diffImage) { | ||
return renderImage(diffImage); | ||
} | ||
return renderImage(diffImage.source); | ||
} | ||
if (type === 'overlay') { | ||
return '<div class="screen-diff__overlay screen-diff__container">' + | ||
'<img class="screen-diff__image" src="data/attachments/' + expectedImage.source + '">' + | ||
if (type === 'overlay' && expectedImage) { | ||
return ( | ||
'<div class="screen-diff__overlay screen-diff__container">' + | ||
'<img class="screen-diff__image" src="' + | ||
expectedImage + | ||
'">' + | ||
'<div class="screen-diff__image-over">' + | ||
'<img class="screen-diff__image" src="data/attachments/' + actualImage.source + '">' + | ||
'<img class="screen-diff__image" src="' + | ||
actualImage + | ||
'">' + | ||
'</div>' + | ||
'</div>'; | ||
'</div>' | ||
); | ||
} | ||
if (actualImage) { | ||
return renderImage(actualImage); | ||
} | ||
return 'No diff data provided'; | ||
} | ||
var TestResultView = Backbone.Marionette.View.extend({ | ||
regions: { | ||
subView: '.screen-diff-view', | ||
}, | ||
template: function () { | ||
return '<div class="screen-diff-view"></div>'; | ||
}, | ||
onRender: function () { | ||
var data = this.model.toJSON(); | ||
var testType = data.labels.filter(function (label) { | ||
return label.name === 'testType'; | ||
})[0]; | ||
var diffImage = findImage(data, 'diff'); | ||
var actualImage = findImage(data, 'actual'); | ||
var expectedImage = findImage(data, 'expected'); | ||
if (!testType || testType.value !== 'screenshotDiff') { | ||
return; | ||
} | ||
this.showChildView( | ||
'subView', | ||
new ScreenDiffView({ | ||
diffImage: diffImage, | ||
actualImage: actualImage, | ||
expectedImage: expectedImage, | ||
}), | ||
); | ||
}, | ||
}); | ||
var ErrorView = Backbone.Marionette.View.extend({ | ||
templateContext: function () { | ||
return this.options; | ||
}, | ||
template: function (data) { | ||
return '<pre class="screen-diff-error">' + data.error + '</pre>'; | ||
}, | ||
}); | ||
var AttachmentView = Backbone.Marionette.View.extend({ | ||
regions: { | ||
subView: '.screen-diff-view', | ||
}, | ||
template: function () { | ||
return '<div class="screen-diff-view"></div>'; | ||
}, | ||
onRender: function () { | ||
jQuery | ||
.getJSON(this.options.sourceUrl) | ||
.then(this.renderScreenDiffView.bind(this), this.renderErrorView.bind(this)); | ||
}, | ||
renderErrorView: function (error) { | ||
console.log(error); | ||
this.showChildView( | ||
'subView', | ||
new ErrorView({ | ||
error: error.statusText, | ||
}), | ||
); | ||
}, | ||
renderScreenDiffView: function (data) { | ||
this.showChildView( | ||
'subView', | ||
new ScreenDiffView({ | ||
diffImage: data.diff, | ||
actualImage: data.actual, | ||
expectedImage: data.expected, | ||
}), | ||
); | ||
}, | ||
}); | ||
var ScreenDiffView = Backbone.Marionette.View.extend({ | ||
className: 'pane__section', | ||
events: { | ||
'click [name="screen-diff-type"]': 'onDiffTypeChange', | ||
'mousemove .screen-diff__overlay': 'onOverlayMove' | ||
events: function () { | ||
return { | ||
['click [name="screen-diff-type-' + this.cid + '"]']: 'onDiffTypeChange', | ||
'mousemove .screen-diff__overlay': 'onOverlayMove', | ||
}; | ||
}, | ||
initialize: function (options) { | ||
this.diffImage = options.diffImage; | ||
this.actualImage = options.actualImage; | ||
this.expectedImage = options.expectedImage; | ||
this.radioName = 'screen-diff-type-' + this.cid; | ||
}, | ||
templateContext: function () { | ||
return { | ||
diffType: settings.get('diffType') | ||
} | ||
diffType: settings.get('diffType'), | ||
diffImage: this.diffImage, | ||
actualImage: this.actualImage, | ||
expectedImage: this.expectedImage, | ||
radioName: this.radioName, | ||
}; | ||
}, | ||
template: function (data) { | ||
var testType = data.labels.filter(function (label) { | ||
return label.name === 'testType' | ||
})[0]; | ||
if (!testType || testType.value !== 'screenshotDiff') { | ||
if (!data.diffImage && !data.actualImage && !data.expectedImage) { | ||
return ''; | ||
} | ||
return '<h3 class="pane__section-title">Screen Diff</h3>' + | ||
return ( | ||
'<h3 class="pane__section-title">Screen Diff</h3>' + | ||
'<div class="screen-diff__content">' + | ||
'<div class="screen-diff__switchers">' + | ||
'<label><input type="radio" name="screen-diff-type" value="diff"> Show diff</label>' + | ||
'<label><input type="radio" name="screen-diff-type" value="overlay"> Show overlay</label>' + | ||
'<label><input type="radio" name="' + | ||
data.radioName + | ||
'" value="diff"> Show diff</label>' + | ||
'<label><input type="radio" name="' + | ||
data.radioName + | ||
'" value="overlay"> Show overlay</label>' + | ||
'</div>' + | ||
renderDiffContent(data.diffType, data) + | ||
'</div>'; | ||
renderDiffContent( | ||
data.diffType, | ||
data.diffImage, | ||
data.actualImage, | ||
data.expectedImage, | ||
) + | ||
'</div>' | ||
); | ||
}, | ||
@@ -79,3 +175,6 @@ adjustImageSize: function (event) { | ||
const diffType = settings.get('diffType'); | ||
this.$('[name="screen-diff-type"][value="' + diffType + '"]').prop('checked', true); | ||
this.$('[name="' + this.radioName + '"][value="' + diffType + '"]').prop( | ||
'checked', | ||
true, | ||
); | ||
if (diffType === 'overlay') { | ||
@@ -95,5 +194,9 @@ this.$('.screen-diff__image-over img').on('load', this.adjustImageSize.bind(this)); | ||
this.render(); | ||
} | ||
}, | ||
}); | ||
allure.api.addTestResultBlock(ScreenDiffView, {position: 'before'}); | ||
allure.api.addTestResultBlock(TestResultView, { position: 'before' }); | ||
allure.api.addAttachmentViewer('application/vnd.allure.image.diff', { | ||
View: AttachmentView, | ||
icon: 'fa fa-exchange', | ||
}); | ||
})(); |
@@ -6,3 +6,3 @@ { | ||
}, | ||
"version": "2.13.0", | ||
"version": "2.13.8", | ||
"description": "Wrapper to install Allure-commandline via NPM", | ||
@@ -9,0 +9,0 @@ "main": "index.js", |
@@ -41,4 +41,4 @@ # Allure Commandline | ||
1. Update package version `$ npm version 2.13.0` | ||
1. Download Allure-commandline package: `./fetch-sources` | ||
1. Download Allure-commandline package: `./fetch-source` | ||
1. Pubslish result to NPM: `npm publish` | ||
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18813631
489
1