Playwright - JS - cucumber-html-report: Is there a way to display the Metadata and Scenarios without clicking the report? - node.js

I'm facing the next situation:
After the npm run report, The report is generated, but the metadata comes collapsed by default (The same with the Features and Scenarios)
Is there a way to show this expanded instead of collapsed by default?
And another question: Is it possible to generate this same report (expanded) in PDF?
I already tried with npx playwright pdf reports/cucumber_report.html report.pdf, but the report comes with the Metadata, Features and Scenarios collapsed (Impossible to expand in the same PDF )
This is my reporter file:
reporter.js
const reporter = require('cucumber-html-reporter')
// These options will be used at the time of HTML Report generation
const options = {
theme: 'bootstrap',
jsonFile: 'cucumber_report.json',
output: 'reports/cucumber_report.html',
reportSuiteAsScenario: true,
scenarioTimestamp: true,
launchReport: false,
metadata: {
'App Version': '1.0.0',
'Test Environment': 'TEST',
Browser: 'Chrome 107.0.5304.18',
Platform: 'MacOS Monterey - Version: 12.6',
},
}
reporter.generate(options)

Related

Not getting SKIPPED test-cases in cucumber html report

I'm using "cucumber-html-reporter" for my Appium, Pytest-BDD automation. For some reason, I'm not getting skipped test cases in my html report.
Below is my report generation script
var reporter = require('cucumber-html-reporter');
var date = new Date().getTime()
var options = {
theme: 'bootstrap',
jsonFile: __dirname + '/reports/JsonReport.json',
output: __dirname + '/reports/htmlReport/report.html',
reportSuiteAsScenarios: true,
scenarioTimestamp: true,
launchReport: false,
metadata: {
"App Version": "app_version",
"Test Environment": "Local",
"Device": "DeviceName",
"Platform": "DevicePlatform",
"App-Instance-Id" : "appInstanceId"
}
};
reporter.generate(options);
I'm using #skip explicitly to skip the test cases. I want to see those cases in html report. I couldn't find any resource to solve this issue. Any help would be appreciated.
Below is my sample code
#fire #smoke #android #testCoupe
Feature: Fire Screen
Verifying Fire Screen Functionality
#skip
Scenario: Tapping on an news article under fire card
When Scroll to "SPOTLIGHT_FIRE_CARD" CARD
And The user has clicked on the "SPOTLIGHT_FIRE_CARD" button
Then The user can view "FIRE_STORY_ARTICLE" by clicking "FIRE_STORY_TITLE" in "FIRE_CENTER_SCREEN"
After automation run, I can't see any skip test cases, I can only see passed or failed test case.
My execution script
python3 -m pytest --disable-pytest-warnings -vv --gherkin-terminal-reporter --cucumberjson=$REPORT_PATH -k "fireTest" -s

How to attach rundeck execution log for sending via curl?

I'm developing a script on rundeck, sending custom webhooks.
But I am not able to send the log of the work execution itself.
I need the execution log to be sent in the message body.
As in the example:
Log rundeck:
enter image description here
I need this log to be in the body of the message, I've tried some ways but it didn't work, does anyone have any tips?
Download this plugin using the plugin manager, the plugin is for sending HTTP notifications against any node.
In your command step/script step use the multiline data capture filter (to capture all the output in a single data variable like ${data.mydata}).
Now using the global variable step, take the data value (the job output) and create a global variable to export across the job or use in notifications, e.g: ${export.tonotify}.
In your job (creating or editing), go to the Notifications tab, select any scenario (e.g: On Success), clic on the + Add Notification button, select the "Http Notification" on the "Notification type" list, then put the HTTP URL, POST method and ${export.tonotify} on body section.
Take a look at this Job definition example for testing:
- defaultTab: nodes
description: ''
executionEnabled: true
id: fdda4e33-9121-4119-9685-69a18a0e1989
loglevel: INFO
name: HelloWorld
nodeFilterEditable: false
notification:
onsuccess:
plugin:
configuration:
authentication: None
body: ${export.tonotify}
contentType: application/json
method: POST
remoteUrl: https://your/url/to/post
timeout: '30000'
type: HttpNotification
notifyAvgDurationThreshold: null
plugins:
ExecutionLifecycle: null
scheduleEnabled: true
sequence:
commands:
- description: 'Any command / script / wathever, the ouput is captured by multiline
regex data capture filter'
exec: ls -a
plugins:
LogFilter:
- config:
hideOutput: 'false'
logData: 'true'
name: mydata
regex: ^(.*)
type: key-value-data-multilines
- configuration:
export: tonotify
group: export
value: ${data.mydata*}
description: create an export variable to notofy or use acroos your jobs
nodeStep: false
type: export-var
- description: just for debugging
exec: echo ${export.tonotify}
keepgoing: false
strategy: node-first
uuid: fdda4e33-9121-4119-9685-69a18a0e1989
Result (I used webhook.site to test).

React-Native FBSDK Share Dialog only works in simulator (iOS)

I'm trying to share a link through the React-Native-FBSDK library using the ShareDialog. I've got my code set up like so:
const shareContent = {
contentType: 'link',
contentDescription: 'Stuff here',
contentTitle: 'Share Title',
contentUrl: 'https://google.com',
imageUrl: someUrl
}
ShareDialog.canShow(shareContent).then((canShow) => {
canShow && ShareDialog.show(shareContent);
}
This code works in the simulator when it opens in a Safari WebView but when I load it on a device with the Facebook app installed, it opens a model over my app but it only uses the url I give it, then it fills in all the other data from the meta tags on the page instead of using my code. Is there something I need to do to get this to work with the native app?
.
iOS 10, react-native 0.30.0, react-native-fbsdk 0.4.0
I have the same issue. My solution is to use the ShareButton instead of ShareDialog. It works perfectly in my iPhone 10.2.
import {ShareButton} from "react-native-fbsdk";
const shareModel = {
contentType: 'link',
contentUrl: this.url,
contentTitle: this.title,
contentDescription: this.description,
imageUrl: this.thumb
};
<ShareButton shareContent={shareModel}/>

Kentico CKEditor Configure Style Set Dynamically

I'm using Kentico 9 and I'd like to be able to use different CK Editor style sets on different pages. I have added a style set to the styles.js file as follows.
CKEDITOR.stylesSet.add("mystyles", [{ name: "testone", element: "p" }]);
Then in the page I've added some JS as per the CK Editor web site.
if (CKEDITOR.currentInstance) {
CKEDITOR.currentInstance.config.stylesSet = "mystyles";
}
When I load the page containing the CK Editor, the style drop down contains the default style set, not the custom one I defined.
Does anyone know how to achieve this?
If I remember it right you need to define your new toolbarset in config.js (CMSAdminControls/CKEditor/config.js) dropdown.
Something like:
config.toolbar_Basic = [
['Bold', 'Italic', '-', 'NumberedList', 'BulletedList', '-', 'InsertLink', 'Unlink']
];
The other thing - you need to add new option to this dropdown in Webparts application > EditableText webpart> Properties > HTMLAreaToolbar > DataSource
Here's the documentation you need to read.
The dropdown styles are defined in CMS\CMSAdminControls\CKeditor\styles.js, such as:
{ name: 'Italic Title', element: 'h2', styles: { 'font-style': 'italic' } },
You define the name of the style (the name appears in the dropdown), and then the element and style(s) that should be applied.
After editing the file, make sure you clear your browser cache.
As most Kentico admin interface pages are nested and iframe'd, the caching is pretty agressive, and your styles might not appear until cache is cleared.
Well, it's just javascript after all, so you can simply check the url in some if statement or in some switch-case and then apply styles you need. Do you need some code example? You should be able to find many of them on the internet :)
Here is how I solved my issue. I added the following to styles.js:
CKEDITOR.stylesSet.add("my-styles", [
{ name: "Paragraph", element: "p" },
{ name: "Heading 1", element: "h1" }
]);
Then, in the master page for the area of my site that needs to use the "my-styles" style set, I added:
<script>window.ckstyleset = "my-styles"</script>
Finally, in config.js I added:
var styleset = window.ckstyleset ? window.ckstyleset : "default";
config.stylesSet = styleset;
Using this approach I was able to customise the styles listed in the drop down depending on what master page was is use.

FineUploaderBasic for Azure nothing shows up

var uploader = new qq.azure.FineUploaderBasic({
debug: true,
element: document.getElementById("fine-uploader-gallery"),
signature: {
endpoint: '#Url.Action("GetUploadSASUrl", "Upload")'
},
uploadSuccess: {
endpoint: '#Url.Action("ProcessImage", "Upload")'
},
scaling: {
sendOriginal: false,
sizes: [
{ name: "", maxSize: 800 }
]
},
validation: {
allowedExtensions: ['jpeg', 'jpg', 'png']
}
});
</script>
Trying to create a FineUploader Basic instance for Azure but nothing shows up. What am I doing wrong?
I've added a debug: true directive but nothing shows up in the console. The initial script tag is there and a div with the id of "fine-uploader-gallery" is there. All the scripts and CSS are on the page.
Why would you expect something to "show up"? You are using Fine Uploader's "core" mode, which assumes you are providing the entire UI yourself and simply making use of the API, options, and events to drive it. If you want to render a default but customizable UI, you should use UI mode instead. More information about all of these can be found on the docs site at http://docs.fineuploader.com. Before you go any further, you should spend some time familiarizing yourself with these options.

Resources