Last active
December 28, 2015 04:59
-
-
Save bastsoft/7446821 to your computer and use it in GitHub Desktop.
Заготовка для тестирования с использованием Selenium и Mocha
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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