index

Symbols

@Component decorator 44

@Injectable class decorators 73, 7676

@types node 114

$timeout service 155155

*ngFor 131

A

ActivatedRoute.snapshot.data 108

ActivatedRoute components, testing 101102

afterEach function 19, 63

alertIsPresent 146

Angular platform

CLI

creating services with 7677

installing 205205

overview of 203204

updating 205206

verifying installation of 206206

import statements 3032

nontesting module statements 3232

pages without, testing 142145

routers in 9497

services in 7376

testing 19, 209210

waiting for, automatically 144144

applications, running 207207

arrays, mapping contact lists to 133135

async/await keywords 183184

asynchronous code, changes to testing 8688

asynchronous functions 180181

asynchronous services, testing for failures with 8889

<a> tag 120

attribute directives

overview of 45

testing 4554

AuthenticationGuard 106

<base href> tag 94

B

BDD (behavior-driven development) 14

beforeEach functions, adding 343536, 36

blocking proxy features 179179

browser.executeScript method 151

browser.pause( ) method 186

browser.sleep( ) method 145

browser.takeScreenshot( ) method 170

browser.waitForAngular( ) function 171, 173

browser.waitForAngularEnabled() function 145145

browser.wait function 124, 145, 150151

browser event loops 155155

browsers, obtaining elements from 151151

browserstackKey 162

browserstackUser 162

BrowserStorage 75

BrowserStorageAsyncMock 88

BrowserStorageMock 80

by methods 125127

C

CanActivateChild 97

canActivate property 97, 105, 106

CanDeactivate 97

catch method 89

Chrome DevTools, debugging Protractor with 180187

chromedriver binary 116, 162

CI (continuous integration) 191202

CircleCI platform 200202

clear method 127

CLI (command-line interface) 2

click method 137, 138

code quality 7

color, adding as parameter 4848

[color] parameter 48

command-line interface (CLI) 2

compareScreenshot( ) function 172, 173

comparing screenshots 172175

components

directives vs. 4445

of router parameters, testing 103104

overview of 2

testing 252941, 41

conditions, custom 150151

configuration files, in Protractor 161170

configureTestingModule method 51

ContactClass 17, 18

ContactDetail component 44

ContactEditComponent class 101

ContactFeedDialogComponent 157

contactId 94

Contact interface 134

ContactListComponent 72

ContactListPageObject 138

contact lists

mapping to arrays 133135

waiting to load 146147

ContactPreferences 83

contacts

creating 119122

with invalid data 122125

Contacts App Starter 6

ContactService, faking 3434

contact variable 18, 19

control flow, in Protractor 180187

createClickButton method 137

createComponent method 51

curr parameter 137

d

data, resolving before loading routes 107108

debugging

Protractor, experimental features 176179

Protractor with Chrome DevTools 180187

defaultTrueElementIndex 52

default usage, for pipes 6165

dependencies

importing 3033

installing 206206

dependency injections 7475

describe function 14, 63

dialog, testing 147148

directConnect flag 116, 162

directives

components vs. 4445

overview of 2, 4445

testing 4358

testing attribute directives 4554

testing structural directives 5458

types of 4545

disabling waitForAngular 143144

dispatchEvent method 53

doBrowserThings( ) method 155

doClassesMatch method 52

done method 84

driver provider options, in Protractor 162162

E

E2E (end-to-end) tests

on Jenkins 197200

overview of 67

unit tests vs. 79

ElementFinder 120, 122

element methods 125127

elements

interacting with in Protractor 118125

interacting with list of 130137

obtaining from browser 151151

waiting to become stale 148149

elementToBeClickable 146

elementToBeSelected 146

environment variables, in Protractor 168170

expected conditions 154154

ExpectedConditions object, waiting with 145149

expectedOutlineStarList 53

expectedSolidStarList 52

expect method 14, 83

F

failing test 17

faking ContactService 3434

FavoriteIcon 44

FEED_UPDATES array 153

file globbing 118

filterFn function 130

filter function 130

filtering web elements 130132

findAllPosts( ) function 151

findElement method 125

fixture.detectChanges( ) method 51

fixture variable 50

flaky test 142

flushMicrotasks 88, 88

format parameter 65

format variable 66

FormBuilder 74

G

generating links 9898

getAttribute method 127

getCssValue method 127

getElement function 56

getItem method 75, 79

get method 20

getProperty( ) method 80, 85

getPropertyAsync method 88

getStarElement method 52, 56

getTagName method 127

getText method 127

getWebElement method 127

globbing 118

H

happy path 82

headless environment 191

headless mode 164

highlight delay feature 178179

-highlightDelay flag 178

HighlightRowDirective 43

HttpClient 71

HttpClientTestingModule 90, 91

HTTP services, with observables 8992

I

I/O operation 180

IContactPreferences interface 80

id property 21

<i> element 50

importing dependencies 3033

import statements

in Angular 3032

overview of 57

IndexedDB 87

InjectionToken function 75

installing

Angular CLI

overview of 205205

verifying installation of 206206

dependencies 206206

prerequisites 204206

Protractor 117118

sample projects 206206

invisibilityOf 146

IS_CIRCLE variable 200

IS_JENKINS flag 197, 198

isDisplayed method 127

isElementPresent method 127

isPresent method 127

it method 14, 84, 182

J

jasmine-reporters node 166

Jenkins server 192200

K

karma-chrome-launcher plugin 195

karma-junit-reporter plugin 194

L

lazy loading 97

lifecycle hooks 95, 166

links, generating 9898

loadContact method 3838

loading contact lists 146147

loggingPrefs 164

long-running tasks 152159

looksSame.createDiff( ) function 173

M

managed promise 181

map function 133

mapping contact lists, to arrays 133135

matcher functions 14

mimicking user interactions 8

mock observables 105105

mouseenter event 53

multiCapabilities 165

N

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 3232

not.toBeNull( ) method 19

npm install command 206

O

observables

HTTP services with, testing 8992

mock 105105

onPrepare function 116, 166

OOP (object-oriented programming) 4

P

package.json 114114

page objects, in Protractor 137140

parameters

multiple, testing pipes with 6769

single, testing pipes with 6567

phone numbers

invalid, testing pipes for 6465

valid, testing pipes for 6264

pipes

overview of 2

testing 59606061, 69, 69

plugins, in Protractor 166168

pollForever( ) function 156

postTest( ) function 171

pree2e script 114

PreferencesService

testing 77828282, 83, 83

writing 7882

pre-loading data 105

prerequisites, installing 204206

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

overview of 180181

services with, testing 8389

Protractor 111140, 161187

pure function 59

pyramid of doom 181

R

reduce function 135137

resolve method 97

resolver guard 105

resolving data 105

routed components, testing 97105

route guards 95, 9697105, 107

Router.navigate( ) method 101

router configuration 94

RouterLink directive 98

router parameters, testing 101105

routers

in Angular 9497

testing 93108

testing navigation with RouterTestingModule 97101

RouterTestingModule

configuring routes 9999

creating test components 9999

generating links 9898

setting up routes 99101

routes

advanced, testing 105105107, 108

configuring 9999

resolving data before loading 107108

setting up 99101

routing 2

S

sanity check 5

sauceKey 162

sauceUser 162

saveContact method 3737

saveProperty( ) method 80, 82

screenshots

comparing 172175

in Protractor, testing 170175

on test failure 171172

taking 170171

seleniumAddress 162

Selenium Server 112

seleniumServerJar 162

sendKeys method 121, 127, 138

separation of concerns principle 72

services 2

setItem method 75, 79

setProperty 85

shouldThrow assertion 82

ShowContactsDirective 55

side effect 59

snapshot 102

spy function 80

stale, elements 148149

stalenessOf 146

starElement variable 51

structural directives

overview of 45

testing 5458

styleUrls option 44

T

takeScreenshot( ) method 170, 171

templateUrl option 44

TestComponent class 50

testing

ActivatedRoute components 101102

advanced routes 105108

Angular applications 19, 209210

attribute directives 4554

components 252941, 41

dialog 147148

directives 4358

for failures with asynchronous services 8889

HTTP services with observables 8992

loadContact method 3838

pages without Angular 142145

pipes 59606061, 69, 69

PreferencesService 778282, 83

Protractor screenshots 170175

routed components 97105

router navigation with RouterTestingModule 97101

router parameters 101105

routers 93108

saveContact method 3737

services 718389, 92

structural directives 5458

UpdateContact method 3841

testing documentation 209

TestModuleMetadata variable 51

tests

adding 3741

creating 1317

E2E tests 67

for attribute directives, creating 484851, 54

for Protractor, writing 114114117, 117

for structural directives, creating 555657, 58

setting up 3336

types of 59

unit tests 56

writing, using Jasmine 14

test suites

for attribute directives, setting up 5051

for structural directives, setting up 5657

textToBePresentInElement 146

textToBePresentInElementValue 146

then( ) block 174

tick( ) method 84

timeouts 141159

titleContains 146

titleIs 146

token-provider map 75

toString( ) method 5

toThrowError( ) method 82

transform method 60, 66

tsc command 115

ts-node npm package 166

TypeScript class

configuration files 115115

overview of 35

U

unit tests 56

UpdateContact method, testing 3841

urlContains 146

urlIs 146

UserAuthentication service 105

UserPreferencesResolver 107

V

vfb (virtual framebuffer) 192

viewProviders option 44

virtual framebuffer (vfb) 192

visibilityOf 146

W

waitForAngular function, disabling 143144

WebDriver

control flow 181183

logs 176178

-webDriverLogDir option 176

webdriver-manager node module 114

WebElement class 151

web elements, filtering 130132

whenStable method 84

window.setTimeout( ) method 155

writeScreenshot( ) function 172

X

XMLHttpRequest( ) method 155

Xvfb plugin 193

Z

zone 84, 156

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.117.107.90