Skip to content
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

Website that breaks during load has a score too high #56

Closed
stephanebachelier opened this issue Feb 27, 2015 · 5 comments
Closed

Website that breaks during load has a score too high #56

stephanebachelier opened this issue Feb 27, 2015 · 5 comments

Comments

@stephanebachelier
Copy link

In my case it's an SPA and it fails to load: screenshot is white.
The score is set to 77/100 but it is based on wrong data, as the console show 5 JS errors which prevent the site from loading correctly, hence the white page.

@gmetais maybe adding a threshold for JS errors, or catching white screen may prevent YellowLabsTools from giving a score ?

@gmetais
Copy link
Collaborator

gmetais commented Feb 27, 2015

There is a true problem with this kind of errors, only happening in PhantomJS and not on real browsers.
In this case, it's not the fault of the webpage, so YLT shouldn't give it a bad score.

The problem is, we can't detect if the error comes from PhantomJS. For this reason, I don't think adding a threshold is a solution. What if it's a webpage with many real errors? What if a SPA fails with only 1 error?

Detecting a white screen could be a solution, but even SPAs rarely fail on a completely white screen. Any other idea?

By the way, what MVC framework do you use?

@stephanebachelier
Copy link
Author

@gmetais thanks for your comment. Indeed errors are only occuring in PhantomJS.

I've tested with 3 differents projects which are Single Page Application and all of them fail with white screen and at least one JS error. One is currently supporting old browsers and it is tested with PhantomJS, and served with https.

Is it possible to tweak some parameters like a timeout ?

For the score I would argue that a failure should not give a score at all, as lots of results are based on partial page loading, like the number of DOM elements, etc. But it's not about yellowlab.tools and more a PhantomJS issue or related to its configuration.

What do you think ?

@gmetais
Copy link
Collaborator

gmetais commented Feb 28, 2015

Good morning Stephane :)

I've tested with 3 differents projects which are Single Page Application and all of them fail with white screen and at least one JS error.

I'm not very confident about coding a white image detector, not sure it is as easy as it seems... Do you have time to dig into this?

One is currently supporting old browsers and it is tested with PhantomJS, and served with https.

PhantomJS 2 should fix many of these JS errors. The "function.prototype.bind" error at least (ariya/phantomjs#10522). It's going to be implemented soon in Phantomas, than YLT.

What version of PhantomJS are you using for testing your project?

Is it possible to tweak some parameters like a timeout ?

Not sure I understand. Is it about making Phantomas wait a little more so your apps have enough time to retrieve the Ajax data?

For the score I would argue that a failure should not give a score at all, as lots of results are based on partial page loading, like the number of DOM elements, etc.

I agree with that if we have a reliable way to detect a failure.

@stephanebachelier
Copy link
Author

@gmetais Good morning :)

Not sure about a white image detector too. It's clearly not an easy task. I'll need to dig into your codebase.

I know about the function.prototype.bind not supported by PhantomJS 1.9.x, which means no es5, or adding a polyfill for running in PhantomJS.

The project which is tested with PhantomJS is written in es4 and it works but with longer timeout to avoid PhantomJS returning an error. The JS errors shown into YellowLab are more about undefined function, which I think are scripts not fully downloaded.

@stephanebachelier
Copy link
Author

@gmetais closing this issue. Maybe create another issue when a better idea will emerge :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants