How do I run a Postman collection subfolder with Newman - json

Postman: 5.5.0
Newman: 3.9.0
OS: Windows 10
How am I supposed to use the --folder command in Newman?
I have a Postman Collection Export (v2.1) which I am loading into Newman using:
- newman run "AME.postman_collection.json"
When I run this command, all tests execute as expected (including all sub folders.
However, I would like to run a specific subfolder called "Media". My understanding is that I should run the commandline:
- newman run "AME.postman_collection.json" --folder "Media"
Unfortunately this does not work. Newman simply reports no failure, but also 0 tests. I have also tried numerous other variations of the --folder parameter such as:
- "AME.Media"
- "AME/Media"
- "AME\Media"
- "\Media"
- "/Media"
- "Media/"
- "Media\"
- ".Media"
- And many, many more
Sample data from the Export below:
{
"info": {
"name": "AME",
"_postman_id": "023f6868-4c80-8c0f-01b6-78943caa38a6",
"description": "",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "Media",
"description": "",
"item": [
{
"name": "showRenderer",
"event": [

Try updgrading to v3.9.1 (December 8, 2017).
The changelog states
Fixed folder option handling
that there was in error in folder handling which is now fixed. I tried v3.9.1 with sub folder and it worked for me.

Related

How do I use the HTML/CSV reporters in pa11y with GitHub Actions?

I'm trying to get pa11y to output HTML and CSV reports.
Here's the errors:
Unable to load reporter "csv"
Unable to load reporter "html"
I have pa11y configured to generate cli, csv, and html reports, but only the cli report is output correctly.
My pa11yconfig.json looks like this:
{
"standard": "WCAG2AAA",
"level": "notice",
"defaults": {
"chromeLaunchConfig": {
"args": [
"--no-sandbox"
]
},
"reporters": [
"cli",
"csv",
"html"
],
"runners": [
"axe",
"htmlcs"
],
"timeout": 1000000,
"wait": 2000
}
}
And I'm running pa11y like this:
pa11y-ci --sitemap "$SITEMAP_URL" > "$OUTPUT_DIR/success-pa11y-report.txt" 2> "$OUTPUT_DIR/failures-pa11y-report.txt"
This command is being executed as part of GitHub Actions, which looks like this:
- name: Install pa11y.
run: npm install -g pa11y-ci
- name: 'TEST: Run pa11y tests.'
run: my-pa11y-script.sh
My understanding is that the reporters are now bundled with pa11y, so how can I get pa11y to recognize them?
As noted by #José Luis, pa11y and pa11y-ci reporters are different.
There is no csv reporter for pa11y-ci, but there is a bundled json reporter.
As for html reporters, there is an html reporter included with pa11y, but for pa11y-ci, you need to download the pa11y-ci-reporter-html npm module.
Reference:
The pa11y-ci docs currently refer to the deprecated pa11y-html-reporter module, which will not work; I've opened a PR to update the docs.

JetBrains WebStorm Jest encountered an unexpected token

I have a problem with running a simple project in WebStorm IDE. This is what I get when I hit run:
Test suite failed to run
Jest encountered an unexpected token
This usually means that you are trying to import a file which Jest cannot parse, e.g. it's not plain JavaScript.
By default, if Jest sees a Babel config, it will use that to transform your files, ignoring "node_modules".
Here's what you can do:
• To have some of your "node_modules" files transformed, you can specify a custom "transformIgnorePatterns" in your config.
• If you need a custom transformation specify a "transform" option in your config.
• If you simply want to mock your non-JS modules (e.g. binary assets) you can stub them out with the "moduleNameMapper" config option.
You'll find more details and examples of these config options in the docs:
https://jestjs.io/docs/en/configuration.html
Details:
/home/patryk/WebstormProjects/Case Converter/node_modules/hs-test-web/hstest/stage/stageTest.js:12
runner = new PureJsApplicationRunner();
^
SyntaxError: Unexpected token =
at ScriptTransformer._transformAndBuildScript (node_modules/jest/node_modules/jest-runtime/build/script_transformer.js:403:17)
at Object.<anonymous> (node_modules/hs-test-web/hstest/index.js:1:110)
At this moment, my project contains just 1 html file. I tried reinstalling nodejs and npm, but that didn't work
Good time of day,
I've encoutered the same problem with one Edu project in WebStorm IDE - when i pressed the "check" button for task - i've got issue:
"test suite failed to run
Jest encountered an unexpected token ..."
How it was solved:
Please check if nodejs and npm installed - At IDE: File\Settings, section: Languages & frameworks > nodejs and npm section > at field: "Node interpreter" you'll find something like : "node /usr/bin/node" and at field: "Package manager" the value "npm /usr/share/npm"
In IDE - you need to expand "Project pane" and to choose view mode "Project Files" - then you need open the file "package.json",
initially this file contains the code:
{
"devDependencies": {
"#types/jest": "^23.3.12",
"hs-test-web": "https://github.com/hyperskill/hs-test-web/archive/release.tar.gz",
"jest": "^27.3.1",
"puppeteer": ">=8.0.0"
},
"scripts": {
"test": "jest"
}
}
You need to add the section for "jest" - please found the complete package.json below
{
"devDependencies": {
"#types/jest": "^23.3.12",
"hs-test-web": "https://github.com/hyperskill/hs-test-web/archive/release.tar.gz",
"jest": "^27.3.1",
"puppeteer": ">=8.0.0"
},
"scripts": {
"test": "jest"
},
"jest": {
"verbose": true,
"moduleFileExtensions": [
"ts",
"tsx",
"js",
"jsx",
"json"
],
"transform": {
"^.+\\.jsx?$": "babel-jest",
"^.+\\.tsx?$": "<rootDir>/node_modules/ts-jest/preprocessor.js"
},
"transformIgnorePatterns": ["/node_modules/(?!lodash-es)"],
"testRegex": "test/.*\\.spec\\.ts$"
}
}
So,i hope it help you.

Error packaging SharePoint App with gulp, 'package-solution' sub task

I am having an issue packaging a SharePoint App. Based on the documentation, we need to run:
npm install
gulp bundle --ship
gulp package-solution --ship
On the last statement: gulp package-solution --ship I get the following error:
Error - 'package-solution' sub task errored after 42 ms
Cannot read property 'name' of undefined
'package-solution' errored after 50 ms
This issue was a missing section in the file package-solution.json.
There need to be a developer section, see below:
{
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/package-solution.schema.json",
"solution": {
"name": "my-sample-solution",
"id": "fafafafa-1776-0911-bead-abbadabba123",
"version": "2.0.0.0",
"isDomainIsolated": false,
"includeClientSideAssets": true,
"developer": {
"name": "your-company",
"websiteUrl": "http://your-company.com",
"mpnId": "",
"termsOfUseUrl": "http://your-company.com/home/about#terms",
"privacyUrl": "http://your-company.com/home/about#privacy"
}
},
"paths": {
"zippedPackage": "solution/my-sample-solution.spapp"
}
}
The solution was found in the thread related to this GitHub issue: SharePoint repository issue #6144

"Connection refused" when creating Elastic Beanstalk environment

I'm following this tutorial to set up Laravel on an Elastic Beanstalk environment:
https://deliciousbrains.com/scaling-laravel-using-aws-elastic-beanstalk-part-3-setting-elastic-beanstalk/
I've gone through it twice on a completely fresh install of Laravel just to see if it works, and it worked both times.
Now, I've gone through it again, but this time on my main Laravel project. I've double checked everything in the tutorial, and I'm confident that I didn't miss anything.
However, when I create the environment using this command from the tutorial (with the values filled in of course):
eb create --vpc.id {VPCID} --vpc.elbpublic --vpc.elbsubnets {VPCELBSUBNETS} --vpc.ec2subnets {VPCEC2SUBNETS} --vpc.securitygroups {VPCSG}
I get the following output error:
Printing Status:
INFO: createEnvironment is starting.
INFO: Using elasticbeanstalk-us-east-1-487650495335 as Amazon S3 storage bucket for environment data.
INFO: Created security group named: sg-018fe470
INFO: Created load balancer named: awseb-e-7-AWSEBLoa-1M3V7HA824OQ0
INFO: Created security group named: sg-7489ec08
INFO: Environment health has transitioned to Pending. Initialization in progress (running for 19 seconds). There are no instances.
INFO: Created Auto Scaling launch configuration named: awseb-e-7xdtjzn4bn-stack-AWSEBAutoScalingLaunchConfiguration-RZPSBCGFS6HY
INFO: Added instance [i-09cc6faf451ef3670] to your environment.
INFO: Created Auto Scaling group named: awseb-e-7xdtjzn4bn-stack-AWSEBAutoScalingGroup-BQI6UG2OLL7E
INFO: Waiting for EC2 instances to launch. This may take a few minutes.
INFO: Created Auto Scaling group policy named: arn:aws:autoscaling:us-east-1:457680865345:scalingPolicy:a3629314-6d24-4871-a0a1-59d74a1087c2:autoScalingGroupName/awseb-e-7xdtjzn4bn-stack-AWSEBAutoScalingGroup-BQI6UG2OLL7E:policyName/awseb-e-7xdtjzn4bn-stack-AWSEBAutoScalingScaleDownPolicy-1SM372VEND7T6
INFO: Created Auto Scaling group policy named: arn:aws:autoscaling:us-east-1:457680865345:scalingPolicy:b03a08fb-e39f-4dc5-8e00-f81f8059fc56:autoScalingGroupName/awseb-e-7xdtjzn4bn-stack-AWSEBAutoScalingGroup-BQI6UG2OLL7E:policyName/awseb-e-7xdtjzn4bn-stack-AWSEBAutoScalingScaleUpPolicy-AS65NNA5M4PP
INFO: Created CloudWatch alarm named: awseb-e-7xdtjzn4bn-stack-AWSEBCloudwatchAlarmLow-1D9SO13U3HBR0
INFO: Created CloudWatch alarm named: awseb-e-7xdtjzn4bn-stack-AWSEBCloudwatchAlarmHigh-1FUCKP1GWED3A
ERROR: [Instance: i-09cc6faf451ef3670] Command failed on instance. Return code: 1 Output: (TRUNCATED)...
[PDOException]
SQLSTATE[HY000] [2002] Connection refused
Script php artisan optimize handling the post-install-cmd event returned with error code 1.
Hook /opt/elasticbeanstalk/hooks/appdeploy/pre/10_composer_install.sh failed. For more detail, check /var/log/eb-activity.log using console or EB CLI.
INFO: Command execution completed on all instances. Summary: [Successful: 0, Failed: 1].
ERROR: Create environment operation is complete, but with errors. For more information, see troubleshooting documentation.
As you can see, it says SQLSTATE[HY000] [2002] Connection refused when running php artisan optimize in the post-install-cmd.
If I try to connect to my MySQL RDS database on the command line, it connects successfully, so it doesn't look like connecting is the problem.
It took me a while to find what it meant by post-install-cmd, but I found it in my composer.json file:
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=5.6.4",
"laravel/framework": "5.3.*",
"doctrine/dbal": "^2.5",
"embed/embed": "^2.7",
"pda/pheanstalk": "~3.0",
"guzzlehttp/guzzle": "^6.2",
"intervention/image": "^2.3",
"approached/laravel-image-optimizer": "2.3.0",
"php-ffmpeg/php-ffmpeg": "0.9.3",
"laravelcollective/html": "^5.3",
"tymon/jwt-auth": "0.5.*",
"brozot/laravel-fcm": "^1.2",
"league/flysystem": "^1.0",
"cybercog/laravel-ban": "^2.1",
"pragmarx/firewall": "^1.0",
"predis/predis": "^1.1",
"aws/aws-sdk-php": "^3.31",
"dusterio/laravel-aws-worker": "^0.1.9",
"fideloper/proxy": "^3.3",
"aws/aws-sdk-php-laravel": "^3.1",
"league/flysystem-aws-s3-v3": "^1.0"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~5.0",
"symfony/css-selector": "3.1.*",
"symfony/dom-crawler": "3.1.*"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\\": "app/"
}
},
"autoload-dev": {
"classmap": [
"tests/TestCase.php"
]
},
"scripts": {
"post-root-package-install": [
"php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"php artisan key:generate"
],
"post-install-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postInstall",
"php artisan optimize"
],
"post-update-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postUpdate",
"php artisan optimize"
]
},
"config": {
"preferred-install": "dist"
}
}
To me, it doesn't look like anything is out of place.
What could the problem be?
Update
I just tried copying and pasting the contents of my project's composer.json to the fresh install of Laravel, and it successfully created an Elastic Beanstalk environment, so it looks like my composer.json isn't the problem.
What could it be?
Update #2
Looking at the eb logs, I discovered this:
[Illuminate\Database\QueryException]
SQLSTATE[HY000] [2002] Connection refused (SQL: select * from `categories` where exists (select * from `topics` where `topics`.`category_id` = `categories`.`id`) order by `name` asc)
[Doctrine\DBAL\Driver\PDOException]
SQLSTATE[HY000] [2002] Connection refused
The only place that this query is called is in my AppServiceProvider.php class. So I removed it, along with everything else that I added to the class, but I'm still getting the exact same error above, even though I removed that query call.
Why?
To answer my own question, the code in my AppServiceProvider.php file (within the boot() method) was causing it to fail.
What I did was wrapped all the code in the boot() method with this:
public function boot()
{
if (!$this->app->runningInConsole())
{
// Code here
}
}

Fully qualified class names in Laravel 5.2

So as I'm working through various tutorials (laracast & YouTube), learning Laravel 5.2 I keep coming across this situation wherethe tutorial uses a namespace like
App\Models\CarModel.php
but it only works for me if I use
carfreak\Models\CarModel.php
It appears to be that for some reason my app demands a fully qualified class name, and the tutorials avoid it. How could I do the same?
My folder structure is as follows
myprojects
-project1
-project2
-carfreak
--app
---Console
---Events
---Exceptions
---Http
---Jobs
---Listners
---Models
----CarModel.php
---Policies
---Providers
--bootstrap
--config
--database
EDIT: My composer.json
"autoload": {
"classmap": [
"database",
"app/Models"
],
"psr-4": {
"carfreak\\": "app/"
}
},
I am sure this will solve your issue, You just need to autoload your models directory. to do this you have to write this line "app/Models" in your composer.json file under autoload -> class map array. see below.
....
"autoload": {
"classmap": [
"database",
"app/Models"
]
...
},
When you add this, then Run this command in your terminal
composer dump-autoload
After that you can call your models like this
use App\Models\Problem;