@Component decorator 44
@Injectable class decorators 73, 76–76
@types node 114
*ngFor 131
ActivatedRoute.snapshot.data 108
ActivatedRoute components, testing 101–102
alertIsPresent 146
Angular platform
CLI
verifying installation of 206–206
nontesting module statements 32–32
pages without, testing 142–145
waiting for, automatically 144–144
arrays, mapping contact lists to 133–135
asynchronous code, changes to testing 86–88
asynchronous functions 180–181
asynchronous services, testing for failures with 88–89
<a> tag 120
attribute directives
overview of 45
AuthenticationGuard 106
<base href> tag 94
BDD (behavior-driven development) 14
beforeEach functions, adding 34–35–36, 36
blocking proxy features 179–179
browser.executeScript method 151
browser.pause( ) method 186
browser.sleep( ) method 145
browser.takeScreenshot( ) method 170
browser.waitForAngular( ) function 171, 173
browser.waitForAngularEnabled() function 145–145
browser.wait function 124, 145, 150–151
browsers, obtaining elements from 151–151
browserstackKey 162
browserstackUser 162
BrowserStorage 75
BrowserStorageAsyncMock 88
BrowserStorageMock 80
CanActivateChild 97
canActivate property 97, 105, 106
CanDeactivate 97
catch method 89
Chrome DevTools, debugging Protractor with 180–187
CI (continuous integration) 191–202
clear method 127
CLI (command-line interface) 2
code quality 7
color, adding as parameter 48–48
[color] parameter 48
command-line interface (CLI) 2
compareScreenshot( ) function 172, 173
components
of router parameters, testing 103–104
overview of 2
configuration files, in Protractor 161–170
configureTestingModule method 51
ContactDetail component 44
ContactEditComponent class 101
ContactFeedDialogComponent 157
contactId 94
Contact interface 134
ContactListComponent 72
ContactListPageObject 138
contact lists
ContactPreferences 83
contacts
Contacts App Starter 6
control flow, in Protractor 180–187
createClickButton method 137
createComponent method 51
curr parameter 137
data, resolving before loading routes 107–108
debugging
Protractor, experimental features 176–179
Protractor with Chrome DevTools 180–187
defaultTrueElementIndex 52
default usage, for pipes 61–65
dependencies
directives
testing attribute directives 45–54
testing structural directives 54–58
disabling waitForAngular 143–144
dispatchEvent method 53
doBrowserThings( ) method 155
doClassesMatch method 52
done method 84
driver provider options, in Protractor 162–162
E2E (end-to-end) tests
elements
interacting with in Protractor 118–125
interacting with list of 130–137
obtaining from browser 151–151
waiting to become stale 148–149
elementToBeClickable 146
elementToBeSelected 146
environment variables, in Protractor 168–170
ExpectedConditions object, waiting with 145–149
expectedOutlineStarList 53
expectedSolidStarList 52
failing test 17
FavoriteIcon 44
FEED_UPDATES array 153
file globbing 118
filterFn function 130
filter function 130
filtering web elements 130–132
findAllPosts( ) function 151
findElement method 125
fixture.detectChanges( ) method 51
fixture variable 50
flaky test 142
format parameter 65
format variable 66
FormBuilder 74
getAttribute method 127
getCssValue method 127
getElement function 56
get method 20
getPropertyAsync method 88
getTagName method 127
getText method 127
getWebElement method 127
globbing 118
happy path 82
headless environment 191
headless mode 164
highlight delay feature 178–179
-highlightDelay flag 178
HighlightRowDirective 43
HttpClient 71
HttpClientTestingModule 90, 91
HTTP services, with observables 89–92
I/O operation 180
IContactPreferences interface 80
id property 21
<i> element 50
import statements
overview of 57
IndexedDB 87
InjectionToken function 75
installing
Angular CLI
verifying installation of 206–206
invisibilityOf 146
IS_CIRCLE variable 200
isDisplayed method 127
isElementPresent method 127
isPresent method 127
jasmine-reporters node 166
karma-chrome-launcher plugin 195
karma-junit-reporter plugin 194
lazy loading 97
loggingPrefs 164
looksSame.createDiff( ) function 173
managed promise 181
map function 133
mapping contact lists, to arrays 133–135
matcher functions 14
mimicking user interactions 8
mouseenter event 53
multiCapabilities 165
name property 20
NavConfigService 98
NavigationMenu component 98
NewContactPageObject 138
ngOnInit method 103
ng serve command 207
ng test command 53
NgZone.runOutsideAngular( ) function 156
node_module folder 118
nontesting module statements, in Angular 32–32
not.toBeNull( ) method 19
npm install command 206
observables
HTTP services with, testing 89–92
OOP (object-oriented programming) 4
page objects, in Protractor 137–140
parameters
multiple, testing pipes with 67–69
single, testing pipes with 65–67
phone numbers
invalid, testing pipes for 64–65
valid, testing pipes for 62–64
pipes
overview of 2
plugins, in Protractor 166–168
pollForever( ) function 156
postTest( ) function 171
pree2e script 114
PreferencesService
pre-loading data 105
prerequisites, installing 204–206
presenceOf 146
private access modifier 5
process.env.BROWSER_NAME 169
process.env.DIRECT_CONNECT 169
process.env.SELENIUM_ADDRESS 169
Promise.all method 135
Promise.resolve( ) method 155
promise chaining 174
promises
pure function 59
pyramid of doom 181
resolve method 97
resolver guard 105
resolving data 105
routed components, testing 97–105
route guards 95, 96–97–105, 107
Router.navigate( ) method 101
router configuration 94
RouterLink directive 98
router parameters, testing 101–105
routers
testing navigation with RouterTestingModule 97–101
RouterTestingModule
creating test components 99–99
routes
advanced, testing 105–105–107, 108
resolving data before loading 107–108
routing 2
sanity check 5
sauceKey 162
sauceUser 162
screenshots
in Protractor, testing 170–175
seleniumAddress 162
Selenium Server 112
seleniumServerJar 162
separation of concerns principle 72
services 2
setProperty 85
shouldThrow assertion 82
ShowContactsDirective 55
side effect 59
snapshot 102
spy function 80
stalenessOf 146
starElement variable 51
structural directives
overview of 45
styleUrls option 44
takeScreenshot( ) method 170, 171
templateUrl option 44
TestComponent class 50
testing
ActivatedRoute components 101–102
Angular applications 1–9, 209–210
for failures with asynchronous services 88–89
HTTP services with observables 89–92
PreferencesService 77–82–82, 83
Protractor screenshots 170–175
router navigation with RouterTestingModule 97–101
testing documentation 209
TestModuleMetadata variable 51
tests
for attribute directives, creating 48–48–51, 54
for Protractor, writing 114–114–117, 117
for structural directives, creating 55–56–57, 58
writing, using Jasmine 14–
test suites
for attribute directives, setting up 50–51
for structural directives, setting up 56–57
textToBePresentInElement 146
textToBePresentInElementValue 146
then( ) block 174
tick( ) method 84
titleContains 146
titleIs 146
token-provider map 75
toString( ) method 5
toThrowError( ) method 82
tsc command 115
ts-node npm package 166
TypeScript class
UpdateContact method, testing 38–41
urlContains 146
urlIs 146
UserAuthentication service 105
UserPreferencesResolver 107
vfb (virtual framebuffer) 192
viewProviders option 44
virtual framebuffer (vfb) 192
visibilityOf 146
waitForAngular function, disabling 143–144
WebDriver
-webDriverLogDir option 176
webdriver-manager node module 114
WebElement class 151
web elements, filtering 130–132
whenStable method 84
window.setTimeout( ) method 155
writeScreenshot( ) function 172
XMLHttpRequest( ) method 155
Xvfb plugin 193
18.117.107.90