Get around cy.downloadFile throwing a self signed certificate error - cypress

I've been using cypress-downloadfile all day to download a file from the testing site, now all of a sudden the test is failing right on the test with the following error.
request to https://www.site.ca/ExportCase.ashx?id=a3607228-892a-6afc-a007-ff0000973b9b failed, reason: self signed certificate
The plugin seems to be failing here
return cy.task('downloadFile', {
Gives me a Learn More Link over to https://docs.cypress.io/api/commands/task
I'm on 12.4.0... Tried on 12.3.0, same deal

Related

SKProductsRequest fails in Xcode 12 GM in UI Tests and SKTestSession

When I run SKProductsRequest from UI Tests session in Xcode 12 GM, it always fails with this error:
Error Domain=SKErrorDomain Code=0 "UNKNOWN_ERROR" UserInfo={NSLocalizedDescription=UNKNOWN_ERROR, NSUnderlyingError=0x600003d30f30 {Error Domain=ASDErrorDomain Code=507 "Error decoding object" UserInfo={NSLocalizedDescription=Error decoding object, NSLocalizedFailureReason=Attempted to decode store response}}}
I tried to use SKTestSession with valid .storekit configuration file, but it didn't help. Though in my Unit Tests this works fine with SKTestSession.
Is there a way to test store in UI tests in Xcode 12 GM? Or SKTestSession is usable only in Unit Tests?
So after few days of digging seems like I found out what to do to make it work. You just need to add some delay before running SKProductsRequest at app launch. I set 5 seconds delay just for UI tests — and that's it! Now my request works!
That's the line needed for the request to run without errors:
// Wait for StoreKitTest
Thread.sleep(forTimeInterval: 5)
// Start request
request.start()

Using HttpClient to access Web API issue (certificate?)

I have been following this link to understand how to use HttpClient to call a Web API Method.
https://www.tutorialsteacher.com/webapi/consuming-web-api-in-dotnet-using-httpclient
The code of interest in the article is below with ‘client’ being the HttpClient object:
client.BaseAddress = new Uri("http://localhost:60464/api/"); //HTTP GET
var responseTask = client.GetAsync("student");
responseTask.Wait();
var result = responseTask.Result;
Error results as follows:
System.AggregateException: 'One or more errors occurred. (Failed to connect to localhost/127.0.0.1:443)'
Please understand my background in networking, IIS and the like is very limited.Most of my time is spent in code and SQL Sprocs. This is a personal project so I have to get this setup myself
If I replace localhost with my machines IP I get the following error:
One or more errors occurred. (java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.)'
So two questions:
How do I install this needed certificate or settings or otherwise (again no idea about this configuration network stuff) but I do have IIS up and running with the Web API hosted and working
If using ‘localhost’ is not supposed to work, what might be the reason this article is using it?
This is only for a personal development machine, yes at some point I am going to want it to work in the real world but for now I just need to get some ‘hello world’ stuff going before the end of times.

Authentication error "The UserNameOrEmailAddress field is required"

The last few days I have been busy making a project in ABP, yesterday I spent the whole day working on it and everything was up and running when I went home. Today I started up the project (from another location) and now I get this pop-up window error when logging in:
The UserNameOrEmailAddress field is required.
I checked in the console and it gave 2 errors:
POST http://localhost:21021/api/TokenAuth/Authenticate 400 (Bad Request)
and:
ERROR Error: An unexpected server error occurred.
at new SwaggerException (service-proxies.ts:4308)
at throwException (service-proxies.ts:4328)
at MergeMapSubscriber.project (service-proxies.ts:1618)
at MergeMapSubscriber.push../node_modules/rxjs/_esm5/internal/operators/mergeMap.js.MergeMapSubscriber._tryNext
(mergeMap.js:60)
at MergeMapSubscriber.push../node_modules/rxjs/_esm5/internal/operators/mergeMap.js.MergeMapSubscriber._next
(mergeMap.js:50)
at MergeMapSubscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber.next
(Subscriber.js:54)
at Observable._subscribe (service-proxies.ts:4334)
at Observable.push../node_modules/rxjs/_esm5/internal/Observable.js.Observable._trySubscribe
(Observable.js:42)
at Observable.push../node_modules/rxjs/_esm5/internal/Observable.js.Observable.subscribe
(Observable.js:28)
at MergeMapOperator.push../node_modules/rxjs/_esm5/internal/operators/mergeMap.js.MergeMapOperator.call
(mergeMap.js:28)
I am logging in with the proper credentials and if I run the authenticate method with those same credentials on Swagger UI I get a 200 OK response. Perhaps this has something to do with me running the program on a different location?

Bypassing "Insecure Content Blocked" with Selenium Ruby script

I am fairly new with using Selenium in my Ruby script. Basically my script will make a get request to some url and log in. However my script is failing to send the email and log in automatically due to the Google Chrome pop up about insecure content blocked since one of the images on the page is using http and not https.
I was able to run the script successfully months ago however just recently when trying again, it is unable to proceed with logging in so I dont know why it stopped working all of a sudden.
The error that I see in terminal is this. In irb, I can go through each line of code successfully including using Selenium's "send_keys" and "click" to automatically sign in.
[2018-09-26T13:02:55.002527 #14131] INFO -- : [#http://company.com/favicon.ico'. This request has been blocked; the content must be served over HTTPS.">]
web_app.rb:54:in `': Console Errors Found! (Exception)
I tried searching for some solution but have been unsuccessful. There has been some variations of responses to similar problem but not too much luck with getting it to work.
Any feedback on how to fix would be appreciated.
start Chrome manualy and disable the warning - https://www.thewindowsclub.com/disable-insecure-content-warning-chrome
and use the set browser profile, there is my setup:
#BeforeClass
public static void setUpClass() {
System.setProperty("webdriver.chrome.driver", "C:\\Users\\pburgr\\Desktop\\chromedriver\\chromedriver.exe");
ChromeOptions options = new ChromeOptions();
options.addArguments("user-data-dir=C:\\Users\\pburgr\\AppData\\Local\\Google\\Chrome\\User Data");
driver = new ChromeDriver(options);
driver.manage().window().maximize();}

Parse related remote calls failing in app

I have developed an Ionic Framework App using Parse which works great on my desktop browsers. No errors or warnings in the browser console.
But when I package the app and test in on my actual Android 4.4.4 device, the Parse related functionalities does not work. When I tried to debug the App by installing the .apk using GapDebug tool, I see the below in the console.
POST https://api.parse.com/1/login net::ERR_CACHE_MISS
POST https://api.parse.com/1/requestPasswordReset net::ERR_CACHE_MISS
Below is the complete console log details for the Parse Login activity.
POST https://api.parse.com/1/login net::ERR_CACHE_MISS parse-1.3.3.min.js:1
b._ajax parse-1.3.3.min.js:1
b._request parse-1.3.3.min.js:1
b.User.b.Object.extend.logIn parse-1.3.3.min.js:3
b.User.b.Object.extend.logIn parse-1.3.3.min.js:3
$scope.validateUser login.controller.js:22
$parseFunctionCall ionic.bundle.js:20124
(anonymous function) ionic.bundle.js:50863
Scope.$eval ionic.bundle.js:22178
Scope.$apply ionic.bundle.js:22276
(anonymous function) ionic.bundle.js:50862
jQuery.event.dispatch jquery.js:4409
elemData.handle jquery.js:4095
triggerMouseEvent ionic.bundle.js:2811
tapClick ionic.bundle.js:2800
tapTouchEnd ionic.bundle.js:2918
POST https://api.parse.com/1/requestPasswordReset net::ERR_CACHE_MISS
For getting all the data for a particular class, I get the below failure object.
Failed to load resource: net::ERR_CACHE_MISS https://api.parse.com/1/Items
XMLHttpRequest failed: {"statusText":"","status":0,"response":"","responseType":"","responseXML":null,"responseText":"","upload":{"ontimeout":null,"onprogress":null,"onloadstart":null,"onloadend":null,"onload":null,"onerror":null,"onabort":null},"withCredentials":false,"readyState":4,"timeout":0,"ontimeout":null,"onprogress":null,"onloadstart":null,"onloadend":null,"onload":null,"onerror":null,"onabort":null}
The issue was with permission. It was failing because the app was not able to connect to internet.
Somehow the Network Access permission entry got deleted in the manifest file. After adding it to manifest, it worked.

Resources