Skip to content

Instantly share code, notes, and snippets.

@bastsoft
Last active December 28, 2015 04:59
Show Gist options
  • Save bastsoft/7446821 to your computer and use it in GitHub Desktop.
Save bastsoft/7446821 to your computer and use it in GitHub Desktop.
Заготовка для тестирования с использованием Selenium и Mocha
var webdriver = require('selenium-webdriver');
var test = require('selenium-webdriver/testing');
var assert = require('assert');
var driver;
function testIT (test){
test.it('тест №1', function () {
//...
});
//...
}
test.describe('test in chrome', function () {
test.before(function () {
driver = new webdriver.Builder()
.withCapabilities({ browserName: 'chrome' })
.build();
driver.manage().timeouts().implicitlyWait(20000);
});
testIT(test);
test.after(function () {
driver.quit();
});
});
test.describe('test in firefox', function () {
test.before(function () {
driver = new webdriver.Builder()
.usingServer('http://localhost:4444/wd/hub')
.withCapabilities({ browserName: 'firefox' })
.build();
driver.manage().timeouts().implicitlyWait(20000);
});
testIT(test);
test.after(function () {
driver.quit();
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment