diff options
author | Clement Ho <clemmakesapps@gmail.com> | 2017-10-12 21:38:52 +0000 |
---|---|---|
committer | Clement Ho <clemmakesapps@gmail.com> | 2017-10-12 21:38:52 +0000 |
commit | 88bd5fa274d0b9d9ccd8be26f83d422517880fe3 (patch) | |
tree | bf87f53b4d689cdb1c9c6e700cdea9771d452e61 | |
parent | 77d636cc164eebeb119943f62b7ca1b837f878a8 (diff) | |
download | gitlab-ce-88bd5fa274d0b9d9ccd8be26f83d422517880fe3.tar.gz |
Update best_practices.md
-rw-r--r-- | doc/development/testing_guide/best_practices.md | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/doc/development/testing_guide/best_practices.md b/doc/development/testing_guide/best_practices.md index b3ce2133161..386fe2a35eb 100644 --- a/doc/development/testing_guide/best_practices.md +++ b/doc/development/testing_guide/best_practices.md @@ -267,15 +267,20 @@ RSpec.configure do |config| end ``` -### Debugging +### Debugging Capybara -If you need to debug Capybara tests, using the following lines, -you can get the current URL of Capybara server, logged in user email. Then you -can add some arbitrary sleep to halt the test and go check out the page. +Sometimes you may need to debug Capybara tests by observing browser behavior. -Default user password is `12345678`. +You can stall capybara and view the website on the browser by adding a long sleep command in your spec and then opening your browser +to the capybara url. -``` +You can get the capybara url by doing `puts current_url`. +You can also get the user's email by doing `puts user.email`. + +The default password for the user is `12345678`. + +Example: +```ruby puts current_url puts user.email sleep(200) |