ChromeDevTools / timeline-viewer

View DevTools Timeline trace files from Google Drive wicked easily
https://chromedevtools.github.io/timeline-viewer/
Other
327 stars 44 forks source link

Improve simple tests #42

Closed denar90 closed 7 years ago

denar90 commented 7 years ago

Let's see how it works with CI.

denar90 commented 7 years ago

wow wow wow, it works 🎉 hope after merging CI for master will also pass 🤞

paulirish commented 7 years ago

lets find out!

denar90 commented 7 years ago

AAAAAAAND YEEES!!!! https://travis-ci.org/ChromeDevTools/timeline-viewer/builds/275618111 💃 💃 💃

paulirish commented 7 years ago

sweeeeeeet.

i'm reading https://docs.cypress.io/guides/references/best-practices.html#Unnecessary-Waiting but not entirely sure what we'd want to do here..

it seems like we await the beforeEach to finish? and the visit() should resolve when onload fires... and #auth is in the HTML so DCL or onload definitely will have the element...

kinda weird.

denar90 commented 7 years ago

it seems like we await the beforeEach to finish?

I think it will wait only for one. I added this wait to just skip collision we had before while failing/passing, but maybe it was test case written wrong. In any case, we will improve this stuff.

and #auth is in the HTML so DCL or onload

I hope so, but we are loading resources like gapi after onload and then detect user authorized or not. So maybe wait in this case will be useful. Correct me if I'm wrong, please)

paulirish commented 7 years ago

loading resources like gapi after onload

ah true.

yah true. it has to do an XHR after onload before it flips on the button:

image

FWIW the URL it's fetching is

https://accounts.google.com/o/oauth2/iframerpc?action=checkOrigin&origin=https%3A%2F%2Fchromedevtools.github.io&client_id=963139201929-9do1gni449dij7611muu9to5d0b6p9gh.apps.googleusercontent.com

at the very least we could wait more like 200ms (after onload) since this shouldnt take too long. but maybe we can make it more specific.

denar90 commented 7 years ago

👍