new module:br-test /View Fixture(view Selector)
Constructs a ViewFixture
.
Parameters:
Name | Type | Description |
---|---|---|
viewSelector |
String | (optional) CSS selector to identify the parent view element for this fixture |
- Implements:
Methods
add View Handlers(view Handlers Map)
Allows custom view handlers to be added.
Parameters:
Name | Type | Description |
---|---|---|
viewHandlersMap |
Map | A map of handler name to handler class constructor reference. |
Throws:
-
If an attempt is made to override an existing handler.
- Type
-
br
/Errors .Invalid Parameters Error
can Handle Property(property Name) → {Boolean}
This method is called by the GWTTestRunner to check whether a property used in a GWT test is supported by the fixture.
Parameters:
Name | Type | Description |
---|---|---|
propertyName |
String | the property name to check. |
- Implements:
Returns:
true if the fixture handles the property; false otherwise.
- Type
- Boolean
do Given(property Name, value)
This method is called in order to manipulate a property on the system under test in a given clause.
Parameters:
Name | Type | Description |
---|---|---|
propertyName |
String | The property to be changed. |
value |
String | The new value of the property. |
- Implements:
do Then(property Name, value)
This method is called in order to assert a property's value on the system under test.
Parameters:
Name | Type | Description |
---|---|---|
propertyName |
String | The property name to assert. |
value |
String | The value to assert. |
- Implements:
do When(property Name, value)
This method is called in order to manipulate a property on the system under test in a when clause.
Parameters:
Name | Type | Description |
---|---|---|
propertyName |
String | The property to be changed. |
value |
String | The new value of the property. |
- Implements:
set Selector Mappings(selector Mappings)
Set the selector mappings to use with this fixture.
This allows users to create a shorthand for a selector, so that the same selector doesn't need to be repeated across different tests.
Calling: viewFixture.setSelectorMappings({'my-mapping': '.some .selector'});
then allows you to use
that mapping in the test: then("form.view.(my-mapping).text = 'foo'");
.
Parameters:
Name | Type | Description |
---|---|---|
selectorMappings |
Object | Map of selector mappings. |
set Up()
This method is called just before a GWT test. This optional interface method can be implemented if the fixture is required to correctly set up the system-under-test before each test.
- Implements:
tear Down()
This method is called just after a GWT test. This optional interface method can be implemented if the fixture is required to correctly tear down the system-under-test after each test or to reset any state held in the fixture's implementation.
- Implements: