I am trying to categorize by the failed test result in various categories using the categories.json file. I am using following JSON file:
[
{
"name": "Ignored tests",
"matchedStatuses": ["skipped"]
},
{
"name": "Infrastructure problems",
"matchedStatuses": ["broken", "failed"],
"messageRegex": ".*An unknown server-side error occurred.*"
},
{
"name": "Outdated tests",
"matchedStatuses": ["broken"],
"traceRegex": ".*FileNotFoundException.*"
},
{
"name": "Test defects",
"matchedStatuses":[
"broken",
"Element is not currently visible and may not be manipulated"
],
"traceRegex":[
".*Cannot read property.*",
".*is not in DOM or there is no element.*",
".*is not a function.*"
]
},
{
"name": "Element Not visible",
"traceRegex":[
".*still not visible after.*",
".*Element is not currently visible and may not be manipulated.*",
".*was not found by text|CSS|XPath.*"
]
},
{
"name":"Promise Rejected",
"traceRegex": [".*Promise was rejected with the following reason.*"]
}
]
and in the allure report and getting only Product Defects.
This is how it looks
I am using
allure: 2.8.1
codeceptjs: 1.4.6
appium: 1.8.2
You have wrong categories.json file format (traceRegex expected to be a string). If you want to have multiply matchers per category, simply use the same name:
[{
"name": "Element Not visible",
"traceRegex": ".*still not visible after.*"
}, {
"name": "Element Not visible",
"traceRegex": ".*Element is not currently visible and may not be manipulated.*"
}]
In addition to Dmitry Baev's answer you can always use "|" - Regex Alternation Operator (| or |)
In your case it would look as follows:
{
"name": "Element Not visible",
"traceRegex": "(.*still not visible after.*)|(.*Element is not currently visible and may not be manipulated.*)|(.*was not found by text|CSS|XPath.*)"
}
which can be further simplified to:
{
"name": "Element Not visible",
"traceRegex": ".*(still not visible after)|(Element is not currently visible and may not be manipulated)|(was not found by text|CSS|XPath).*"
}
Related
When using Handlebars templates to generate output, proper indentation is important to make the output readable. I can not get the correct indentation to display a nested data structure, such as a JSON object.
Suppose you have a JSON object like this:
{
"type": "object",
"name": "one",
"children": [
{
"type": "object",
"name": "two",
"children": [
{
"type": "scalar",
"name": "three",
"value": "3"
},
{
"type": "object",
"name": "Deep",
"children": [
{
"type": "scalar",
"name": "four",
"value": "4"
},
{
"type": "scalar",
"name": "five",
"value": "5"
}
]
}
]
}
]
}
And you want to generate output using the following Handlebars template:
{{!
========================= object ===============================
}}
{{#*inline "object"}}
{{name}}: {
{{#each children}}
{{> "json"}}{{#unless #last}},{{/unless}}
{{/each}}
}{{/inline}}
{{!
========================= scalar ===============================
}}
{{#*inline "scalar"}}
{{name}}: {{value ~}}
{{/inline}}
{{!
========================= json ===============================
}}
{{#*inline "json"}}
{{#switch type}}
{{#case 'object'}}{{> "object"}}{{/case ~}}
{{#case 'scalar'}}{{> "scalar"}}{{/case ~}}
{{/switch}}
{{/inline}}
{{!
========================= main =================================
}}
{{> "json" this}}
The output you get is:
one: {
two: {
three: 3,
Deep: {
four: 4,
five: 5
}
}
}
Note the lack of proper indentation. How can I resolve the problem and have the output formatted correctly?
PS. I got used to the StringTemplate library where you have the proper indentation without any additional effort. Is it possible to get the same result from Hanbdlebars without resolving to other helpers, explicit indent evaluations, and so on, as I found in some older posts?
Explicit solution with additional helpers
PS. JSON is used to illustrate the problem with the recursive templates, I do not need to print JSON objects.
These two questions are all about the AdaptiveCard Botframework.
Q1: I have set the default placeholder value in the adaptivecard :text1, but after triggering the event, the placeholder cannot be displayed correctly , the placeholder was blank. There is no hint information(text1) in the placeholder. And even I copied the MS sample code to my source, it still not working. I have tried in the Chrome the Firefox and also in IE11, but all failed.
The placeholder was blank
MS samplecode
MS sample linkage
Q2: I have set the width for two columns in the columnset using the adaptivecard(one was set as 40 and another one was set as 10), but it seems not working. The grid was not displayed correctly.
My source
Width limit seems not working
[
{
"contentType": "application/vnd.microsoft.card.adaptive",
"content": {
"type": "AdaptiveCard",
"version": "1.0",
"body": [
{
"type": "TextBlock",
"text": "Test",
"weight": "bolder",
"size": "medium"
},
{
"type": "ColumnSet",
"spacing": "none",
"columns": [
{
"type": "Column",
"width": 40,
"items": [
{
"type": "Input.ChoiceSet",
"id": "country",
"style": "compact",
"placeholder": "Country",
"value": "1",
"choices": [
{
"title": "UnitedStates",
"value": "US"
}
]
}
]
},
{
"type": "Column",
"width": 10,
"items": [
{
"type": "Input.Number",
"placeholder": "text1",
"min": 0,
"id": "Text1"
}
]
}
]
}
],
"actions": [
{
"type": "Action.Submit",
"title": "Button"
}
]
}
}
]
Q1:
The placeholder value is rendered depending on the host renderer. What you can see in this image, is a comparison of several different hosts, and you can see that two of them do render the placeholder.
Q2:
The columns are correctly set and the columnset does render correctly.
What you can see here is that columns width in numeric format is a % of overall width, after auto and stretch column widths have been taken into consideration
In the following, your first column is set to Auto, and the second remains at 10
The second column takes up the entire space because AUTO brings the first column to the slimmest width it can be rendered at.
Visualisers in different hosts may show this differently, but the certainly are intended to be the same regardless of the host.
Hope this helps.
I have a set of notebooks with metadata elements set at the cell level to define different sorts of activity.
For example, in the following .ipynb file there is a metadata element commentate set to true that is dynamically styled using a custom notebook extension to show a coloured background.
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#Header\n",
"\n",
"..and some markdown."
]
},
{
"cell_type": "markdown",
"metadata": {
"commentate": true
},
"source": [
"Metadata styled markdown."
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.4.0"
}
},
"nbformat": 4,
"nbformat_minor": 0
}
I would like to generate a correspondingly styled HTML version of this notebook using nbconvert.
Is there a way I can map ipynb cell level metadata elements onto a CSS class and then associate a custom CSS file with, or embed custom CSS elements in, the generated HTML file?
Alternatively, is there a simple pattern for translating cell level metadata attributes/values to associated custom styled elements in converted HTML?
I'm trying to create pyramid chart similar to this http://www.highcharts.com/demo/pyramid in rCharts, however it gives me an error even though the output looks fine
h1 <- Highcharts$new()
h1$chart(type = "pyramid")
h1$series(name='Unique users', data=list(
list('Website visits', 15654),
list('Downloads', 4064),
list('Requested price list', 1987),
list('Invoice sent', 976),
list('Finalized', 84)
))
Here is an output
(function ($) {
$(function () {
var chart = new Highcharts.Chart({
"dom": "chartee4502dd16c",
"width": 800,
"height": 400,
"credits": {
"href": null,
"text": null
},
"exporting": {
"enabled": false
},
"title": {
"text": null
},
"yAxis": {
"title": {
"text": null
}
},
"chart": {
"type": "pyramid",
"renderTo": "chartee4502dd16c"
},
"series": [{
"name": "Unique users",
"data": [
[
"Website visits",
15654],
[
"Downloads",
4064],
[
"Requested price list",
1987],
[
"Invoice sent",
976],
[
"Finalized",
84]
]
}],
"id": "chartee4502dd16c"
});
});
})(jQuery);
Am I doing a mistake somewhere or is pyramid chart just not supported by rCharts? Thanks.
#Ondkloss is right on the money here. All that you need to do is to add the funnel script to your page. There is a quick and easy way to do that in rCharts without hacking at config.yml. You can use the addAssets method to inject a javascript asset in the head.
library(rCharts)
h1 <- Highcharts$new()
h1$addAssets(jshead = "http://code.highcharts.com/modules/funnel.js")
Now run the same code you ran previously and you should get a nice pyramid chart.
h1$chart(type = "pyramid")
h1$series(name='Unique users', data=list(
list('Website visits', 15654),
list('Downloads', 4064),
list('Requested price list', 1987),
list('Invoice sent', 976),
list('Finalized', 84)
))
h1
Here is the final version of the chart. You can click here fpr a version that is editable online.
From the Highcharts API (and as included in your demonstration) a Pyramid chart is "a reversed funnel chart without a neck", and a Funnel chart "requires that the modules/funnel.js file is loaded".
Judging from the config.yml for the Highcharts library in rCharts that specific module is not included:
highcharts:
jshead:
- js/jquery-1.9.1.min.js
- js/highcharts.js
- js/highcharts-more.js
- js/exporting.js
cdn:
jshead:
- "http://code.jquery.com/jquery-1.9.1.min.js"
- "http://code.highcharts.com/highcharts.js"
- "http://code.highcharts.com/highcharts-more.js"
- "http://code.highcharts.com/modules/exporting.js"
There's not much between you and a modified rCharts to make it happen though, if you so desire.
There is the debug for a article on my website: link. And below the raw data from facebook debugger to this article:
{
"id": "143663629163437",
"url": "http://extra.globo.com/noticias/brasil/protestos-em-sao-paulo-policia-detem-20-apos-saques-lojas-restaurantes-depredados-8739208.html",
"type": "article",
"title": "Protestos em S\u00e3o Paulo: pol\u00edcia det\u00e9m 20 ap\u00f3s saques a lojas e restaurantes depredados",
"locale": {
"locale": "pt_br"
},
"image": [
{
"url": "http://extra.globo.com/incoming/8739207-e7c-730/w107h60-PROP/sao-paulo-noite-1.jpg",
"width": 107,
"height": 60
}
],
"description": "S\u00c3O PAULO - Grupos de manifestantes depredaram e saquearam lojas e restaurantes em v\u00e1rios pontos da capital paulista, durante os protestos desta ter\u00e7a-feira....",
"site_name": "Extra Online",
"admins": [
{
"id": "100000043813964"
}
],
"updated_time": "2013-06-19T15:08:26+0000",
"created_time": "2013-06-19T03:39:10+0000",
"application": {
"id": "154414861355894",
"name": "Leitura Social Extra Online",
"url": "https://www.facebook.com/apps/application.php?id=154414861355894"
},
"is_scraped": true
}
apparently, there is no problem with any of those meta tags, but the image is not found or is not loaded by facebook.
any ideas?
The image is not loaded is one question 1.
The image is not on the timeline is question 2.
Question 1:
First you need to debug your URL with meta tags includes into your page here
The debugger will notify what is wrong in your page refers to meta tags.
Question 2
You need to add the fb:explicitly_shared as a true value in order to publish on timeline.