close browser upon test error - protractor - jasmine

i'm running protractor tests. if angular is not found or some exception is thrown, the test finishes however, the browser is not closed. this is a problem when running protractor in CI.
i tried using the onCleanUp function in the config file with no success.
any ideas how to close the browser after tests finished?
thanks you

Related

Data appear in Chrome but not in Cypress test runner

My problem is that when im opening website on my computer by chorme everything works fine. But when im using Cypress cy.visit() to reach this endpoint by Cypress test runner, the data not appear..
in runner i always get Null response and have no idea why.
ill try to wait for page to load but its not working. click for module im interested, post and get endpoint. nothing works, table in test runner still opens empty

Why Cypress gives success after second attempt?

In my Cypress tests, I create some data in before block and then my test script is run that locates in it block. I checked business side flow and it seems like there is no error about app side. I just want to understand that why my test's result is success after second attempt. Does Cypress has this kind of solution to handle an error maybe?
Cypress has the ability to automatically retry any failed tests. I would check your Cypress configuration's value for retries.openMode.

Your page did not fire its `load` event within `60000ms` only on Github Actions

I have Cypress tests failing only on Github CI with this error:
Your page did not fire its `load` event within `60000ms`.
I assume this is because the Cypress browser is stuck loading something Github Actions environment is blocking. Tests run fine locally. However, because I do not have access to the browser console, I cannot know what is causing the error.
Based on Cypress the service screenshot the page loaded fine, though.
How can I either
Disable load event check in my Cypress tests, as I assume this is not a real issue
Access JavaScript logs or Network tab logs though Cypress service to confirm what could be the issue in Github Actions run-time environment
This is a SvelteKit based site.
It's not currently possible to opt-out of waiting for the load event: https://github.com/cypress-io/cypress/issues/788

While running the tests, cypress is redirecting

while I am running the tests in cypress, it is redirecting to login page, then remaining tests become fails . What is the reason for that
If the login page in your tests contains another domain - cypress fails the test and stop the scenario.
Here link: https://docs.cypress.io/guides/guides/web-security#Limitations

Is there a way how to set my Cucumber-js to ignore uncaught errors

I am setting up the Cucumber-js (I have migrated Testcafe into Cucumber framework) project which runs well on Chrome and Edge browser. By running on IE 11, the console error causes failing my test scenarios. How to specify in Cucumber-js to ignore uncaught errors? The issue is not reproducible by manual handling or on another browsers as I already mentioned (issue caused by different JQuery version).
I have specified it in
return runner
.src('./test.js')
.screenshots('reports/screenshots/', true)
.browsers(browser)
.run({skipJsErrors: true})
.catch(function(error) {
console.error(error);
});
})
Which works well for me
CucumberJS has no interaction with a browser. It is selenium or protractor that does that kind of operation so it may be better to ask in those StackOverflow communities. I will say that I have not ever seen a browser console error causing browser controlled tests to fail (unless purposefully implemented that way).

Resources