|
|
|
@ -4,34 +4,9 @@ var driver = new webdriver.Builder()
|
|
|
|
.forBrowser('firefox')
|
|
|
|
.forBrowser('firefox')
|
|
|
|
.build();
|
|
|
|
.build();
|
|
|
|
|
|
|
|
|
|
|
|
// var fs = require('fs');
|
|
|
|
var fs = require('fs');
|
|
|
|
// jasmine.getEnv().addReporter(new jasmine.ConsoleReporter(console.log));
|
|
|
|
jasmine.getEnv().addReporter(new jasmine.ConsoleReporter(console.log));
|
|
|
|
//
|
|
|
|
|
|
|
|
// describe('Main page', function () {
|
|
|
|
|
|
|
|
// driver.get('http://localhost:9001/');
|
|
|
|
|
|
|
|
// it('should have title of Test Title', function (done) {
|
|
|
|
|
|
|
|
// driver.getTitle().then(function(title) {
|
|
|
|
|
|
|
|
// expect(title).toBe('Test Title');
|
|
|
|
|
|
|
|
// done();
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
// it('should show extra div when clicking on link', function (done) {
|
|
|
|
|
|
|
|
// driver.findElement(webdriver.By.id('clicker')).click();
|
|
|
|
|
|
|
|
// driver.findElement(webdriver.By.id('jQueryAddedDiv')).then(function(element){
|
|
|
|
|
|
|
|
// element.getText().then(function(div_text){
|
|
|
|
|
|
|
|
// expect(div_text).toBe('added through jquery');
|
|
|
|
|
|
|
|
// driver.switchTo().defaultContent();
|
|
|
|
|
|
|
|
// driver.executeScript("return window.__coverage__;").then(function (obj) {
|
|
|
|
|
|
|
|
// fs.writeFile('coverage/coverage.json', JSON.stringify(obj));
|
|
|
|
|
|
|
|
// driver.quit();
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
// done();
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
describe('Main page', function (){
|
|
|
|
describe('Main page', function (){
|
|
|
|
it('should have title of Test Title', function (done) {
|
|
|
|
it('should have title of Test Title', function (done) {
|
|
|
|
driver.get('http://localhost:9001/').then(function(){
|
|
|
|
driver.get('http://localhost:9001/').then(function(){
|
|
|
|
@ -47,14 +22,12 @@ describe('Main page', function (){
|
|
|
|
driver.findElement(webdriver.By.id('jQueryAddedDiv')).then(function(element){
|
|
|
|
driver.findElement(webdriver.By.id('jQueryAddedDiv')).then(function(element){
|
|
|
|
element.getText().then(function(div_text){
|
|
|
|
element.getText().then(function(div_text){
|
|
|
|
expect(div_text).toBe('added through jquery');
|
|
|
|
expect(div_text).toBe('added through jquery');
|
|
|
|
// driver.switchTo().defaultContent();
|
|
|
|
driver.switchTo().defaultContent();
|
|
|
|
// driver.executeScript("return window.__coverage__;").then(function (obj) {
|
|
|
|
driver.executeScript("return window.__coverage__;").then(function (obj) {
|
|
|
|
// fs.writeFile('coverage/coverage.json', JSON.stringify(obj));
|
|
|
|
fs.writeFile('coverage/coverage.json', JSON.stringify(obj));
|
|
|
|
// driver.quit();
|
|
|
|
driver.quit();
|
|
|
|
// done();
|
|
|
|
done();
|
|
|
|
// });
|
|
|
|
});
|
|
|
|
driver.quit();
|
|
|
|
|
|
|
|
done();
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|