Is there a way to run Jasmine 2 tests with Selenium Webdriver? - selenium

I have a large suite of Jasmine unit tests that were developed to run on a Selenium Grid using the jasmine:ci rake task provided by the Jasmine 1.3 Ruby gem. There was decent integration between Jasmine 1.3 and Selenium Webdriver and running tests on a remote node was as simple as passing some environment variables:
$ rake jasmine:ci SELENIUM_SERVER="http://hub.localdomain:4444/wd/hub" JASMINE_HOST="http://currenthost" JASMINE_BROWSER="chrome"
In Jasmine 2, this capability is gone, replaced by an integration with Phantomjs. Unfortunately, I can't find any discussion of migration options for people who still need Webdriver support.
Is there a way to run Jasmine 2 tests using Selenium Webdriver? Does anyone know of any existing projects or documentation focused on this integration? My query to the Jasmine dev list has gone unanswered.

On the jasmine team, it seemed to us that most people wanted to run their tests headless, so with 2.0 we made that the default. Running the tests in selenium also made the jasmine gem have a number of dependencies that potentially made it harder to install.
But we also see the value in running jasmine tests in multiple (real) browsers as well. To this end, we extracted the selenium code, including saucelabs integration, to it's own gem. Jasmine core actually uses this gem to runs it's own tests across multiple browsers.

Related

How does the elixir community recommend setting up integration tests with chromedriver?

I am using Hound (https://github.com/HashNuke/hound) for integration testing a Phoenix application. I have chrome and chrome headless working. To get it working I have another terminal window running chromedriver (installed via brew). This feels odd to me. Is there a library or test setup that would feel more "integrated" into the application? What's the Elixir way of doing this?
In the Ruby world there's the webdrivers gem (https://github.com/titusfortner/webdrivers). As far as I know it downloads a specified driver (lets say chromedriver) to $HOME. Then with every test run, the test uses the driver downloaded to that destination to execute the tests.
Before the webdrivers gem there was chromedriver-helper gem. Before that it was phantomjs. These implementations made it so running integration tests required 1: downloading the driver 2: running the test
In Elixir (with Hound) I have my tests working by first running chromedriver --verbose in a terminal split, and in the other screen I run mix test. This works fine but feels disjointed. This adds extra steps, 1: download the driver 2: start the driver 3: run the test 4: stop driver
I could write a script manually to run chromedriver in the background, and stop it after the tests are run.
I am new to the Elixir community and so I've researched a lot. It's still not clear to me if there is a "traveled path" I should go down vs just hooking everything up manually.
Have I missed a recommended abstraction? Is this intentional? Is this "just not created, yet"?
Thank you
Have you checked out wallaby? See https://github.com/keathley/wallaby

Running karma-jasmin tests on selenium grid

We've got our tests for angularjs code using Jasmin and currently running with Karma. The tests are now using phantomjs.
Is there a way to run these tests using selenium grid?
It seems there is 'https://github.com/karma-runner/karma-webdriver-launcher' which can do the trick; however, this is not an option for us. Is there another way to run our tests using the selenium grid?

How can we execute single test on multiple browser using browserstack and Geb Framework

I am using Geb framework to execute the testcases on browserstack.Currently I am able to execute my test on single browser(Say Firefox) on browserstack.I need to run the same test on multiple browser
You can use the 'Gradle geb-browserstack Plugin' to run your tests on multiple browsers on BrowserStack. More details available here.
Using this plugin, the capabilities are passed as follows:
browserName_platform_browser-version
For example, to run tests on Firefox 32 on MAC, the capabilities are:
firefox_mac_32
If you have any BrowserStack related queries, you can always get in touch with them at support#browserstack.com
EDIT:
I have created a sample project here, that can help you get started with running Geb Tests in parallel on multiple browsers on BrowserStack.

Cloud9 Watir/Selenium Testing

I have set up Cloud9 and Codeship for a simple Continuous Integration and Delivery system. It works well for developing my website/app. Has anyone been able to develop and run browser based Cucumber tests from within the Cloud9 IDE? If so, what kind of set-up did it require?
PS. I have been trying to get the Watir/Selenium chromedriver installed and working with the 'headless' gem.
First an explanation. I found it very easy to set up github, c9.io, and codeship for CI and CD using Cucumber for acceptance testing on Codeship. Unfortunately, developing the Cucumber tests was difficult, because I had to commit, push, and examin the failing Integration tests on codeship. I wanted to be able to quickly run and debug Cucumber scenarios in the IDE. But, there is no browser for watir/selenium to open. Thus the question.
After a day of searching and hint from c9.io on twitter, I have consensed the solution down to two steps ...
Install firefox and xvfb: sudo apt-get install firefox xvfb
Run cucumber in an xvfb context: xvfb-run cucumber

Moving from Selenium IDE to what?

I have been given the following job from my boss:
three years ago a former employee created selenium tests for our project and committed them via eclipse
now I have to update the tests due to the fact that the software has changed through time.
I created new IDE tests, instead of editing the old ones.
I have committed them through CVS in the project folder and I access them via a browser (selenium has some folder in the project)
when I run these tests via IDE, they run fine, but when I run them via the TEstRUnner that is in the old selenium installation, there are a lot of errors.
Should I install new version of Selenium in the project folder and what should it be?
Or should I just run the tests from IDE instead? (I read somewhere that TestRunner will be deprecated)
How are tests made in IDE run through Web Driver?
Have you looked at Selenium Builder? It supports migrating existing scripts, works well with Sauce Labs and there is also a Jenkins plugin](https://wiki.jenkins-ci.org/display/JENKINS/Selenium+Builder+Plugin) available.
Tests built using Selenium IDE are built using Selenium RC (1.0), and selenium WebDriver is the foundation of Selenium 2.0. Selenium has a migration document for this transition. In moving to Web Driver, you might be required to code the tests yourself, rather than using the point and click Selenium IDE.
Additionally, there is a hybrid approach for using Selenium RC code on Selenium Web Driver: http://docs.seleniumhq.org/docs/03_webdriver.jsp#alternative-back-ends-mixing-webdriver-and-rc-technologies
In order to run the Web Driver tests, you will need to have a selenium server or local browser to execute these tests. Some examples are SauceLabs, Selenium Grid, a standalone Selenium Server, or I believe you allow Web Driver to directly control the browser on the computer executing the code.