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

[5.0] store the source of the browser #705

Closed
wants to merge 3 commits into from
Closed

Conversation

browner12
Copy link
Contributor

I can't tell you how many times I've clicked on the screenshot of a failed test trying to interact with it...

This will allow us to dig through the full source code of the browser at the point in time of the failures, which can help with debugging.


2 questions to ask:

  • Should we store the source only on failures or for all tests? Currently I'm storing it for all tests.
  • What extension should we use for the file? For now I picked .txt, but I'm considering .html.

My grand master plan is to maybe proxy this code somehow so people can pull up the failure in their browser and actually interact with it.

when the test completes it will store the final source code in a directory, same as it does for the console log output.

- add a new static property to store the path for where the files should be stored
- new method that gets the source from the driver and saves it to the filesystem
- store the source after a test has completed.  there could be some discussion here on whether we do it only for failures or all tests.
@SjorsO
Copy link
Contributor

SjorsO commented Dec 16, 2019

Does this also work for SPAs? Or does this only work for "normal" blade/html pages?

@taylorotwell
Copy link
Member

I don't think we would want to the source code every test? Seems like a lot of wasted space?

@browner12
Copy link
Contributor Author

@SjorsO I don't see why it wouldn't. I guess I'm not positive how the driver gets the source code, whether it's the source at the load of the page or if it takes into account all the changes made during the execution of the page.

@taylorotwell I can move this into the catch blocks if you'd like. One of the issues I'm running into right now is if the code is in the catch block, it is only executed on Errors and not on Failures. If we could figure out a way to execute on Failures, that would be best.

@browner12
Copy link
Contributor Author

do you guys handle new merge conflicts that pop up, or should I go in and do that?

@driesvints
Copy link
Member

@browner12 best if you rebase yourself

@taylorotwell
Copy link
Member

Personally I think I would make this a method on the browser that immediately takes a snapshot of the source and stores it. Then, if you have a test that fails you can just pop this method onto the browser somewhere and grab the source. Then we don't have to worry about storing the source on every test or every failure, etc.

You would just end up using when you need to similar to "dd" etc.

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

Successfully merging this pull request may close these issues.

4 participants