I am trying to publish cucumber reports as results through Jenkins.
I am using Selenium + Protractor to run my tests. This produces a Json file which when read through Jenkins "publish cucumber reports as results" utility, gives the following error:
org.apache.velocity.exception.MethodInvocationException: Invocation of
method 'getFileName' in class net.masterthought.cucumber.json.Feature
threw exception java.lang.NullPointerException at
templates/pages/featureOverview.vm[line 360, column 73]
Following is the snapshot of my Json file:
[
{
"description": "1: As a user I want to make sure that the log in button available in the page loaded.",
"assertions": [
{
"passed": true
},
{
"passed": true
}
],
"duration": 3094516706
},
{
"description": "2: As a user with correct username and incorrect password, user should be shown error message.",
"assertions": [
{
"passed": true
},
{
"passed": true
}
],
"duration": 694093948
},
{
"description": "3: As a user with incorrect username and correct password, user should be shown error message.",
"assertions": [
{
"passed": true
},
{
"passed": true
},
{
"passed": true
}
],
"duration": 1577337485
},
{
"description": "4: As a user I want to sign in to the Space Planner Platform directly from a URL using my Self Serve Login details.",
"assertions": [
{
"passed": true
},
{
"passed": true
},
{
"passed": true
}
],
"duration": 2090233702
}
]
Related
In postman I am able to log in the user and get an accessToken:
Doing Post at http://localhost:3030/authentication I type in:
{
"strategy": "local",
"email": "bob#bob.com",
"password": "bob"
}
and then I get:
{
"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6ImFjY2VzcyJ9.eyJpYXQiOjE2NjEzMjgzMDEsImV4cCI6MTY2MTQxNDcwMSwiYXVkIjoiaHR0cHM6Ly95b3VyZG9tYWluLmNvbSIsImlzcyI6ImZlYXRoZXJzIiwic3ViIjoiMSIsImp0aSI6IjMyOWMwZTU3LTM5NTctNDUxOS05N2ZmLTRiNDIxOWI2MDQ2YSJ9.tIiRCMqzNg8F4lb1tzfYrOVvc148qRmZrZ7FPouHhKg",
"authentication": {
"strategy": "local",
"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6ImFjY2VzcyJ9.eyJpYXQiOjE2NjEzMjgzMDEsImV4cCI6MTY2MTQxNDcwMSwiYXVkIjoiaHR0cHM6Ly95b3VyZG9tYWluLmNvbSIsImlzcyI6ImZlYXRoZXJzIiwic3ViIjoiMSIsImp0aSI6IjMyOWMwZTU3LTM5NTctNDUxOS05N2ZmLTRiNDIxOWI2MDQ2YSJ9.tIiRCMqzNg8F4lb1tzfYrOVvc148qRmZrZ7FPouHhKg",
"payload": {
"iat": 1661328301,
"exp": 1661414701,
"aud": "https://yourdomain.com",
"iss": "feathers",
"sub": "1",
"jti": "329c0e57-3957-4519-97ff-4b4219b6046a"
}
},
"user": {
"id": 1,
"email": "bob#bob.com",
"createdAt": "2022-08-24T08:04:57.464Z",
"updatedAt": "2022-08-24T08:04:57.464Z"
}
}
But then when I try to use accessToken for another POST in Postman, I get:
{
"name": "NotAuthenticated",
"message": "Not authenticated",
"code": 401,
"className": "not-authenticated",
"errors": {}
}
Why is this?
One idea I have is maybe I did this part wrong. I thought I was supposed to add
auth.associateCurrentUser({
idField: "id",
as: "group_admin",
}),
But I was getting an error & found something online that said to change it to this (context below):
setField({
from: "params.user.id",
as: "data.group_admin",
}),
import * as authentication from "#feathersjs/authentication";
// Don't remove this comment. It's needed to format import lines nicely.
const { authenticate } = authentication.hooks;
import { setField } from "feathers-authentication-hooks";
export default {
before: {
all: [authenticate("jwt")],
find: [],
get: [],
create: [
setField({
from: "params.user.id",
as: "data.group_admin",
}),
// auth.associateCurrentUser({
// idField: "id",
// as: "group_admin",
// }),
],
update: [],
patch: [],
remove: [],
},
Do you have any ideas to get the accessToken to work with authentication?
I can post more code if needed.
I am using the ArcGIS for Javascript library 4.22 and I am trying to run some code when tiles cannot be fetched correctly by ArcGIS. The library prints error messages in the console, but I would like to have some other side effects.
How could I do that?
I tried with mapView.on and mapView.watch, but there seems to be no event for the error mapview-query-error, which occurs when the client's internet connection drops, for example.
The error message printed by the library:
[esri.views.2d.layers.features.sources.FeatureSource]
{
"name": "mapview-query-error",
"message": "Encountered error when fetching tile",
"details": {
"tile": {
"key": {
"level": 11,
"row": 723,
"col": 1088,
"world": 0
},
"bounds": [
1252344.271421019,
5870363.772302989,
1271912.1506620161,
5889931.65154399
],
"objectIds": {},
"tileInfoView": { /* omitted */ },
"resolution": 38.21851414257816,
"scale": 144447.63857215698,
"level": 11
},
"error": {
"name": "request:server",
"message": "Failed to fetch",
"details": {
"url": "https://services3.arcgis.com/5IQdSrlG6nfbU9TA/arcgis/rest/services/polygons_001265302111/FeatureServer/0/query",
"requestOptions": {
"query": {
"f": "pbf",
"geometry": "1252344.271421019,5870363.772302989,1271912.1506620161,5889931.65154399",
"maxRecordCountFactor": 4,
"resultOffset": 0,
"resultRecordCount": 8000,
"where": "1=1",
"orderByFields": "ObjectId",
"outFields": "*",
"outSR": 102100,
"quantizationParameters": "{\"extent\":{\"xmin\":1252344.271421019,\"ymin\":5870363.772302989,\"xmax\":1271912.1506620161,\"ymax\":5889931.65154399},\"mode\":\"view\",\"originPosition\":\"upperLeft\",\"tolerance\":38.21851414257816}",
"resultType": "tile",
"spatialRel": "esriSpatialRelIntersects",
"geometryType": "esriGeometryEnvelope",
"inSR": 102100,
"token": "AAPKd857e307032a45ee8190f767169c0d9fP8O1gtVoioRGqLEiMJhZwpnuVFIE0O7CT73pFJq_yoetIoTGP7VD4jJTSQ05QyNA"
},
"responseType": "array-buffer",
"signal": {}
},
"ssl": false,
"httpStatus": 0,
"raw": {
"stack": "TypeError: Failed to fetch\n at $ (http://localhost:3000/static/js/bundle.js:242159:23)\n at z (http://localhost:3000/static/js/bundle.js:242262:22)\n at async C (http://localhost:3000/static/js/bundle.js:242015:13)\n at async request (http://localhost:3000/static/js/bundle.js:221849:15)",
"message": "Failed to fetch"
}
}
}
}
}
We have a REST service with an incoming REST endpoint that accepts data. It has no web interface (Swagger or so), only the API. With Postman I can POST a JSON file (response code is 202) to it and then read the uploaded data from another endpoint.
When I want to log in to the same endpoint with Cypress to upload a JSON file from the fixtures folder (with the same body as in the Postman request), then I get response code 401 instead – Unauthorized. I have the feeling that the cypress request is wrong because the logfile of the service does not write a message when I use the cypress POST but it does when I use the Postman POST.
First question: What could I be doing wrong in the cypress request?
Second question: Once the authentication works, how can I POST/upload/push the content of the JSON file to that endpoint? Because I have no webpage to interact with, I cannot use click button functions. The documentation mainly deals with interpreting a JSON response but not with sending it.
My cypress code:
it('logs in to connector through REST API', () => {
cy.request({
method: 'POST',
url: 'localhost:8095/connector/demands/v1/demandData',
failOnStatusCode:false,
form: true,
body: {
Username: 'user',
Password: 'pass',
}
})
})
import my-request from '../fixtures/my-request.json'
it('loads the JSON file', () => {
cy.fixture('my-request.json')
})
The structure of the JSON file to upload is not too simple, here is a shortened version:
{
"#metadata": {
"context": "{{A}}"
},
"pool": "{{B}}",
"action": "NEW",
"Type": "ANNOUNCEMENT",
"ON": "Order123",
"PON": "PO123",
"SNN": "SN123",
"direction": "OUT",
"mode": 3,
"pack": [
{
"out": {
"outKey": "OUT14",
"outQuantity": "3",
"dimension": {
"length": "303",
"width": "33",
"height": "903",
"unit": "mm"
},
"layers": "3",
"weight": "3000",
"weightUnit": "grm",
"in": [
{
"inKey": "IN12",
"inQuantity": "3",
"article": {
"articleKey": "article3",
"quantity": "300",
"PON": "Art_PO300",
"SNN": "Art_SN300"
}
}
]
},
"p1": "pack3",
"p2": "pack4",
"store": true
},
{
"out": {
"outKey": "OUT23",
"outQuantity": "5",
"dimension": {
"length": "505",
"width": "55",
"height": "905",
"unit": "mm"
},
"layers": "5",
"weight": "5000",
"weightUnit": "grm",
"in": [
{
"inKey": "IN19",
"inQuantity": "5",
"article": {
"articleKey": "article5",
"quantity": "500",
"PON": "Art_PO500",
"SNN": "Art_SN500"
}
}
]
},
"p1": "pack5",
"p2": "pack5",
"store": true
}
]
}
Solution found. "form: true" must not be given because this overrides the content-type.
You can pass the contents of the fixture file(which is json) in the request body like this:
describe('Some Test Suite', function() {
// we can use these values to log in
const username = 'jane.lane'
const password = 'password123'
it('logs in to connector through REST API', () => {
cy.fixture('my-request.json').then(myFixture => {
cy.request({
method: 'POST',
url: 'localhost:8095/connector/demands/v1/demandData',
auth: {
username,
password,
},
failOnStatusCode: false,
form: true,
body: myFixture
})
})
})
})
For HTTP auth you have to use. You can check out this cypress recipe.
auth: {
username,
password,
}
I have a SES Configset created and trying to add SNS Event-Destination using CLI, But I get always this error,
[root#me]# aws --version
aws-cli/1.18.51 Python/2.7.5 Linux/3.10.0-1062.18.1.el7.x86_64 botocore/1.16.1
[root#me]# aws ses update-configuration-set-event-destination --generate-cli-skeleton
{
"ConfigurationSetName": "",
"EventDestination": {
"Name": "",
"Enabled": true,
"MatchingEventTypes": [
"open"
],
"KinesisFirehoseDestination": {
"IAMRoleARN": "",
"DeliveryStreamARN": ""
},
"CloudWatchDestination": {
"DimensionConfigurations": [
{
"DimensionName": "",
"DimensionValueSource": "linkTag",
"DefaultDimensionValue": ""
}
]
},
"SNSDestination": {
"TopicARN": ""
}
}
}
[root#me]# aws ses list-configuration-sets
{
"ConfigurationSets": [
{
"Name": "my-ses-configset"
}
]
}
[root#me]# aws ses update-configuration-set-event-destination --cli-input-json { "ConfigurationSetName": "my-ses-configset", "EventDestination": { "Name": "my-sns-destination", "Enabled": true, "MatchingEventTypes": [ "reject" ], "SNSDestination": { "TopicARN": "<my SNS Topic ARN>" } } }
Unknown options: my-ses-configset,, EventDestination:, {, Name:, my-sns-destination,, Enabled:, true,, MatchingEventTypes:, [, bounce, ],, SNSDestination:, {, TopicARN:, <my SNS Topic ARN>, }, }, }, ConfigurationSetName:
What is wrong here? I am providing right SNS-topic-arn.
You need to surround your input json with single quotes, otherwise the space separated strings in json will be interpreted as command-line arguments. That's why you got the Unknown options error message.
I am having some issue while creating a job for AWS Elemental media convert.
I have followed the following sequence.
1.) Create a new job
2.) Add input and configurations
3.) Add File output group and configure destination settings
4.) Under Output change Container to No Container
5.) Under Output remove Audio
6.) Under Output -> Video change Codec to JPEG to Frame Capture
7.) Configure frame rate (rate which captures will be produced (more notes and examples below))
8.) Configure max capture settings
I got the following error:
Job_contains_the_following_error:
/outputGroups: Should not match the schema
Here is my job JSON:
{
"Settings": {
"AdAvailOffset": 0,
"Inputs": [
{
"FilterEnable": "AUTO",
"PsiControl": "USE_PSI",
"FilterStrength": 0,
"DeblockFilter": "DISABLED",
"DenoiseFilter": "DISABLED",
"TimecodeSource": "EMBEDDED",
"VideoSelector": {
"ColorSpace": "FOLLOW",
"Rotate": "DEGREE_0"
},
"AudioSelectors": {
"Audio Selector 1": {
"Offset": 0,
"DefaultSelection": "DEFAULT",
"ProgramSelection": 1
}
},
"FileInput": "s3://field-live-user-data/udariyan.mp4"
}
],
"OutputGroups": [
{
"Name": "File Group",
"OutputGroupSettings": {
"Type": "FILE_GROUP_SETTINGS",
"FileGroupSettings": {
"Destination": "s3://field-live-user-data/"
}
},
"Outputs": [
{
"VideoDescription": {
"ScalingBehavior": "DEFAULT",
"TimecodeInsertion": "DISABLED",
"AntiAlias": "ENABLED",
"Sharpness": 50,
"CodecSettings": {
"Codec": "FRAME_CAPTURE",
"FrameCaptureSettings": {
"FramerateNumerator": 30,
"FramerateDenominator": 100,
"MaxCaptures": 2,
"Quality": 80
}
},
"DropFrameTimecode": "ENABLED",
"ColorMetadata": "INSERT",
"Width": 1280,
"Height": 720
},
"ContainerSettings": {
"Container": "RAW"
},
"Extension": "jpg"
}
],
"CustomName": "customGroup"
}
]
},
"Queue": "arn:aws:mediaconvert:us-east-1:469030323850:queues/Default",
"Role": "arn:aws:iam::469030323850:role/myMediaConverter"
}
Currently, you can't have a job template with frame capture only:
AWS Dev forums on this topic