This repository has been archived by the owner on Jul 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(exports): fix type exports and require('protractor') exports (#3404)
* fix(package): set main to ptor instead of browser * fix(exports): fix type exports and require('protractor') exports
- Loading branch information
Showing
10 changed files
with
113 additions
and
30 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,3 +13,4 @@ xmloutput* | |
npm-debug.log | ||
|
||
*.swp | ||
globals.js |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ | |
}, | ||
"exclude": [ | ||
"node_modules", | ||
"typings/globals" | ||
"typings/globals", | ||
"asyncAwait" | ||
] | ||
} |
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/** | ||
* Requiring protractor as a node module. Export the contents of the protractor | ||
* namespace. | ||
*/ | ||
|
||
export = require('./ptor').protractor |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
// require('protractor') equivalent is requiring ptor | ||
let protractor = require('../../built/main'); | ||
|
||
// the webdriver stuff we are exposing externally | ||
|
||
|
||
describe('require(\'protractor\')', () => { | ||
|
||
describe('exported protractor classes', () => { | ||
it('should be defined', () => { | ||
var protractorClasses = ['Browser', 'ElementFinder', 'ElementArrayFinder', | ||
'ProtractorBy', 'ProtractorExpectedConditions']; | ||
for (var pos in protractorClasses) { | ||
var property = protractorClasses[pos]; | ||
expect(typeof protractor[property]).toEqual('function'); | ||
} | ||
}); | ||
|
||
describe('browser class', () => { | ||
it('should have static method defined', () => { | ||
var staticMethod = 'wrapDriver'; | ||
expect(typeof protractor.Browser['wrapDriver']).toEqual('function'); | ||
}); | ||
|
||
it('should have static variables defined', () => { | ||
var staticVariables = ['By', 'ExpectedConditions']; | ||
for (var pos in staticVariables) { | ||
var property = staticVariables[pos]; | ||
expect(typeof protractor.Browser[property]).toEqual('object'); | ||
} | ||
}); | ||
}); | ||
|
||
}); | ||
|
||
describe('exported webdriver namespace', ()=> { | ||
it('should have exported classes', () => { | ||
var webdriverClasses = ['WebElement', 'ActionSequence', 'Command']; | ||
for (var pos in webdriverClasses) { | ||
var property = webdriverClasses[pos]; | ||
expect(typeof protractor[property]).toEqual('function'); | ||
} | ||
}); | ||
|
||
it('should have variables defined', () => { | ||
var webdriverObjects = ['Key', 'CommandName']; | ||
for (var pos in webdriverObjects) { | ||
var property = webdriverObjects[pos]; | ||
expect(typeof protractor[property]).toEqual('object'); | ||
} | ||
}); | ||
|
||
describe('promise namespace', () => { | ||
it('should have functions defined (spot check)', () => { | ||
var promiseFunctions = ['Promise', 'defer', 'delayed', 'createFlow', | ||
'controlFlow', 'all', 'fulfilled', 'filter', 'when' ] | ||
for (var pos in promiseFunctions) { | ||
var property = promiseFunctions[pos]; | ||
expect(typeof protractor.promise[property]).toEqual('function'); | ||
} | ||
}); | ||
}); | ||
}); | ||
}); |