New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Instant log output for failing UI tests and some tweaks on detection of page activity #8094
Conversation
… is loaded or finished doing something
@@ -49,8 +49,6 @@ describe("Login", function () { | |||
|
|||
it("should redirect to login when logout link clicked", function (done) { | |||
expect.screenshot("login_form").to.be.capture("logout_form", function (page) { | |||
page.click("#topBars span.title:contains(superUserLogin)"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did not work before. This was code from when the username opened a dropdown menu
if (!self.aborted) { | ||
self.pageLogs.push('Unable to load resource (#' + resourceError.id + 'URL:' + resourceError.url + ')'); | ||
self.pageLogs.push('Error code: ' + resourceError.errorCode + '. Description: ' + resourceError.errorString); | ||
if (self._isUrlThatWeCareAbout(resourceError.url)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can combine this if w/ the outer one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will do
Is it possible to detect the synchronous request and display a warning in phantomjs? Or even fail the test? Would perhaps help in finding all the synchronous requests. |
Did you try and reduce the default wait time? W/ the new wait detection logic, maybe it could be lowered. |
I haven't reviewed the code diff but the change seems useful (e.g. the example builds you linked to).
👍
Are "images not fully loaded" a problem sometimes? Sounds good in theory but I wonder whether it's worth the effort? |
Not sure what the travis issue is, but when I try to run the ActionsDataTable UI tests locally I get two timeouts. After I finish looking at other PRs, I'll look into this more closely. |
Yes, we will be able to detect much more accurately whether all resources are loaded. Eg we currently do not detect whether |
I don't think we can detect them, I had a quick look. It will be quite a bit of work to refactor them as we will now have to use callbacks everywhere a lot of code needs to be changed. We can just search for |
We should test in a separate branch after all tests are green. It's currently hard to tell since many UI tests fail randomly. It would be awesome if we could lower it |
// why isEmpty(self._resourcesRequested) || !self._getAjaxRequestCount()) ? | ||
// if someone sends a sync XHR we only get a resoruceRequested event but not a responseEvent so we need to | ||
// fall back for ajaxRequestCount as a safety net. See https://github.com/ariya/phantomjs/issues/11284 | ||
self._executeEvents(events, callback, i + 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's an issue here, since it's now a nested if, if the second condition is false, the function just exists. So _waitForNextEvent isn't called again in that case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thx! will update
Instant log output for failing UI tests and improved detection of page activity. Also includes fixed and new menu tests.
mocha spec reporter
and adjusted this one but can still do it later if needed. There's no coloured output for this yet so hope that's okay. It should help us to troubleshoot things.onResourceRequested
,onResourceReceived
, ... This way we would not have to take care of this in core and we can easily print a list of not finished requests at the end of the test. Unfortunately we have somesynchronous
requests and for those requests no "response" event will be triggered meaning we cannot detected that the sync request is finished. Therefore I do now check whether either phantomjs detected that all resources are loaded or our core logic. Once we refactored Rewrite all synchronous XHR as they are deprecated #8020 we can trust PhanomJS. This will allow us to detect more accurately when a page is loaded or stopped being active etc.An example can be seen here :
The tests that fail seem to also fail on master?!?