-
Notifications
You must be signed in to change notification settings - Fork 877
Conversation
f534964
to
5542954
Compare
a8bb299
to
1e889c8
Compare
'use strict'; // necessary for es6 output in node | ||
|
||
import { browser, element, by } from 'protractor/globals'; | ||
import { sendKeys } from '../protractor-helpers'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sendKeys
is not exported on the protractor-helpers
file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
1e889c8
to
a803c53
Compare
Thanks for the review @cnishina! I added in all your notes. |
7d3b838
to
11cfbee
Compare
function getBoundingClientWidth(el: protractor.ElementFinder): protractor.promise.Promise<number> { | ||
return browser.executeScript( | ||
function getBoundingClientWidth(el: ElementFinder): Promise<number> { | ||
return browser.driver.executeScript( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
browser.executeScript
should work now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
function getOffsetWidth(el: protractor.ElementFinder): protractor.promise.Promise<number> { | ||
return browser.executeScript( | ||
function getOffsetWidth(el: ElementFinder): Promise<number> { | ||
return browser.driver.executeScript( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
browser.executeScript
should work now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
@@ -71,7 +74,7 @@ describe('Dependency Injection Cookbook', function () { | |||
let yellow = 'rgba(255, 255, 0, 1)'; | |||
|
|||
expect(target.getCssValue('background-color')).not.toEqual(yellow); | |||
browser.actions().mouseMove(target as any as webdriver.WebElement).perform(); | |||
browser.actions().mouseMove(target as any as WebElement).perform(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use target.getWebElement()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
@@ -54,7 +57,7 @@ describe('TypeScript to Javascript tests', function () { | |||
expect(h1.getAttribute('class')).toBe('active'); | |||
|
|||
h1.click(); | |||
browser.actions().doubleClick(h1 as any as webdriver.WebElement).perform(); | |||
browser.actions().doubleClick(h1 as any as WebElement).perform(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use h1.getWebElement()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
7bc7b0d
to
2bf1b46
Compare
f2a18d0
to
134d1d1
Compare
134d1d1
to
b0894d2
Compare
b0894d2
to
9b96af7
Compare
I like it but there are some changes:
My concerns: Now we have a few boilerplate inside a _boilerplate folder and a few of them outside it. I don't like that, because now I have two different places to look for boilerplate and even more confusing, I have two package.json (one full, one with tasks only, and needing to maintain both). On the other hand, we also have two tsconfig, one for protractor and one for the demos. Can't we have |
Points discussed offline, addressed in commits above. |
It has a tslint in _examples and _boilerplate. I guess we should get rid of the _examples one. Also, a2docs.css at _boilerplate needs to be ignored. |
We should keep the tslint in _examples because it'll also affect the e2e specs. The a2docs.css at _boilerplate should be ignored, agree. |
So to summarize for @wardbell, we are creating a The important bit in here is that the package.json that we are spreading right now only have the npm scripts (just what we need) and there is a package.json at We now have a less cluttered _examples folder. |
LGTM. Assume it works :-) I like the cleanup. I'm not entirely sure yet about the package.json split of scripts from dependencies but if it doesn't work out, we can fix. |
This PR updates Protractor to from version 3 to 4, which is made inTypescript and includes typings.
Since Protractor4 includes typings, this solves an issue we had with the Upgrade Adapter chapter where Jquery's
$
typings conflicted with Protractors$
. This issue prevented us from having them in the same node package and was the main motivator for the_protractor
folder.Thus, this PR removes the
_protractor
folder and adds Protractor configuration and helpers directly to_examples
, which solves some editor tooling issues we had because of the indirect path structure for e2e tests.Boilerplate files were moved from
_examples
to_examples/_boilerplate
as well, so that they are contained there and also to be able to use atsconfig.json
for Protractor in_examples
(this was needed for editor tooling purposes). Gulp tasks and plunker generation were adjusted to use this directory.Some of the custom logic we had in
protractor.config.js
was moved intoprotractor-helpers.ts
since we were attaching it to thebrowser
variable, which is now typed and thus threw errors when accessing these custom members. Our customsendKeys
was also removed since it's not needed anymore.End result is that we should have full type safety and editor tooling support in Protractor.
Note: previous tooling added a git ignored
tsconfig.json
besides eache2e-spec.ts
file, which should now be removed otherwise editor tooling will not work properly. Overall, after this PR it is a good to rungit clean -fdx
to 'reset' the repo and re-setup our infrastructure./cc @wardbell @chalin @Foxandxss this PR includes some structural changes that I'd like you to look at and see if you approve.