Tools:
Ruby:
- Rspec - Test runner
- Capybara - browser control bindings / assertion library
- Selenium - browser abstraction and running factory
Node:
- Mocha - Test runner
- Chai - Assertion library
- Webdriverio - browser control bindings
- Selenium - browser abstraction and running factory
Ruby:
require 'capybara'
require 'capybara/rspec'
Capybara.configure do |config|
config.run_server = false
config.default_driver = :selenium
config.app_host = 'http://google.com'
end
describe 'Check homepage' do
it 'should see the correct title' do
page.click 'Search'
expect(page).to have_title "my title"
end
end
Node:
var page = require('webdriverio');
var expect = require('chai').expect;
page.init()
.url('http://google.com');
describe('Check homepage', function(){
it('should see the correct title', function(done) {
page.click('Search', function(err, res) {
page.getTitle(function(err, title) {
expect(title).to.have.string('Search Page');
});
});
});
});