nruth / show_me_the_cookies Goto Github PK
View Code? Open in Web Editor NEWCookie manipulation for Capybara (view, delete, …)
Cookie manipulation for Capybara (view, delete, …)
Everything in this gem is always undefined.
Should have been called capybara-cookies if you go by the rubygems naming guide.
Why don't rename it then? :) capybara-cookies
seems to be available...
like capybara frames api and so on
NoMethodError:
undefined method `set_cookie' for #<Capybara::Webkit::Driver:0x007f2387ae8678>
code in question
user = create(:user)
login_as user
create_plans_set(:plans_table)
plan = Plan.find_by(name: "Classic One Year")
create_cookie(:subscription, plan_id: plan.id)
visit new_subscription_path
Am I doing something wrong here?
what version of capydoes this gem require?
using capybara 2.4.4
Hi, I am currently struggling with a very strange issue. If I create a cookie on a before block the flash messages do not persist. If i just comment out the line that use create_cookie
it that same tests passes. Below is an example:
# controller create if save is successful
redirect_to redirect_path, notice: "Something was successfully saved"
# capybara test
... fill in the form and click on save
# the redirect works and the item is created but there is not flash message if create_cookie was used
expect(page).to have_content("Content was successfully created.")
I added several puts
statements to debug and noticed that the flash does not persist across requests when the cookie was set.
Try https://www.deppbot.com and consider which drivers to keep / drop / restrict versions.
Strip down the main lib to tested rack-test and selenium support.
Make driver selection work in a way that outside code can add new driver support to, e.g. adapters.
Hi,
I just installed the gem in a capybara 0.4.1.2/cucumber 1.0.0 environment. When using the default rack test driver, I'm getting the following error message when running cucumber steps that call delete_cookie:
undefined method `browser' for #<Capybara::Driver::RackTest:0x00000003539190> (NoMethodError)
Hey guys getting this error, im getting this error. I did include config.include ShowMeTheCookies, :type => :feature
However when i call the method in an example just throw
undefined local variable or method `show_me_the_cookies' for #<RSpec::ExampleGroups::DialogsAuth::WithOmniauthAndBrandClientId::....
im using new rails 4.1.1 and recent version of Rspec and Capybara
Is this intentional?
It would be nice to have a method that sets a cookie.
Can't yet update to capybara 3, since poltergeist needs to add support first. At least for testing.
When using Safari 7.1 I get the error SecurityError: DOM Exception 18 (Selenium::WebDriver::Error::NoScriptResultError)
SecurityError: DOM Exception 18 (Selenium::WebDriver::Error::NoScriptResultError)
/Users/peterhough/.rvm/gems/ruby-2.1.3/gems/selenium-webdriver-2.43.0/lib/selenium/webdriver/safari/bridge.rb:73:in `raw_execute'
/Users/peterhough/.rvm/gems/ruby-2.1.3/gems/selenium-webdriver-2.43.0/lib/selenium/webdriver/remote/bridge.rb:616:in `execute'
/Users/peterhough/.rvm/gems/ruby-2.1.3/gems/selenium-webdriver-2.43.0/lib/selenium/webdriver/remote/bridge.rb:361:in `getAllCookies'
/Users/peterhough/.rvm/gems/ruby-2.1.3/gems/selenium-webdriver-2.43.0/lib/selenium/webdriver/common/options.rb:77:in `all_cookies'
/Users/peterhough/.rvm/gems/ruby-2.1.3/gems/show_me_the_cookies-2.5.0/lib/show_me_the_cookies/adapters/selenium.rb:11:in `get_me_the_cookies'
/Users/peterhough/.rvm/gems/ruby-2.1.3/gems/show_me_the_cookies-2.5.0/lib/show_me_the_cookies.rb:44:in `get_me_the_cookies'
/Users/peterhough/workspace/mywebsite/cucumber/features/support/step_helpers.rb:531:in `get_cookies'
/Users/peterhough/workspace/mywebsite/cucumber/features/support/step_helpers.rb:521:in `set_cookie_policy'
/Users/peterhough/workspace/mywebsite/cucumber/features/support/config.rb:322:in `Before'
The same code works fine in Chrome & Firefox.
Thanks in advance for any help.
Following pull #6 it'd be better if there were cucumber features as documentation for using with cucumber, and the readme just explains the idea of using the api to build your own steps to people who are more used to cargo-culting.
removes poltergeist, fixes rack / rack-test
I'm using mechanize but it tells me that the driver is not supported. This is being used via the Capybara DSL
It would be great if you could do a new release with the Webkit support - are there any issues with it that are holding you up right now? I just used the library with both Selenium and Webkit in an application this morning and it's working well for me.
How would you feel about introducing a changelog? The major version just changed and I wanted to verify there were no breaking changes.
For now I looked at v3.1.0...v4.0.0, but crafting that URL took a little effort.
Just curious because I see no way to accessed the signed cookies
I would like to use ShowMeTheCookies inside the Rails application as a whole, and not just within Rspec. Can you please show how it would be configured at the application level, for example:
module ApplicationHelper
Application.configure do |config|
config.include ShowMeTheCookies, :type => :feature
end
end
This is not working, and without it, I get:
undefined local variable or method show_me_the_cookies
Thank you.
I see create_cookie has been added but it isn't in the README yet.
Hello! Thank you for your gem!
I can't understand why installation instruction use :type => :feature. What it's mean?
RSpec.configure do |config|
config.include ShowMeTheCookies, :type => :feature
end
My tests works only when I remove :type => :feature
RSpec.configure do |config|
config.include ShowMeTheCookies
end
What I do wrong?
Are there plans to support Capybara 2?
Semaphore 1's Firefox is really old and incompatible with one of the supporting gems (webdrivers, selenium-webdriver, capyabara, 🤷 ).
Set up again on semaphore 2 to fix the build.
It doesn't look like you've implemented all of the functionality listed in the API list. The only methods for each driver are show_me_the_cookies and delete_cookie. Is this still a WIP and those are just a blueprint for you ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.