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

SPA without Page navigation events? #52

Open
kohlerm opened this issue Sep 10, 2019 · 5 comments
Open

SPA without Page navigation events? #52

kohlerm opened this issue Sep 10, 2019 · 5 comments

Comments

@kohlerm
Copy link

kohlerm commented Sep 10, 2019

I'm trying to automate a test with puppeteer where I generate a har file after each interaction step.
Since it is an SPA I do not get Page navigation events. Because of that I do not get any results except for the intial page where I do have a page event. During debugging I could see that the events are captured but the nr. of pages is 0.
It also does not seem to be related to puppeteer because I checked the events when manually navigating the page.

Any hints what I can do?
I can maybe clone the code and throw out all page event handling, because effectively I do not need those events.
Any better option?

@soulgalore
Copy link
Member

soulgalore commented Sep 11, 2019

Hi @kohlerm in Browsertime we inject a navigation event in the trace, I think you should do that in the trace from Puppeteer too.

Best
Peter

@nathdebashish
Copy link

I'm trying to automate a test with puppeteer where I generate a har file after each interaction step.
Since it is an SPA I do not get Page navigation events. Because of that I do not get any results except for the intial page where I do have a page event. During debugging I could see that the events are captured but the nr. of pages is 0.
It also does not seem to be related to puppeteer because I checked the events when manually navigating the page.

Any hints what I can do?
I can maybe clone the code and throw out all page event handling, because effectively I do not need those events.
Any better option?

interested to know how to resolve for SPA..

Thanks
Debashish

@kohlerm
Copy link
Author

kohlerm commented Sep 25, 2019

Hi @nathdebashish sorry for the late reply, missed your comment.
I forked chrome-har https://github.com/kohlerm/chrome-har made some changes to inject a fake navigation event. I also had to add some sanity checks to avoid exception in case some data was missing. This might have been be caused by the fact that my test does not always wait long enough after each interaction. for the one test I'm currently running it is working fine. I would not call it production ready ;-)

@soulgalore
Copy link
Member

The problem is that the trace log events aren't sorted and can come in different order. For example if you test two pages, clear the log after each URL but keep Chrome open, it can happen that you get an event for the first URL when you test the second one, that breaks Tracium for example, and I think we haven't had the best handling for that either. @kohlerm if you have some better error handling than today it would be super if you could PR it back :)

@kohlerm
Copy link
Author

kohlerm commented Sep 25, 2019

I ran into sitespeedio/sitespeed.io#2645 and fixed it in similiar way.
got a few merge conflicts need to sort those out. I had for example sometimes the problem that there was no response, which resulted in an exception.

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

3 participants