import {ProtractorParam} from '@serenity-js/protractor/lib/screenplay/questions'
ProtractorParam
Returns a Protractor configuration parameter specified in protractor.conf.js
.
Note that Protractor configuration parameters can be overridden via the command line.
Extends:
Question<Promise<T>> → ProtractorParam
Examples:
protractor.conf.js
exports.config = {
params: {
login: {
username: 'jane@example.org'
password: process.env.PASSWORD
}
}
// ...
}
Overriding configuration parameter via the command line
protractor ./protractor.conf.js --params.login.username="bob@example.org"
Using in a test scenario
import { actorCalled } from '@serenity-js/core';
import { BrowseTheWeb, Enter, ProtractorParam } from '@serenity-js/protractor';
import { protractor } from 'protractor';
actorCalled('Jane')
.whoCan(BrowseTheWeb.using(protractor.browser))
.attemptsTo(
Enter.theValue(ProtractorParam.called('login.username').into(Form.exampleInput),
);
Tests:
- ProtractorParam lets the actor read the value of a primitive Protractor parameter specified in protractor.conf.js
- ProtractorParam lets the actor read the value of an object Protractor parameter specified in protractor.conf.js
- ProtractorParam lets the actor read the value of a Protractor parameter specified by path
- ProtractorParam complains if the parameter is undefined
- ProtractorParam contributes to a human-readable description of an activity
See also:
Static Method Summary
Static Public Methods | ||
public static |
called(name: Answerable<string>): ProtractorParam<R> Name of the parameter to retrieve. |
Constructor Summary
Public Constructor | ||
public |
constructor(name: Answerable<string>) |
Method Summary
Public Methods | ||
public |
answeredBy(actor: AnswersQuestions & UsesAbilities): Promise<void> |
Static Public Methods
public static called(name: Answerable<string>): ProtractorParam<R> source
Name of the parameter to retrieve. This could also be a dot-delimited path,
i.e. login.username
Params:
Name | Type | Attribute | Description |
name | Answerable<string> |
Tests:
- ProtractorParam lets the actor read the value of a primitive Protractor parameter specified in protractor.conf.js
- ProtractorParam lets the actor read the value of an object Protractor parameter specified in protractor.conf.js
- ProtractorParam lets the actor read the value of a Protractor parameter specified by path
- ProtractorParam complains if the parameter is undefined
- ProtractorParam contributes to a human-readable description of an activity
Public Constructors
public constructor(name: Answerable<string>) source
Params:
Name | Type | Attribute | Description |
name | Answerable<string> |
Public Methods
public answeredBy(actor: AnswersQuestions & UsesAbilities): Promise<void> source
Params:
Name | Type | Attribute | Description |
actor | AnswersQuestions & UsesAbilities |
Returns:
Promise<void> |