I've been trying to test the GeoPoint object from Firestore, here's the code that I have:
request.resource.data.latLng is latlng;
and here's the portion of my test:
await firebase.assertSucceeds(userLocationRef.set({
"name": "Some name",
"locationString": "Some location",
"objectID": "objectID",
"phoneNumber": "Some phone number",
"latLng": {
"latitude": 9.82,
"longitude": -82.877
}
}))
With this code my test doesn't pass, I there a way to test a GeoPoint from Firestore?
Related
I am trying to create the OAS Swagger documentation for an existing API where the response for the API is changing on the basis of Query parameter. I am struggling to document this in a developer friendly way, so need some assistance. Below is the complete scenario for your reference.
EndPoint 1 : /order?expand=false
/order?expand=false
{
"orderNo": "12345",
"orderDetail": "Description of Order",
"orderMarket": {
"id": "UK"
},
"brandOrderStatus": {
"id": "LLA"
}
}
Endpoint 2 : /order?expand=true
{
"orderNo": "12345",
"orderDetail": "Description of Order",
"orderMarket": {
"id": "UK",
"descr": "United Kingdom",
"lang": "en-GB"
},
"brandOrderStatus": {
"id": "LLA",
"descr": "Some Status Description",
"lang": "en-GB"
}
}
Endpoint 3 : /order?expand=true&include=feature
{
"orderNo": "12345",
"orderDetail": "Description of Order",
"orderMarket": {
"id": "UK",
"descr": "United Kingdom",
"lang": "en-GB"
},
"brandOrderStatus": {
"id": "LLA",
"descr": "Some Status Description",
"lang": "en-GB"
}
"_embedded": {
"features": [
{
"id": "AJS",
"type": "FeatureType",
"descr": "FeatureDescription",
"prices": [
{
"type": "msrpNetPrice",
"amount": 0.00,
"currency": "GBP"
}
],
"group": "null"
}
]
}
}
I tried using OneOf, but don't really think that will work in this case as the structure is changing with every optional parameter.
Any thoughts as how this can be documented in Swagger documentation ? Or any other idea to get this documented.
Writing test for a little API. Test for GET method working, but for create an error is being called. What could be the problem? i may guess the wrong data format is using.
class CoursesTest(APITestCase):
def setUp(self):
self.course_url = reverse('course-group')
User.objects.create(username='test111', password='123456')
def test_courses_post(self):
data = {
"name": "Blasssbla",
"description": "blabla",
"logo": "img",
"category": {
"name": "Baling",
"imgpath": "img"
},
"contacts": [
{
"status": 1
}
],
"branches": [
{
"latitude": "2131ssss2321",
"longitude": "12321321",
"address": "Osssssh"
}
]
}
self.response = self.client.post(self.course_url, data)
self.assertEqual(self.response.status_code, status.HTTP_201_CREATED)
Error:
AssertionError: Test data contained a dictionary value for key 'category', but multipart uploads do not support nested data. You may want to consider using format='json' in this test case.
If your test data is JSON, you should add format="json" to self.client.post.
class CoursesTest(APITestCase):
def setUp(self):
self.course_url = reverse('course-group')
User.objects.create(username='test111', password='123456')
def test_courses_post(self):
data = {
"name": "Blasssbla",
"description": "blabla",
"logo": "img",
"category": {
"name": "Baling",
"imgpath": "img"
},
"contacts": [
{
"status": 1
}
],
"branches": [
{
"latitude": "2131ssss2321",
"longitude": "12321321",
"address": "Osssssh"
}
]
}
self.response = self.client.post(self.course_url, data, format="json")
self.assertEqual(self.response.status_code, status.HTTP_201_CREATED)
I'm using the DocuSign API explorer to test the use of tabs for signature. I've created a Word document with a placeholder called /InternSignatureAnchor/ enter image description here
And the JSON request payload looks like this:
{
"documents": [
{
"documentBase64": "<Base64BytesHere>",
"documentId": "123456",
"fileExtension": "DOCX",
"name": "Freelance Contract"
}
],
"emailSubject": "Please Sign Contracts 3",
"recipients": {
"signers": [
{
"email": "dummy_email123#mmmm.mmm",
"name": "Dummy Recipient 1",
"recipientId": "1",
"roleName": "Internal Signatory",
"routingOrder": "1",
"tabs": {
"signHereTabs": [
{
"documentId": "123456",
"pageNumber": "1",
"tabLabel": "/InternSignatureAnchor/",
"xPosition": "0",
"yPosition": "36"
}
]
}
},
{
"email": "dummy_email321#mmmmm.mmm",
"name": "Dummy recipient 2",
"recipientId": "2",
"roleName": "External Signatory",
"routingOrder": "2"
}
]
},
"status": "sent"
}
When the signatory opens the document to sign, the "Sign" enter image description here
is not placed at the placeholder /InternSignatureAnchor/. When I use the Autoplace feature in DocuSign itself, it does work.
Anyone an idea?
Thanks in advance.
The "tagLabel" will just add a label to a tag. To use AutoTagging you'd need to use a json like below:
"tabs": {
"signHereTabs": [{
"anchorString": "Please Sign Here",
"anchorXOffset": "1",
"anchorYOffset": "0",
"anchorIgnoreIfNotPresent": "false",
"anchorUnits": "inches"
}]
}
I believe API explorer does not show the fields for auto tagging currently - so you'd need to perhaps use Postman to play around with this feature.
my goal is to create a test in Zephyr for Jira using API. I found something like this on the internet
"fields": {
"issuetype": {
"name": "Test"
},
"project":
{
"key": "TP"
},
"summary": "Test From API",
"description": "",
"assignee": {
"name": "Some Name"
},
"customfield_10014": "SOMEKEY",
"duedate": "2018-10-03",
"priority": {
"name": "Medium"
},
"labels": ["label1", "label2"],
"customfield_19416": "50h",
"customfield_19719": {
"value": "minor"
},
"customfield_11101": [
{
"Test Step": "some text",
"Test Data": "some text",
"Test Result": "some text"
},
{
"Test Step": "some text",
"Test Data": "some text",
"Test Result": "some text"
},
{
"Test Step": "some text",
"Test Data": "some text",
"Test Result": "some text"
}
]
}
I have really no idea what API should I use.
Recently I was able to create test cycle using the following API
https://prod-api.zephyr4jiracloud.com/connect/public/rest/api/1.0/cycle
which can be found on this page
https://zfjcloud.docs.apiary.io/#reference/cycle
Unfortunately I can't find similar API for test creation. Is it possible?
PS: I am using Authorization, Content-Type, zapiAccessKey headers, where Authorization is JWT key
Thanks for the tips
Create an issue in JIRA via the API's. Select the issue type as Test.
https://support.smartbear.com/zephyr-squad-server/docs/api/how-to/create-tests.html
POST /rest/api/2/issue
The above request will give you an ID that is internal to JIRA. Not the one that gets displayed in UI for any Issue/ticket that is created.
Extract this ID field and then
Create the test steps.
https://support.smartbear.com/zephyr-squad-server/docs/api/how-to/add-steps-to-tests.html
POST /rest/zapi/latest/teststep/{issueId}
I don't want to echo the contents on smartbear website.
Hence, this high level workflow solution for your implementation.
When I try to create a new account using the API I am getting this error:
{ "error": "internal_server_error", "error_description": "No site id
was found for region: None", "reference_id":
"e2ff6d67-119e-4b04-9325-512047e5baf5" }
My payload is:
{ "accounts": [ {
"address": {
"street_address": "santendar",
"locality": "santendar",
"region": "spanish area",
"country": "ESP",
"postal_code": "34567",
"phone": "12345"
},
"admin_user": {
"email_address": "abhistar002#gmail.com",
"first_name": "test",
"last_name": "team",
"job_title": "somejob"
},
"name": "testAccount",
"plan_id": "**********************",
"website": "example.com",
"reseller_id": "***********",
"customer_id": "************",
"paid_seats": "2"
} ] }
Which worked before. I have created many accounts using this API structure.
Any suggestions how to resolve this issue?
IF you look at this https://developers.docusign.com/esign-rest-api/reference/Accounts/Accounts/create you'll see that the Address part of your call is a bit different and should look like this:
"address": {
"street1": "sample string 1",
"street2": "sample string 2",
"city": "sample string 3",
"state": "sample string 4",
"zip": "sample string 5",
"phone": "sample string 6",
"fax": "sample string 7",
"country": "sample string 8"
}