How to run behat-html-formatter in behat 3.5 - html

I have behat 3.5 up and running fine on windows 10. Now I wish to publish test results in html format. I installed this plugin https://github.com/dutchiexl/BehatHtmlFormatterPlugin
But how do I run behat tests utilizing this plugin? If I type "behat" I only see test steps in text format on the console. If I type "behat --format html --out test.feature.html --config behat.yml" I get an html output that looks "ugly".
My composer.json:
{
"require": {
"behat/behat": "~3.0",
"behat/mink": "~1.7#dev",
"behat/mink-goutte-driver": "1.2.1",
"behat/mink-selenium2-driver": "~1.3.1" ,
"behat/mink-extension": "*"
},
"config": {
"bin-dir": "bin/"
},
"require-dev": {
"emuse/behat-html-formatter": "^0.2.0"
}
}
My behat.yml:
default:
extensions:
Behat\MinkExtension:
default_session: goutte
goutte: ~
selenium2:
wd_host: "http://127.0.0.1:4444/wd/hub"
capabilities: { "browserName": "firefox", "browser": "firefox", "version": "", "platform": "WINDOWS" }
browser_name: firefox
emuse\BehatHTMLFormatter\BehatHTMLFormatterExtension:
name: html
renderer: Twig,Behat2
file_name: index
print_args: true
print_outp: true
loop_break: true
suites:
default:
contexts:
- emuse\BehatHTMLFormatter\Context\ScreenshotContext:
screenshotDir: build/html/behat/assets/screenshots
- FeatureContext
formatters:
html:
output_path: %paths.base%/build/html/behat

I found the details to make this work at https://packagist.org/packages/emuse/behat-html-formatter - I am using behat 3.6.1
After installing the html formatter with composer: composer require --dev emuse/behat-html-formatter I made my behat.html file look like this:
default:
suites:
default:
contexts:
- FeatureContext
- Drupal\DrupalExtension\Context\DrupalContext
- Drupal\DrupalExtension\Context\MinkContext
- Drupal\DrupalExtension\Context\MessageContext
- Drupal\DrupalExtension\Context\DrushContext
- emuse\BehatHTMLFormatter\Context\ScreenshotContext:
screenshotDir: report/html/behat/assets/screenshots
formatters:
html:
output_path: report/html/behat
extensions:
Drupal\MinkExtension:
goutte: ~
selenium2: ~
base_url: http://tea.ddev.site
Drupal\DrupalExtension:
blackbox: ~
emuse\BehatHTMLFormatter\BehatHTMLFormatterExtension:
name: html
renderer: Twig,Behat2
file_name: index
print_args: true
print_outp: true
loop_break: true
Now when I run the behat tests, the output goes to behat/report/html/behat/index.html
I don't need to specify the output as html, it automatically does that.

Related

How can I configure wdio.conf to allow Chrome multiple file download?

What I did so far:
browserName: 'chrome',
'goog:chromeOptions': {
args: ['--use-fake-ui-for-media-stream', 'use-fake-device-for-media-stream', '--ignore-certificate-errors'],
prefs: {
'intl.accept_languages': 'hu,HU',
'profile.default_content_setting_values.automatic_downloads': 1,
'profile.default_content_setting_multiple-automatic-downloads': 1,
},
},
But it doesn't work. Manually, I have to configure at chrome://settings/content/automaticDownloads
and have to add a site from where the multiple file download is allowed.

#nuxtjs/pwa does not generate sw.js with local system hosts information

I would like to apply PWA in nuxt(#2.3.4) web application.
The operating system is OSX latest.
So I have installed #nuxtjs/pwa and add some config to nuxt.config.js.
These are what I have added
module.exports = {
...
modules: [
['#nuxtjs/pwa', {icon : false}]
],
workbox : {
dev: true,
debug: true
},
manifest : {
viewport: 'width=device-width, initial-scale=1',
theme_color: '#3B8070'
},
...
}
And build with NODE_ENV=production and start.
I am able to find sw.js in localhost:9000, but it is not available with
local.jy.net:9000.
I was expecting the same result since I register that hostname on my hosts file.
Here is what I have in /private/etc/hosts.
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
127.0.0.1 Juneui-MacBook-Pro.local
127.0.0.1 local.jy.net aad901eb546340cc9a69b0b030b124fc.jy.net
How could I make #nuxtjs/pwa refers system hosts variables?
If you need more information, add reply then I will provide as possible as I can. Thanks.
The #nuxtjs/pwa package is looking for the build.publicPath option: https://github.com/nuxt-community/pwa-module/blob/9f27d5cdae0e0341d6d4b4f6814f91db6eab1432/packages/manifest/index.js#L24
Adding this option to your nuxt.config.js should do the trick:
module.exports = {
...
modules: [
['#nuxtjs/pwa', {icon : false}]
],
workbox : {
dev: true,
debug: true
},
manifest : {
viewport: 'width=device-width, initial-scale=1',
theme_color: '#3B8070'
},
build: {
publicPath: '//local.jy.net:9000/pwa/',
}
...
}
You can find more information about the publicPath property here: https://nuxtjs.org/api/configuration-build#publicpath

Breakpoint ignored because generated code not found VSCode Chrome debugging

Using VSCode 1.15, and VSCode Chrome Debugger 3.1.7, my breakpoints are greyed out with with the error in the title "Breakpoint ignored because generated code not found". The .scripts command shows that the paths to the source maps are indeed correct.
Project Tree:
I run the application with the webpack-dev-server command.
webpack.config.js file:
const webpack = require('webpack')
const path = require('path')
const HtmlWebpackPlugin = require('html-webpack-plugin')
module.exports = {
entry: './src/index.js',
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'dist')
},
devtool: 'cheap-module-source-map',
devServer: {
contentBase: './dist',
port: 3000,
hot: true,
historyApiFallback: true
},
module: {
rules: [
{
test: /\.css$/,
use: ['style-loader', 'css-loader']
},
{
test: /\.(js|jsx)$/,
use: ['babel-loader', 'eslint-loader'],
exclude: /node_modules/
}
]
},
resolve: {
modules: [
path.join(__dirname, 'src'),
'node_modules'
],
extensions: ['.js', '.jsx']
},
plugins: [
new HtmlWebpackPlugin(),
new webpack.HotModuleReplacementPlugin()
]
}
My launch.json is as follows (I only use the launch option):
{
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Launch Chrome",
"url": "http://localhost:3000",
"webRoot": "${workspaceRoot}/src",
"sourceMaps": true,
"sourceMapPathOverrides": {
"webpack:///*": "*",
"webpack:///./*": "${webRoot}/*",
"webpack:///src/*": "${webRoot}/*",
"webpack:///./~/*": "${webRoot}/node_modules/*"
},
"trace": true
},
{
"type": "chrome",
"request": "attach",
"name": "Attach to Chrome",
"port": 9222,
"webRoot": "${workspaceRoot}"
}
]
}
.scripts command (I think most of it isn't interesting, the last 2 lines show that the mapping is correct as far as I understand):
› extensions::app
› http://localhost:3000/bundle.js
- webpack:///webpack/bootstrap d9f16bc355f23b8122c3 (webpack\bootstrap d9f16bc355f23b8122c3)
- webpack:///./node_modules/inherits/inherits_browser.js (node_modules\inherits\inherits_browser.js)
- webpack:///(webpack)/buildin/global.js ((webpack)\buildin\global.js)
- webpack:///./node_modules/process/browser.js (node_modules\process\browser.js)
- webpack:///./node_modules/debug/src/browser.js (node_modules\debug\src\browser.js)
- webpack:///./node_modules/sockjs-client/lib/event/emitter.js (node_modules\sockjs-client\lib\event\emitter.js)
- webpack:///./node_modules/sockjs-client/lib/utils/url.js (node_modules\sockjs-client\lib\utils\url.js)
- webpack:///./node_modules/json3/lib/json3.js (node_modules\json3\lib\json3.js)
- webpack:///./node_modules/sockjs-client/lib/utils/event.js (node_modules\sockjs-client\lib\utils\event.js)
- webpack:///./node_modules/sockjs-client/lib/utils/random.js (node_modules\sockjs-client\lib\utils\random.js)
- webpack:///./node_modules/sockjs-client/lib/transport/lib/ajax-based.js (node_modules\sockjs-client\lib\transport\lib\ajax-based.js)
- webpack:///./node_modules/sockjs-client/lib/transport/sender/xhr-local.js (node_modules\sockjs-client\lib\transport\sender\xhr-local.js)
- webpack:///./node_modules/sockjs-client/lib/utils/browser.js (node_modules\sockjs-client\lib\utils\browser.js)
- webpack:///./node_modules/sockjs-client/lib/utils/iframe.js (node_modules\sockjs-client\lib\utils\iframe.js)
- webpack:///./node_modules/sockjs-client/lib/transport/receiver/xhr.js (node_modules\sockjs-client\lib\transport\receiver\xhr.js)
- webpack:///./node_modules/sockjs-client/lib/transport/sender/xhr-cors.js (node_modules\sockjs-client\lib\transport\sender\xhr-cors.js)
- webpack:///./node_modules/sockjs-client/lib/transport/sender/xdr.js (node_modules\sockjs-client\lib\transport\sender\xdr.js)
- webpack:///./node_modules/sockjs-client/lib/transport/lib/iframe-wrap.js (node_modules\sockjs-client\lib\transport\lib\iframe-wrap.js)
- webpack:///./node_modules/sockjs-client/lib/utils/object.js (node_modules\sockjs-client\lib\utils\object.js)
- webpack:///./node_modules/sockjs-client/lib/event/event.js (node_modules\sockjs-client\lib\event\event.js)
- webpack:///(webpack)/hot/log.js ((webpack)\hot\log.js)
- webpack:///(webpack)/buildin/module.js ((webpack)\buildin\module.js)
- webpack:///./node_modules/url-parse/index.js (node_modules\url-parse\index.js)
- webpack:///./node_modules/sockjs-client/lib/event/eventtarget.js (node_modules\sockjs-client\lib\event\eventtarget.js)
- webpack:///./node_modules/sockjs-client/lib/transport/lib/sender-receiver.js (node_modules\sockjs-client\lib\transport\lib\sender-receiver.js)
- webpack:///./node_modules/sockjs-client/lib/transport/browser/abstract-xhr.js (node_modules\sockjs-client\lib\transport\browser\abstract-xhr.js)
- webpack:///./node_modules/sockjs-client/lib/transport/xdr-streaming.js (node_modules\sockjs-client\lib\transport\xdr-streaming.js)
- webpack:///./node_modules/sockjs-client/lib/transport/eventsource.js (node_modules\sockjs-client\lib\transport\eventsource.js)
- webpack:///./node_modules/sockjs-client/lib/transport/browser/eventsource.js (node_modules\sockjs-client\lib\transport\browser\eventsource.js)
- webpack:///./node_modules/sockjs-client/lib/transport/iframe.js (node_modules\sockjs-client\lib\transport\iframe.js)
- webpack:///./node_modules/sockjs-client/lib/version.js (node_modules\sockjs-client\lib\version.js)
- webpack:///./node_modules/sockjs-client/lib/transport/htmlfile.js (node_modules\sockjs-client\lib\transport\htmlfile.js)
- webpack:///./node_modules/sockjs-client/lib/transport/xhr-polling.js (node_modules\sockjs-client\lib\transport\xhr-polling.js)
- webpack:///./node_modules/sockjs-client/lib/location.js (node_modules\sockjs-client\lib\location.js)
- webpack:///./node_modules/sockjs-client/lib/info-iframe-receiver.js (node_modules\sockjs-client\lib\info-iframe-receiver.js)
- webpack:///./node_modules/sockjs-client/lib/info-ajax.js (node_modules\sockjs-client\lib\info-ajax.js)
- webpack:///./node_modules/html-entities/lib/html5-entities.js (node_modules\html-entities\lib\html5-entities.js)
- webpack:///(webpack)/hot/emitter.js ((webpack)\hot\emitter.js)
- webpack:///(webpack)-dev-server/client ((webpack)-dev-server\client)
- webpack:///./node_modules/url/url.js (node_modules\url\url.js)
- webpack:///./node_modules/punycode/punycode.js (node_modules\punycode\punycode.js)
- webpack:///./node_modules/url/util.js (node_modules\url\util.js)
- webpack:///./node_modules/querystring-es3/index.js (node_modules\querystring-es3\index.js)
- webpack:///./node_modules/querystring-es3/decode.js (node_modules\querystring-es3\decode.js)
- webpack:///./node_modules/querystring-es3/encode.js (node_modules\querystring-es3\encode.js)
- webpack:///./node_modules/strip-ansi/index.js (node_modules\strip-ansi\index.js)
- webpack:///./node_modules/ansi-regex/index.js (node_modules\ansi-regex\index.js)
- webpack:///./node_modules/loglevel/lib/loglevel.js (node_modules\loglevel\lib\loglevel.js)
- webpack:///(webpack)-dev-server/client/socket.js ((webpack)-dev-server\client\socket.js)
- webpack:///./node_modules/sockjs-client/lib/entry.js (node_modules\sockjs-client\lib\entry.js)
- webpack:///./node_modules/sockjs-client/lib/transport-list.js (node_modules\sockjs-client\lib\transport-list.js)
- webpack:///./node_modules/sockjs-client/lib/transport/websocket.js (node_modules\sockjs-client\lib\transport\websocket.js)
- webpack:///./node_modules/sockjs-client/lib/utils/browser-crypto.js (node_modules\sockjs-client\lib\utils\browser-crypto.js)
- webpack:///./node_modules/requires-port/index.js (node_modules\requires-port\index.js)
- webpack:///./node_modules/url-parse/node_modules/querystringify/index.js (node_modules\url-parse\node_modules\querystringify\index.js)
- webpack:///./node_modules/debug/src/debug.js (node_modules\debug\src\debug.js)
- webpack:///./node_modules/ms/index.js (node_modules\ms\index.js)
- webpack:///./node_modules/sockjs-client/lib/transport/browser/websocket.js (node_modules\sockjs-client\lib\transport\browser\websocket.js)
- webpack:///./node_modules/sockjs-client/lib/transport/xhr-streaming.js (node_modules\sockjs-client\lib\transport\xhr-streaming.js)
- webpack:///./node_modules/sockjs-client/lib/transport/lib/buffered-sender.js (node_modules\sockjs-client\lib\transport\lib\buffered-sender.js)
- webpack:///./node_modules/sockjs-client/lib/transport/lib/polling.js (node_modules\sockjs-client\lib\transport\lib\polling.js)
- webpack:///./node_modules/sockjs-client/lib/transport/receiver/eventsource.js (node_modules\sockjs-client\lib\transport\receiver\eventsource.js)
- webpack:///(webpack)/buildin/amd-options.js ((webpack)\buildin\amd-options.js)
- webpack:///./node_modules/sockjs-client/lib/transport/receiver/htmlfile.js (node_modules\sockjs-client\lib\transport\receiver\htmlfile.js)
- webpack:///./node_modules/sockjs-client/lib/transport/xdr-polling.js (node_modules\sockjs-client\lib\transport\xdr-polling.js)
- webpack:///./node_modules/sockjs-client/lib/transport/jsonp-polling.js (node_modules\sockjs-client\lib\transport\jsonp-polling.js)
- webpack:///./node_modules/sockjs-client/lib/transport/receiver/jsonp.js (node_modules\sockjs-client\lib\transport\receiver\jsonp.js)
- webpack:///./node_modules/sockjs-client/lib/transport/sender/jsonp.js (node_modules\sockjs-client\lib\transport\sender\jsonp.js)
- webpack:///./node_modules/sockjs-client/lib/main.js (node_modules\sockjs-client\lib\main.js)
- webpack:///./node_modules/sockjs-client/lib/shims.js (node_modules\sockjs-client\lib\shims.js)
- webpack:///./node_modules/sockjs-client/lib/utils/escape.js (node_modules\sockjs-client\lib\utils\escape.js)
- webpack:///./node_modules/sockjs-client/lib/utils/transport.js (node_modules\sockjs-client\lib\utils\transport.js)
- webpack:///./node_modules/sockjs-client/lib/utils/log.js (node_modules\sockjs-client\lib\utils\log.js)
- webpack:///./node_modules/sockjs-client/lib/event/close.js (node_modules\sockjs-client\lib\event\close.js)
- webpack:///./node_modules/sockjs-client/lib/event/trans-message.js (node_modules\sockjs-client\lib\event\trans-message.js)
- webpack:///./node_modules/sockjs-client/lib/info-receiver.js (node_modules\sockjs-client\lib\info-receiver.js)
- webpack:///./node_modules/sockjs-client/lib/transport/sender/xhr-fake.js (node_modules\sockjs-client\lib\transport\sender\xhr-fake.js)
- webpack:///./node_modules/sockjs-client/lib/info-iframe.js (node_modules\sockjs-client\lib\info-iframe.js)
- webpack:///./node_modules/sockjs-client/lib/iframe-bootstrap.js (node_modules\sockjs-client\lib\iframe-bootstrap.js)
- webpack:///./node_modules/sockjs-client/lib/facade.js (node_modules\sockjs-client\lib\facade.js)
- webpack:///(webpack)-dev-server/client/overlay.js ((webpack)-dev-server\client\overlay.js)
- webpack:///./node_modules/ansi-html/index.js (node_modules\ansi-html\index.js)
- webpack:///./node_modules/html-entities/index.js (node_modules\html-entities\index.js)
- webpack:///./node_modules/html-entities/lib/xml-entities.js (node_modules\html-entities\lib\xml-entities.js)
- webpack:///./node_modules/html-entities/lib/html4-entities.js (node_modules\html-entities\lib\html4-entities.js)
- webpack:///(webpack)/hot nonrecursive ^\.\/log$ ((webpack)\hot nonrecursive ^\log$)
- webpack:///./node_modules/events/events.js (node_modules\events\events.js)
- webpack:///(webpack)/hot/dev-server.js ((webpack)\hot\dev-server.js)
- webpack:///(webpack)/hot/log-apply-result.js ((webpack)\hot\log-apply-result.js)
- webpack:///src/index.js (src\index.js)
- webpack:///src/lmao.js (src\lmao.js)
This worked for me (chromeDevTools):
Map webpack://./ to / in your project workspace

Protractor-cucumber report: result.json is empty

After i follow this question Cucumber HTML report with Protractor to add this line to config file resultJsonOutputFile: 'report.json', i can generate report.json file but this file is empty after i run my test.
---------------conf.js--------------
exports.config = {
allScriptTimeout: 60000, //To set up a timeout for each test executed on Protractor
baseUrl: 'http://localhost/wp/index.php',
seleniumAddress: 'http://127.0.0.1:4444/wd/hub',
//seleniumServerJar: 'selenium-server-standalone-2.48.2.jar',
framework: 'cucumber',
specs: [
'Feature/login.feature'
],
capabilities: {
browserName: 'firefox',
},
onPrepare : function () {
//driver.manage().window().setSize( width, height );
global.driver = browser.driver;
browser.ignoreSynchronization = true;
},
resultJsonOutputFile: 'report.json',
cucumberOpts: {
require: 'Feature/Steps/*_steps.js',
format: 'pretty',
defaultTimeoutInterval: 30000
}
};
Am i doing wrong or missing with my config? Could you help me give a guide to generate report for protractor-cucumber? Thank so much.
Changing the following code should solve the issue. (Refresh the folder in IDE to view the report.json)
// resultJsonOutputFile: 'report.json',
cucumberOpts: {
require: 'Feature/Steps/*_steps.js',
format: 'pretty',
format:'json:../report.json'
}

Protractor won't start in Chrome

Today I had a problem with starting protractor. Chrome started up, but it stayed blank.
Nothing happened, but command prompt showed up with title "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"
I suppose it's because new version of Chrome (46.0), but I'm not sure. This is my config file:
exports.config = {
specs: ['Client/e2e/Automated.js'],
baseUrl: 'http://google.com/',
framework: 'jasmine2',
jasmineNodeOpts: {
print: function() {},
defaultTimeoutInterval: 1660000
},
multiCapabilities: [{
'browserName':'chrome'}...
I started in Firefox also and it worked.
Should I change something in my config file or what?
Thanks in advance.