cypress-cucumber-preprocessor - not logging to messages.json - javascript

I've been using Cypress with Cucumber for a while and somehow for some reason, it's stopped logging anything except 'testRunStarted' and 'testRunFinished' to messages.ndjson.
this is my .cypress-cucumber-preprocessorrc.json:
{
"json": {
"enabled": true,
"output": "cypress/cucumber-json/cucumber-json.json",
"formatter": "cucumber-json-formatter"
},
"html": {
"enabled": true,
"output": "cypress/cucumber-html/cucumber-html.html"
},
"messages": {
"enabled": true,
"output": "cypress/messages.ndjson"
},
"nonGlobalStepDefinitions": true,
"stepDefinitions": [
"cypress/e2e/features/*.js",
"cypress/support/step_definitions/**/*.js"
]
}
I have ran cypress with debugging on and confirmed it's picking up the correct config, and it is writing the start and finish to messages, but nothing else.
{"testRunStarted":{"timestamp":{"seconds":1664439067,"nanos":940000000}}}
{"testRunFinished":{"timestamp":{"seconds":1664439137,"nanos":63000000}}}
Absolutely stumped on this one!

I have a question: Where your step definitions are placed? Is it in the same folder where your feature files exists or they are found in support folder? Wherever it present just use that path in your step_definitions in .cypress-cucumber-preprocessorrc.json.
So your .cypress-cucumber-preprocessorrc.json should look like this if your step definitions are in support folder
{
"json": {
"enabled": true,
"output": "cypress/cucumber-json/cucumber-json.json",
"formatter": "cucumber-json-formatter"
},
"html": {
"enabled": true,
"output": "cypress/cucumber-html/cucumber-html.html"
},
"messages": {
"enabled": true,
"output": "cypress/messages.ndjson"
},
"nonGlobalStepDefinitions": true,
"stepDefinitions":
"cypress/support/step_definitions/**/*{.js,.mjs}"
}
Hope you will get your results.

PATH is an environment variable, not your project folder path.
Run the command echo $PATH in order to see a list of paths that are eligible for you to put the cucumber-json-formatter.exe into.
If you don't want to put this file in your path, you can use the json.formatter property in your config to point at this exe file.
Config to point at the formatter:
https://github.com/badeball/cypress-cucumber-preprocessor/blob/master/docs/json-report.md
Where to find the formatter:
https://github.com/cucumber/json-formatter

Related

Built Neutralino app cannot open localhost?

I have a very peculiar issue, I have a Neutralino app built with Preact that runs perfectly fine when run with neu run, however, once I build the project (with enableServer on or off), the built application will not load anything.
With enableServer on, it will complain that it cannot connect to localhost:
"This localhost page cannot be found"
and with it off it gives me a completely white screen/DOM.
The GitHub repository is here: https://github.com/SpikeHD/XeniaLauncher
I suspect it may be the way I am building the project, but I find it weird that neu run works completely fine.
Below is my configuration:
{
"applicationId": "js.xenia_launcher.app",
"version": "1.0.0",
"defaultMode": "window",
"port": 0,
"documentRoot": "/build/",
"url": "/",
"enableServer": true,
"enableNativeAPI": true,
"tokenSecurity": "one-time",
"logging": {
"enabled": true,
"writeToLogFile": true
},
"nativeAllowList": [
"app.*",
"os.*",
"filesystem.*",
"storage.*",
"window.*",
"debug.log"
],
"modes": {
"window": {
"title": "XeniaLauncher",
"width": 1000,
"height": 800,
"minWidth": 400,
"minHeight": 200,
"fullScreen": false,
"alwaysOnTop": false,
"icon": "/resources/icons/appIcon.png",
"enableInspector": true,
"borderless": false,
"maximize": false,
"hidden": false,
"resizable": true,
"exitProcessOnClose": true
},
"browser": {},
"cloud": {
"url": "/resources/#cloud",
"nativeAllowList": [
"app.*"
]
},
"chrome": {
"width": 1000,
"height": 800,
"args": "--user-agent=\"Neutralinojs chrome mode\""
}
},
"cli": {
"binaryName": "XeniaLauncher",
"resourcesPath": "/resources/",
"extensionsPath": "/extensions/",
"clientLibrary": "/resources/js/neutralino.js",
"binaryVersion": "4.4.0",
"clientVersion": "3.3.0"
}
}
Fixed it! I ended up just setting up some scripts that will put all the built Preact code into the resources folder and re-setup my config to only use the resources folder, like the original Neutralino template. I am sure there could have been a more elegant way, but I am still just learning Neutralino and Preact so this works perfectly well enough for me.
It looks like the resourcesPath needs to be set to the directory where your index.html is found. I have a public dir, and moved the icons over there, then set resourcesPath to /public/ and I was able to neu build --release and run.

Azure Blob Trigger in TypeScript doesn't trigger in deploy

I have tested my Azure function to run locally and it works normally but after I deployed, it doesn't trigger whenever I upload a file in the video-temp container.
{
"bindings": [
{
"name": "myBlob",
"type": "blobTrigger",
"direction": "in",
"path": "video-temp/{name}",
"connection": "NewContainer"
}
],
"scriptFile": "../dist/VideoConversionTrigger/index.js"
}
this is my local.settings.json
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
"FUNCTIONS_WORKER_RUNTIME": "node",
"NewContainer": "DefaultEndpointsProtocol=https; ..."
}
}
local.settings.json is only used on local. You need to add settings here after deploy:
And for the error, Microsoft.WindowsAzure.Storage: Requested value 'GET,HEAD,DELETE,MERGE,OPTIONS,POST,PUT,PATCH' was not found., you can break up the values into separate CORS entries.

Disable ghost write file storage on cloud app engine

I just try to install Ghost to Google Cloud App Engine. I follow the official instruction but I got error below:
2020-07-25 10:40:52 default[20200725t173735] Error: EROFS: read-only
file system, open
'/workspace/node_modules/ghost/content/logs/https___yaskurweb_appspot_com_production.error.log'
Then I change config.production.json from:
"logging": {
"level": "info",
"rotation": {
"enabled": true
},
"transports": ["file", "stdout"]
}
to
"logging": {
"transports": [
"stdout"
]
},
But I got another error below:
2020-07-25 10:58:47 default[20200725t175429] Error: EROFS: read-only
file system, copyfile
'/workspace/node_modules/ghost/core/frontend/services/settings/default-routes.yaml'
-> '/workspace/node_modules/ghost/content/settings/routes.yaml'
I think it's caused when Ghost tries to copy routes.yaml file to another directory. So I need to know how to disable writing any file in Ghost?
my full config.production.json is:
{
"url": "https://myproject.appspot.com",
"fileStorage": false,
"server": {
"port": 8080,
"host": "0.0.0.0"
},
"database": {
"client": "mysql",
"connection": {
"host": "*",
"port": "3306",
"user": "dev",
"password": "*",
"database": "test_db"
}
},
"mail": {
"transport": "Direct"
},
"logging": {
"transports": [
"stdout"
]
},
"process": "systemd",
"paths": {
"contentPath": "content/"
}
}
The problem is that config set content path to node_modules. it's should be installed root path.
so I changed from:
"paths": {
"contentPath": "content/"
}
to
"paths": {
"contentPath": "/workspace/content/"
}
And then work perfectly...

Is compiling Polymer.js project to .js files possible?

I've got a polymer.js 1.x project that I want to bundle to optimize for production use.
My project has several custom elements in /elements directory and lots (~100) dependencies in bower_elements.
It does not use service worker and doesn't have manifest.json file.
I tried following directions published on https://www.polymer-project.org/2.0/toolbox/build-for-production#bundling (the directions are on v2 documentation but there is info it would work for v1 projects too - tried it with polymer-starter-kit and it worked - files were bundled).
The build produces minified html,js,css files but I cannot get it to bundle my code, despite having set bundle: true in polymer.json build section.
My polymer.json contents:
{
"entrypoint": "index.html",
"fragments": [
"elements/**/*"
],
"sources": [
"images/**/*",
"bower.json",
"index.html",
"elements/**/*",
"styles/**/*"
],
"extraDependencies": [
"bower_components/webcomponentsjs/*.js",
"bower_components/webcomponentsjs/webcomponents-lite.min.js"
],
"builds": [
{
"name": "es6-bundled",
"js": {
"minify": true,
"compile": false
},
"css": {
"minify": true
},
"html": {
"minify": true
},
"bundle": true,
"addServiceWorker": false,
"addPushManifest": false,
"preset": "es6-bundled"
}
]
}

Include JS file after Ext in Sencha CMD

I have a Sencha Touch 2 application (non MVC), it works well, except for one JS file. In there I define a store.
In app.json I included sencha-touch.js and this file also. It is building properly, but when I open the page it is saying that
Object has no method 'create'
My app.json:
{
"path": "touch/sencha-touch.js",
"x-bootstrap": true
},
{
"path": "res/mystore.js"
},
{
"path": "bootstrap.js",
"x-bootstrap": true
},
{
"path": "app.js",
"bundle": true, /* Indicates that all class dependencies are concatenated into this file when build */
"update": "delta"
}
I tried many things, but nothing seems to be working, change the sequence, x-bootstrap to true for mystore.js, but nothing. Any idea?
Thanks in advance!
It seems like the problem was the order. After I changed like this:
{
"path": "touch/sencha-touch.js",
"x-bootstrap": true
},
{
"path": "bootstrap.js",
"x-bootstrap": true
},
{
"path": "app.js",
"bundle": true, /* Indicates that all class dependencies are concatenated into this file when build */
"update": "delta"
},
{
"path": "res/mystore.js"
}
it works perfectly.

Categories