[Feature request] System Tests with multiple browsers

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[Feature request] System Tests with multiple browsers

Pierre Hedkvist
Hi,

I think it could be useful to run System Test with multiple browsers when using Selenium, in order to get better testing coverage for different browsers.

For instance if you could put an array of browsers inside the using variable:

require "test_helper"


class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
  driven_by
:selenium, using: [:chrome, :firefox], screen_size: [1000, 1000]
end


I know its possible to run capybara with multiple browser using RSpec, like this: https://stackoverflow.com/questions/39955782/capybara-rspec-how-to-set-up-multi-browser-tc-running

What are your thoughts?

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Feature request] System Tests with multiple browsers

Eileen M. Uchitelle
Hi Pierre,

That does sound like a useful feature. That would require your test suite to run twice though, is that desirable? If you'd like to implement this feature cc me when you open the PR.

-Eileen (eileencodes)

On Thursday, December 14, 2017 at 7:23:19 AM UTC-5, Pierre Hedkvist wrote:
Hi,

I think it could be useful to run System Test with multiple browsers when using Selenium, in order to get better testing coverage for different browsers.

For instance if you could put an array of browsers inside the using variable:

require "test_helper"


class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
  driven_by
:selenium, using: [:chrome, :firefox], screen_size: [1000, 1000]
end


I know its possible to run capybara with multiple browser using RSpec, like this: <a href="https://stackoverflow.com/questions/39955782/capybara-rspec-how-to-set-up-multi-browser-tc-running" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fstackoverflow.com%2Fquestions%2F39955782%2Fcapybara-rspec-how-to-set-up-multi-browser-tc-running\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNG7SXnT2_aGXMsCM-lyJXoqouNgFQ&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fstackoverflow.com%2Fquestions%2F39955782%2Fcapybara-rspec-how-to-set-up-multi-browser-tc-running\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNG7SXnT2_aGXMsCM-lyJXoqouNgFQ&#39;;return true;">https://stackoverflow.com/questions/39955782/capybara-rspec-how-to-set-up-multi-browser-tc-running

What are your thoughts?

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Feature request] System Tests with multiple browsers

Pierre Hedkvist
Thanks for the reply,

I have tried to find a solution, I think running the test suite twice is possible, could this be good solution though? Downside is that it might be slow to start selenium multiple times? 
I cant find where you instantiate system test from when starting it. I am familiar with your code from this PR inside of ActionDispatch. But when rails test:system is entered in the terminal,
from where does rails start the test?



Den fredag 15 december 2017 kl. 14:12:52 UTC+1 skrev eileencodes:
Hi Pierre,

That does sound like a useful feature. That would require your test suite to run twice though, is that desirable? If you'd like to implement this feature cc me when you open the PR.

-Eileen (eileencodes)

On Thursday, December 14, 2017 at 7:23:19 AM UTC-5, Pierre Hedkvist wrote:
Hi,

I think it could be useful to run System Test with multiple browsers when using Selenium, in order to get better testing coverage for different browsers.

For instance if you could put an array of browsers inside the using variable:

require "test_helper"


class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
  driven_by
:selenium, using: [:chrome, :firefox], screen_size: [1000, 1000]
end


I know its possible to run capybara with multiple browser using RSpec, like this: <a href="https://stackoverflow.com/questions/39955782/capybara-rspec-how-to-set-up-multi-browser-tc-running" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fstackoverflow.com%2Fquestions%2F39955782%2Fcapybara-rspec-how-to-set-up-multi-browser-tc-running\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNG7SXnT2_aGXMsCM-lyJXoqouNgFQ&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fstackoverflow.com%2Fquestions%2F39955782%2Fcapybara-rspec-how-to-set-up-multi-browser-tc-running\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNG7SXnT2_aGXMsCM-lyJXoqouNgFQ&#39;;return true;">https://stackoverflow.com/questions/39955782/capybara-rspec-how-to-set-up-multi-browser-tc-running

What are your thoughts?

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Feature request] System Tests with multiple browsers

Eileen M. Uchitelle
> I think running the test suite twice is possible, could this be good solution though

What I mean is I don't see a way to implement this that wouldn't start 2 servers and run the tests twice, once in Chrome and once in FF for example.

> I cant find where you instantiate system test from when starting it.

When you run `rails test:system` https://github.com/rails/rails/blob/master/actionpack/lib/action_dispatch/system_test_case.rb#L145 starts the server and boots the Rails application. `driven_by` is initialized when the test starts which is why you if you want multiple drivers you need to have multiple classes that call `driven_by` and inherit from that class (https://github.com/rails/rails/blob/master/actionpack/lib/action_dispatch/system_test_case.rb#L136-L138). That calls `setup` which initializes Capybara and then Capybara takes over from there. https://github.com/rails/rails/blob/master/actionpack/lib/action_dispatch/system_testing/driver.rb#L78

-Eileen

On Friday, December 15, 2017 at 4:17:39 PM UTC-5, Pierre Hedkvist wrote:
Thanks for the reply,

I have tried to find a solution, I think running the test suite twice is possible, could this be good solution though? Downside is that it might be slow to start selenium multiple times? 
I cant find where you instantiate system test from when starting it. I am familiar with your code from this <a href="https://github.com/rails/rails/pull/26703" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Frails%2Frails%2Fpull%2F26703\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNG8nsYZer5ZiYmZpx4BrCaO2CubRA&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Frails%2Frails%2Fpull%2F26703\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNG8nsYZer5ZiYmZpx4BrCaO2CubRA&#39;;return true;">PR inside of ActionDispatch. But when rails test:system is entered in the terminal,
from where does rails start the test?



Den fredag 15 december 2017 kl. 14:12:52 UTC+1 skrev eileencodes:
Hi Pierre,

That does sound like a useful feature. That would require your test suite to run twice though, is that desirable? If you'd like to implement this feature cc me when you open the PR.

-Eileen (eileencodes)

On Thursday, December 14, 2017 at 7:23:19 AM UTC-5, Pierre Hedkvist wrote:
Hi,

I think it could be useful to run System Test with multiple browsers when using Selenium, in order to get better testing coverage for different browsers.

For instance if you could put an array of browsers inside the using variable:

require "test_helper"


class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
  driven_by
:selenium, using: [:chrome, :firefox], screen_size: [1000, 1000]
end


I know its possible to run capybara with multiple browser using RSpec, like this: <a href="https://stackoverflow.com/questions/39955782/capybara-rspec-how-to-set-up-multi-browser-tc-running" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fstackoverflow.com%2Fquestions%2F39955782%2Fcapybara-rspec-how-to-set-up-multi-browser-tc-running\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNG7SXnT2_aGXMsCM-lyJXoqouNgFQ&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fstackoverflow.com%2Fquestions%2F39955782%2Fcapybara-rspec-how-to-set-up-multi-browser-tc-running\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNG7SXnT2_aGXMsCM-lyJXoqouNgFQ&#39;;return true;">https://stackoverflow.com/questions/39955782/capybara-rspec-how-to-set-up-multi-browser-tc-running

What are your thoughts?

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/d/optout.