Beruflich Dokumente
Kultur Dokumente
0
Node js Version 12.13.0
protractor Version 5.4.2
node js
protractor
tern plugin using eclipse
C:\Program Files\nodejs\
321.11124
C:\Program Files\nodejs
Config file contains : The configuration file lets you change things like which
browsers are used and how to connect to the Selenium Server.
exports.config = {
framework: 'jasmine',
seleniumAddress: 'http://localhost:4444/wd/hub',
specs: ['spec.js'],
capabilities: {
browserName: 'firefox'
}
}
Protractor Locators:
Binding: Finds the element based on the partial match of the attribute(Text)
Ex: element(by.binding('person.email'));
..........................................................................
exactBinding:
Selects the exact value of the attribute
Model locator checks whether any element has ng-model values matching with given
locator, if so that element will be returned
<span ng-model="person.name"></span>
// usage of locator
element(by.model('person.name'));
xPath : //input[@ng-model='Auth.user.name']
.......................................................................
ButtonText:
buttonText locator will try to match with an element which as same text as the
given locator, or its sub element inside the button tag
<button>Save</button>
// usage of locator
element(by.buttonText('Save'));
//HTML code
<button>
<label>Save As //matches
</label>
</button>
// usage of locator
element(by.buttonText('Save As'));
.........................................................................
partialButtonText
partialButtonText locator tries to find element with partial match present in the
button element's text
// usage of locator
element(by.buttonText('Save As'));
.........................................................................
exactRepeater, Repeater:
.........................................................................
cssContainingText
<ul>
<li class="pet">Dog</li> //matches
<li class="pet">Cat</li>
</ul>
protractor ./conf.js
.........................................................................
Login.spec.js
->number
->string
->boolean
->void
->undefined
->null
Ex:
.......................................................................
typescript Version
3.8.0
.......................................................................
Project Structure:
|-- project-folder
|-- app
|-- css
|-- img
|-- partials
home.html
profile.html
contacts.html
|-- js
|-- controllers
|-- directives
|-- services
app.js
...
index.html
|-- test
|-- unit
|-- e2e
home-page.js
home-spec.js
profile-page.js
profile-spec.js
contacts-page.js
contacts-spec.js