JSHintify test
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
var expect = require('chai').expect;
|
||||
var webdriver = require('selenium-webdriver');
|
||||
var driver = require('./driver');
|
||||
@@ -14,7 +16,7 @@ var elements = [
|
||||
'header'
|
||||
];
|
||||
|
||||
describe('swagger 2.0 spec tests', function (done) {
|
||||
describe('swagger 2.0 spec tests', function () {
|
||||
this.timeout(10 * 1000);
|
||||
|
||||
before(function (done) {
|
||||
@@ -28,8 +30,9 @@ describe('swagger 2.0 spec tests', function (done) {
|
||||
var errors = [];
|
||||
browserLogs.forEach(function(log){
|
||||
// 900 and above is "error" level. Console should not have any errors
|
||||
if (log.level.value > 900)
|
||||
if (log.level.value > 900) {
|
||||
console.log('browser error message:', log.message); errors.push(log);
|
||||
}
|
||||
});
|
||||
expect(errors).to.be.empty;
|
||||
done();
|
||||
@@ -80,7 +83,7 @@ describe('swagger 2.0 spec tests', function (done) {
|
||||
});
|
||||
|
||||
it('should find the pet link', function(done){
|
||||
var locator = webdriver.By.xpath("//*[@data-id='pet']");
|
||||
var locator = webdriver.By.xpath('//*[@data-id="pet"]');
|
||||
driver.isElementPresent(locator).then(function (isPresent) {
|
||||
expect(isPresent).to.be.true;
|
||||
done();
|
||||
@@ -88,7 +91,7 @@ describe('swagger 2.0 spec tests', function (done) {
|
||||
});
|
||||
|
||||
it('should find the pet resource description', function(done){
|
||||
var locator = webdriver.By.xpath("//div[contains(., 'Everything about your Pets')]");
|
||||
var locator = webdriver.By.xpath('//div[contains(., "Operations about pets")]');
|
||||
driver.findElements(locator).then(function (elements) {
|
||||
expect(elements.length).to.not.equal(0);
|
||||
done();
|
||||
@@ -96,7 +99,7 @@ describe('swagger 2.0 spec tests', function (done) {
|
||||
});
|
||||
|
||||
it('should find the user link', function(done){
|
||||
var locator = webdriver.By.xpath("//*[@data-id='user']");
|
||||
var locator = webdriver.By.xpath('//*[@data-id="user"]');
|
||||
driver.isElementPresent(locator).then(function (isPresent) {
|
||||
expect(isPresent).to.be.true;
|
||||
done();
|
||||
@@ -104,7 +107,7 @@ describe('swagger 2.0 spec tests', function (done) {
|
||||
});
|
||||
|
||||
it('should find the store link', function(done){
|
||||
var locator = webdriver.By.xpath("//*[@data-id='store']");
|
||||
var locator = webdriver.By.xpath('//*[@data-id="store"]');
|
||||
driver.isElementPresent(locator).then(function (isPresent) {
|
||||
expect(isPresent).to.be.true;
|
||||
done();
|
||||
|
||||
Reference in New Issue
Block a user