Skip to content
This repository was archived by the owner on Jul 29, 2024. It is now read-only.

Commit 84fe80f

Browse files
committed
cleaned up
- Removed jshint to reduce noise. We will not need this when switching suite to TypeScript. - Changed Protractor configuration files to be ".conf.js" for uniformity (I was trying to exclude ".conf.js" from jshint. After removing jshint, this decision seems pointless but cleaner?) - Cleaned up logging. Ran all the tests and most seem to pass. There are some issues where catching and unhandled promises throwing errors report slightly differently. - Fixed the driverProviderAttachSession test.
1 parent ce4867e commit 84fe80f

File tree

77 files changed

+398
-587
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+398
-587
lines changed

.jshintignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

.jshintrc

Lines changed: 0 additions & 28 deletions
This file was deleted.

gulpfile.js

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ gulp.task('tslint', function() {
4141
});
4242

4343
gulp.task('lint', function(done) {
44-
runSequence('tslint', 'jshint', 'format:enforce', done);
44+
runSequence('tslint', 'format:enforce', done);
4545
});
4646

4747
// prevent contributors from using the wrong version of node
@@ -59,22 +59,15 @@ gulp.task('checkVersion', function(done) {
5959
}
6060
});
6161

62-
gulp.task('built:copy', function(done) {
62+
gulp.task('built:copy', function() {
6363
return gulp.src(['lib/**/*.js'])
6464
.pipe(gulp.dest('built/'));
65-
done();
6665
});
6766

6867
gulp.task('webdriver:update', function(done) {
6968
runSpawn(done, 'node', ['bin/webdriver-manager', 'update']);
7069
});
7170

72-
gulp.task('jshint', function(done) {
73-
runSpawn(done, 'node', ['node_modules/jshint/bin/jshint', '-c',
74-
'.jshintrc', 'lib', 'spec', 'scripts',
75-
'--exclude=lib/selenium-webdriver/**/*.js,lib/webdriver-js-extender/**/*.js,' +
76-
'spec/dependencyTest/*.js,spec/install/**/*.js']);
77-
});
7871

7972
gulp.task('format:enforce', function() {
8073
var format = require('gulp-clang-format');
@@ -107,12 +100,12 @@ gulp.task('compile_to_es5', function(done) {
107100
});
108101

109102
gulp.task('prepublish', function(done) {
110-
runSequence('checkVersion', 'jshint', 'tsc', 'built:copy', done);
103+
runSequence('checkVersion', 'tsc', 'built:copy', done);
111104
});
112105

113106
gulp.task('pretest', function(done) {
114107
runSequence('checkVersion',
115-
['webdriver:update', 'jshint', 'tslint', 'format'], 'tsc', 'built:copy', 'tsc:spec', done);
108+
['webdriver:update', 'tslint', 'format'], 'tsc', 'built:copy', 'tsc:spec', done);
116109
});
117110

118111
gulp.task('default',['prepublish']);

lib/browser.ts

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -585,13 +585,13 @@ export class ProtractorBrowser extends AbstractExtendedWebDriver {
585585
return null;
586586
} else {
587587
try {
588-
const rootEl = await this.angularAppRoot();
589-
return this.executeAsyncScript_(
590-
clientSideScripts.waitForAngular, `Protractor.waitForAngular() ${description}`, rootEl);
591-
}
592-
catch (err) {
593-
console.log('something wrong happened here');
594-
}
588+
const rootEl = await this.angularAppRoot();
589+
return this.executeAsyncScript_(
590+
clientSideScripts.waitForAngular, `Protractor.waitForAngular() ${description}`,
591+
rootEl);
592+
} catch (err) {
593+
console.log('something wrong happened here');
594+
}
595595
}
596596
};
597597

@@ -708,11 +708,6 @@ export class ProtractorBrowser extends AbstractExtendedWebDriver {
708708
* Modules will be registered after existing modules already on the page,
709709
* so any module registered here will override preexisting modules with the
710710
* same name.
711-
*"both angularJS testability and angular testability are undefined. This could be either because this is a non-angular page or because your test involves client-side navigation, which can interfere with Protractor's bootstrapping. S
712-
*"both angularJS testability and angular testability are undefined. This could be either because this is a non-angular page or because your test involves client-side navigation, which can interfere with Protractor's bootstrapping. S
713-
* browser.addMockModule('modName', function() {
714-
* angular.module('modName', []).value('foo', 'bar');
715-
* });
716711
*
717712
* @param {!string} name The name of the module to load or override.
718713
* @param {!string|Function} script The JavaScript to load the module.
@@ -769,8 +764,6 @@ export class ProtractorBrowser extends AbstractExtendedWebDriver {
769764
this.trackOutstandingTimeouts_);
770765
}
771766

772-
773-
navigating = false;
774767
/**
775768
* @see webdriver.WebDriver.get
776769
*
@@ -909,7 +902,7 @@ export class ProtractorBrowser extends AbstractExtendedWebDriver {
909902
}
910903

911904
const href = await this.executeScriptWithDescription(
912-
'return window.location.href', 'Protractor.refresh() - getUrl');
905+
'return window.location.href', 'Protractor.refresh() - getUrl');
913906
return this.get(href, opt_timeout);
914907
}
915908

@@ -998,7 +991,7 @@ export class ProtractorBrowser extends AbstractExtendedWebDriver {
998991
*/
999992
async debugger() {
1000993
// jshint debug: true
1001-
await this.driver.executeScript(clientSideScripts.installInBrowser)
994+
await this.driver.executeScript(clientSideScripts.installInBrowser);
1002995
debugger;
1003996
}
1004997

lib/driverProviders/attachSession.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export class AttachSession extends DriverProvider {
3838
getNewDriver(): WebDriver {
3939
const httpClient = new http.HttpClient(this.config_.seleniumAddress);
4040
const executor = new http.Executor(httpClient);
41-
const newDriver = WebDriver.attachToSession(executor, this.config_.seleniumSessionId);
41+
const newDriver = WebDriver.attachToSession(executor, this.config_.seleniumSessionId, null);
4242
this.drivers_.push(newDriver);
4343
return newDriver;
4444
}

lib/driverProviders/driverProvider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* It is responsible for setting up the account object, tearing
44
* it down, and setting up the driver correctly.
55
*/
6-
import {Builder, Session, WebDriver} from 'selenium-webdriver';
6+
import {Builder, WebDriver} from 'selenium-webdriver';
77

88
import {BlockingProxyRunner} from '../bpRunner';
99
import {Config} from '../config';

0 commit comments

Comments
 (0)