uncaught exception : Experience not defined when testing a Shopify web app using Cypress - mocha.js

I'm writing automated tests for a Shopify application using cypress
When I finish filling the cart with items then click on the checkout button, I got this kind of error that prevents me to go to the checkout page :
(uncaught exception) Error: undefined status[500] response [{"message":"Experience not defined"}]
The following error originated from your application code, not from Cypress.It was caused by an unhandled promise rejection.
>undefined status[500] response [{"message":"Experience not defined"}]
When Cypress detects uncaught errors originated from your application it will automatically fail the current test.
This behavior is configurable, and you can choose to turn this off by listening to the uncaught:exception event.
This is the line when it heppens :
cy.get('.cart__checkout-form >
.button').scrollIntoView().click({force:true});

Related

Cypress detects cross origin error on test that does not leave main origin

I've been running into a problem with Cypress (currently v8.3.1 but this has been a constant for years) where my test detects a cross origin error on page load, but I am 99% certain that shouldn't apply.
The test logs into a web application and attempts to access a project.
cy.visit(webapp) //login page
cy.login(userCreds) //enter user cred and access main page
cy.get(projectAcccessButton).click() //access project from main
As the project page loads, Cypress throws the cross origin error below. I've been using the "chromeWebSecurity": false workaround, but it does not apply to Firefox. Firefox test coverage is on the "2022 To Do" list, so I am turning to Stack for answers - I hope.
What I want to do: Access the project page without issue.
What has been happening: cross origin error on page load
Permission denied to access property "document" on cross-origin object
I mentioned that the cross origin error likely shouldn't apply because when I modify the test to access the project page via cy.visit(), Cypress does not throw an error.
cy.visit(webapp) //login page
cy.login(userCreds) //enter user cred and access main page
cy.visit(projectPage) //access project via url
This leads me to believe something is happening on the button click that is somehow triggering the cross origin error. Is it possible that the button attribute onclick="window.location.href='/projectManager/123456789'" is somehow being interpreted as leaving the main origin?
If this error is related to the window.location.href, how can I resolve this so Cypress doesn't detect an error when running in Firefox?
Full Error Message:

Getting error while trying to upload a file in cypress

I am trying to automate file uploading via cypress but getting the error below.
I am not finding the root cause of the issue.
enter code here
The following error originated from your application code, not from Cypress.
Script error.
Cypress detected that an uncaught error was thrown from a cross origin script.
We cannot provide you the stack trace, line number, or file where this error occurred.
Check your Developer Tools Console for the actual error - it should be printed there.
It's possible to enable debugging these scripts by adding the crossorigin attribute and
setting a CORS header.
When Cypress detects uncaught errors originating from your application it will automatically
fail the current test.
This behavior is configurable, and you can choose to turn this off by listening to the
uncaught:exception event
Below is my code
it('Single File Upload-DOM', () => {
cy.visit('http://127.0.0.1:5500/Help%20Folder/fileupload.html')
cy.get('#file-upload1').attachFile('dog_small.jpg')
cy.get('span#fileName1').should('have.text','dog_small.jpg')
});
You can turn off the exception check globally by writing:
Cypress.on('uncaught:exception', (err, runnable) => {
return false
})
under cypress/support/index.js

How to fix Redux error: Minified Redux error #12

I've just upgraded all my react native app packages and now I'm getting this error when running the app in Xcode:
INFO : BSG_KSCrashReport.c (1513): void bsg_kscrashreport_writeStandardReport(BSG_KSCrash_Context *const, const char *const): Writing crash report to /Users/Library/Developer/CoreSimulator/Devices/123/data/Containers/Data/Application/123/Library/Caches/KSCrashReports/foo/foo-123.json
2021-06-23 15:18:32.196550+1000 foo[12206:1933872] *** Terminating app due to uncaught exception 'RCTFatalException: Unhandled JS Exception: Error: Minified Redux error #12; visit https://redux.js.org/Errors?code=12 for the full message or use the non-minified dev environment for full errors. ', reason: 'Unhandled JS Exception: Error: Minified Redux error #12; visit https://redux.js.org/Errors?code=12 for the full message or use the non-minified dev environment for full errors..., stack:
Redux error 12 state:
The slice reducer for key "" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.
I'm using rematch. If I look at all my generateModel functions they all provide a valid initialState.
Where can I start looking to debug this?
I'm a Rematch maintainer, if you want to provide a valid reproduction repo inside Rematch repo or here we'll be happy to help.
Rematch changed a lot internally from v1 to v2, not too much for end users, but probably there's something that you need to fit to make it runnning fine again :)

when exit and enter the app again using a MasterDetailPage, it crashes after a certain amount of times

The first page of my app is a Contentpage where you login or MasterDetailPage if you are already logged in. Even when the app runs fine, if I exit tha app and enter a certain amount of times (sometimes is 2, sometimes even 10), the app crashes and I get the next error message. Java.Lang.IllegalArgumentException: and this appears in crashlytics:
Shutting down VM
FATAL EXCEPTION: main
Fatal Exception: > java.lang.IllegalArgumentException: No view found for id 0x249 (unknown) for fragment FragmentContainer{bbc6fff #0 id=0x249}
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1413)
at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1750)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1819)
at android.support.v4.app.BackStackRecord.executeOps(BackStackRecord.java:797)
at android.support.v4.app.FragmentManagerImpl.executeOps(FragmentManager.java:2590)
at android.support.v4.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2377)
at android.support.v4.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManager.java:2332)
at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2239)
at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:700)
at android.os.Handler.handleCallback(Handler.java:790)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
This only happens when I am in the masterdetailpage, in the login page functions very good
The error was that I make a transition between 2 pages in the code too fast, so one of them didn't finish loading and the other was starting. That was the source of my error. Now that I fixed it I can see it in my emulator android 8.1, but have problems with 7.0 if I know why I will put it in the post.
EDIT:
The error in 7.1 is only when I am trying to installed it again in my phone with debug. The error is the next:
Android.View.WindowManager BadTokenException: Unable to add window token android.os.BinderProxy is not valid; is your activity running?
if you use the app normally after the installation, it works good!

MessageBoxShow on launch of the application

How to show the message box as soon as the application is launched.
I would like to add a welcome message in my application.
Eg:
MessageBox.Show("Welcome");
"Call the Show(String) method from the
OnNavigatedTo(NavigationEventArgs) method. If you call Show(String)
method from the app Activated and Launching event handlers an
InvalidOperationException is thrown with the message Error Displaying
MessageBox."
MSDN Source # http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj206947(v=vs.105).aspx

Resources