jamesshore / quixote

CSS unit and integration testing
Other
848 stars 45 forks source link

QFrame.reload() (addresses #18) #19

Closed cognivator closed 8 years ago

cognivator commented 8 years ago

Added a frame.reload() method to QFrame.

New Unit Tests

jamesshore commented 8 years ago

Thanks for this. I hope to have a chance to look at it this weekend.

jamesshore commented 8 years ago

Addresses #18.

jamesshore commented 8 years ago

By the way, I haven't forgotten this. I reviewed the code last week and it all looks good, although I haven't tried it yet. I'm currently working on the 0.10 (documentation) release, then I plan to make this the centerpiece of the 0.11 release.

xidui commented 8 years ago

This framework seems not so friendly with Angularjs: 1.I use a list(with size of 3) to make 2-dircetion binding 2.an event happen and I use $scope.$apply to make the view to change 3.but the frame does not detect the change of the view, whenever I call contactList = frame.getAll("#contacts ul > li"); it always contains 3 elements but actually the original list contains more than 3 elements.

do you have any idea about that? I have tried your reload method, but it just reload the view and always make it "3", I want the frame to automaticaly detect the change.

or is there any walk around?

jamesshore commented 8 years ago

@xidui, Can you move this to its own issue?

I'm not sure what's happening here, but my best guess is that you're experiencing a race condition of sorts with Angular. In other words, the view's not changing right away, so when you call frame.getAll(), you're getting the results before Angular changes the list.

One way to test this would be to wrap the code that follows $scope.$apply in a setTimeout(). That's not a good general solution, but it will help you troubleshoot.

Another troubleshooting step is to manually look at your test in the browser and see if there's any console errors or other issues, and if visually the frame looks right.

cognivator commented 8 years ago

Thanks, @jamesshore!