-
Notifications
You must be signed in to change notification settings - Fork 15
Conversation
Nice! I'm glad to get a lot of this stuff moved into the webdriver library. Regarding the change from I don't care that much, so feel free to keep it in By the way, is |
Right true -> pure unit | ||
_ -> throwError $ error "spying is inactive" | ||
|
||
-- | Get recorded xhr stats. If spying has not been setted will raise an error |
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.
--> "If spying has not been set, this will raise an error"
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.
fixed
It's last commit of |
@cryogenian Ah, thanks! I had naïvely pasted that path into GitHub, forgetting that their URLs don't quite work in the way I expected. |
a5ef517
to
6f00c1a
Compare
6f00c1a
to
f3ddc35
Compare
My 2 cents: Since almost everything in this lib is |
OK; 👍 from me. By the way, with regard to things like spying on requests and waiting until some request is responded to, I wonder if this is the kind of thing that we actually want to be doing in tests. It results in our tests making intensional (implementation-sensitive) observations about our app, whereas for predictability & non-fragility, purely extensional observations seem better. Here are a few examples:
Perhaps I've misunderstood the purpose/use-case of spying on requests though... |
Yeah, it feels a bit like mocking, which I hate. Tests should care about what happens not how. That said, I don't know what the use cases are, so hard to say for sure. |
@jdegoes Yeah... By the way, I think it's fine to have this tool in the library, since someone may find it useful. But we may want to take a look at our own tests (separately from these PRs) and see if it is the best way to accomplish what we want. One thing I worry about is that it might cause subtle timing issues, resulting in spurious test failures. For instance, if we wait until a request completes and then proceed to another test, we have made the tacit assumption that a UI transition that makes the next test applicable will have occurred simultaneously with the completion of that request, which is not the case. If the test proceeds in the window between request completion and UI transition (and this will be non-deterministic in general), we'll have a very frustrating thing to debug 😬 EDIT fixed typos |
We test not only UI, but all browser related things as well. Checking that In fact all our tests are implementation sensitive. That's why there is huge config 😄 |
Well, the point is, if the Anyway, is this ready for merging??? |
@cryogenian I guess I don't believe that we should be testing things like that request at all... Additionally, I think we have to draw the line somewhere (and it will be arbitrary, I know) for what things are considered "user observable" and "mere implementation details". My perspective is that it is reasonable to draw the line at "stuff in the HTML"; so, the stuff we have in the config, namely CSS classes, etc., should be considered observable, whereas what particular network request we send should not be considered observable. |
If @cryogenian is ready for this to be merged, I give my 👍 |
I think it can be merged. |
@cryogenian I don't think that we should be testing that mongodb content has changed in the frontend tests at all... |
@jonsterling Heh, I've the very similar discussions couple times before 😄 |
combinators, spy-xhr, reader interface
Selenium
module and webdriver method names.PUT
request will be replied)Eff
toAff
insetFileDetector
, it's not really necessary, but all other functions in that module areAff
scryogenian/slamdata#245d2e6c6de65b897a1a102724a9d32cd953b8f7