Verify appium current activity response - android-activity

I verify launched current activity if it's in browser or in app by comparing with current activity.
activity = driverAppium.current_activity
And then I verify if activity matches with browser activity name e.g. org.chromium.browser...
But can I verify the http response on the webpage e.g. 200 or 404?
With above test always passes even though webpage didn't load or get null response.
Can I verify with current activity and response both?

There are two ways to do it what I can think of,
UI prospect :
Capture the screenshot of the webview with 200 response. Let's call it expectedScreen.png
Capture the screenshot of the under test response(be it 200, 400 etc.). Lets call this finalScreen.png
Compare both the images to verify/assert.
API prospect : Since the Activity suppose to be displayed shall never/rarely be changed depending on transitions between different activities on your application as designed, so verifying current activity is a less important check during the test. You can rather verify these using API calls and then(if you get proper response) look for presence of elements on screen accordingly.

Related

Azure data factory pagination doesn't work

I am working on a pipeline which executes oAuth2 flow in order to access REST API json data. Once I have the bearer token I am executing a request which returns the following structure:
As you can see, since the response is quite large, there's paging enabled and as part of the response I get a link to the next page. In order to get to that resource I need to also present MS-ContinuationToken in the headers. So, this is how I basically do it in the config of the Copy activity that I use to get the data from the REST endpoint:
and the issue here is that I only get the first 2000 rows and the next page(s) don't seem to be visited at all. Pipeline executes successfully and only the first 2000 items are fetched.
NOTE: continuationToken and links.next.headers.value have the exact same values from the initial response.
Even if you fix the other issue you’ll have an issue with the “next” URL not including “v1”. This is a known issue in the partner center api team. I’ve escalated it pretty high. But they don’t want to break backwards compatibility by changing the “next” URI to include the v1 or to be relative. They are considering other options but I wouldn’t hold your breath.
I would ditch the idea of using data factory and instead write a .NET console app using the partner center SDK
(You might think to paginate manually with loops etc but the Copy activity doesn’t return eg the http headers, so you will need a complex set up to somehow store the data in a data store and be able to look up the last page in order to get the continuation token. I couldn’t figure it out)

Get the Status of the Azure AS via REST API in logic apps

I send a http PATCH request to scale out my Azure AS. (Step 1)
After that I would like to wait until the AzureAS is successfully scaled out and then go to step 2.
Is it possible to read the status of AzureAS via REST API?
Yes you could use the Get details of a serve Rthomas529 mentioned. I test it with postman, it includes ProvisioningState and State.
From your description, I think what you want is in the logic app add an action to get the state then judge whether do the next action. So you could add a HTTP action with GET method to get the server details.
Then use a Compose action to output the HTTP body, next step is get the state value and judge it. You need to go to Code View change the value to #outputs('Compose')['properties']['state'] and the equal value you could choose the all you could get and the supported state, you could check it here.
Then you will be able to add different actions between If true and If false.
And here is my result.

Work Item transition is not returned in VSTS with Rest API

For some reason I cant't get the transitions (next available states) for a work item with a rest call.
I tried exactly what is in the document:
transitions
Here is my REST call:
BASE_URL/_apis/wit/workitemtransitions?ids=14&api-version=4.1-preview.1
The BASE_URL works with other calls, the id 14 could be loaded also, so it exits, but i don't get back any result if i want to get the transitions(Usual Page not found is returned).
What is the problem here?
Tested on my side and everything works as expected.
Generally if the base url is incorrect you will receive the Page not found message. So please double check if you have entered the correct base url... (maybe a typo?)
Another possibility is that no transitions defined for the specific work item type...

FlowRouter Reload Doesn't Route

I'm using FlowRouter. If I start on the homepage everything works well. I can work through the routes (change the pages) without problem. However, if I hit refresh in the browser, I get a series of errors. My url looks like this:
/story/586d536e34821281735b53a4
The ID is being returned in console under the following method:
Tracker.nonreactive(function(){
I think the subscription is being completed, so I'm a little confused as to why reloading a url is different than loading from the home page.
What am I not understanding here?
Reloading a url will make a HTTP request to server to get all the application source. Whereas navigating to a route from another one does not make any HTTP requests to get the application source because they are already available (they were loaded from the previous route), in this case the router will just get the appropriate content and render on the page. This is normal behaviour for Meteor apps and all other single-page apps
The error you encounter is because your data is not yet available on client, to fix it you could simple use a placeholder if the value is undefined.

grails show wait page on form submit

I have a form that the user submits and returns a result, but it takes a couple of seconds to return the result. I know I can use grails formRemote http://grails.org/doc/latest/ref/Tags/formRemote.html to execute the call asynchronously and update a div on the page, but what I want to do is show another page entirely (with some wait graphics and other information).
Is there an easy way to do this in grails?
You can send data to server asynchroniously (ajax, formRemote), showing 'wait graphics' util you get a response. And redirect to result page right after getting response (and you should have to store state somewhere, and probably have unique url for result page)