25
component-object/README.md
Normal file
25
component-object/README.md
Normal file
@@ -0,0 +1,25 @@
|
||||
---
|
||||
layout: pattern
|
||||
title: Component Object
|
||||
folder: component-object
|
||||
permalink: /patterns/component-object/
|
||||
categories: Testing
|
||||
tags:
|
||||
- Java
|
||||
- Difficulty-Intermediate
|
||||
---
|
||||
|
||||
## Intent
|
||||
Web development is shifting more and more towards reusable components. Frameworks like React, Polymer, Angular etc. provide various component friendly abstractions to make front-end code-bases more maintainable. So our web applications are now full of “widgets” that have same behavior. We can use component various times on single web page or re-use it on various web pages. Therefore it is logical to create abstraction which covers functionality of single component and reuse it across end-to-end tests.
|
||||
|
||||

|
||||
|
||||
## Applicability
|
||||
Use the Component Object Pattern in the following situations:
|
||||
|
||||
* When you have various same components on single web page and you need to test the web page
|
||||
* When you have multiple web pages using same component abstractions and you need to test the web pages
|
||||
|
||||
## Credits
|
||||
|
||||
* [Component Object](https://lkrnac.net/blog/2016/10/component-object-pattern-example/)
|
BIN
component-object/etc/component-object.png
Normal file
BIN
component-object/etc/component-object.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 27 KiB |
72
component-object/etc/component-object.ucls
Normal file
72
component-object/etc/component-object.ucls
Normal file
@@ -0,0 +1,72 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<class-diagram version="1.2.2" icons="true" automaticImage="PNG" always-add-relationships="false" generalizations="true"
|
||||
realizations="true" associations="true" dependencies="false" nesting-relationships="true" router="FAN">
|
||||
<class id="1" language="java" name="com.iluwatar.component.AddItemComponent" project="component-object"
|
||||
file="/component-object/src/test/java/com/iluwatar/component/AddItemComponent.java" binary="false"
|
||||
corner="BOTTOM_RIGHT">
|
||||
<position height="-1" width="-1" x="162" y="206"/>
|
||||
<display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"
|
||||
sort-features="false" accessors="true" visibility="true">
|
||||
<attributes public="true" package="true" protected="true" private="true" static="true"/>
|
||||
<operations public="true" package="true" protected="true" private="true" static="true"/>
|
||||
</display>
|
||||
</class>
|
||||
<class id="2" language="java" name="com.iluwatar.component.ItemsListComponent" project="component-object"
|
||||
file="/component-object/src/test/java/com/iluwatar/component/ItemsListComponent.java" binary="false"
|
||||
corner="BOTTOM_RIGHT">
|
||||
<position height="-1" width="-1" x="995" y="195"/>
|
||||
<display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"
|
||||
sort-features="false" accessors="true" visibility="true">
|
||||
<attributes public="true" package="true" protected="true" private="true" static="true"/>
|
||||
<operations public="true" package="true" protected="true" private="true" static="true"/>
|
||||
</display>
|
||||
</class>
|
||||
<class id="3" language="java" name="com.iluwatar.component.TodoPageObject" project="component-object"
|
||||
file="/component-object/src/test/java/com/iluwatar/component/TodoPageObject.java" binary="false"
|
||||
corner="BOTTOM_RIGHT">
|
||||
<position height="-1" width="-1" x="555" y="198"/>
|
||||
<display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"
|
||||
sort-features="false" accessors="true" visibility="true">
|
||||
<attributes public="true" package="true" protected="true" private="true" static="true"/>
|
||||
<operations public="true" package="true" protected="true" private="true" static="true"/>
|
||||
</display>
|
||||
</class>
|
||||
<association id="4">
|
||||
<end type="SOURCE" refId="3" navigable="false">
|
||||
<attribute id="5" name="addTodoItemComponent"/>
|
||||
<multiplicity id="6" minimum="0" maximum="1"/>
|
||||
</end>
|
||||
<end type="TARGET" refId="1" navigable="true"/>
|
||||
<display labels="true" multiplicity="true"/>
|
||||
</association>
|
||||
<association id="7">
|
||||
<end type="SOURCE" refId="3" navigable="false">
|
||||
<attribute id="8" name="groceryItemsList"/>
|
||||
<multiplicity id="9" minimum="0" maximum="1"/>
|
||||
</end>
|
||||
<end type="TARGET" refId="2" navigable="true"/>
|
||||
<display labels="true" multiplicity="true"/>
|
||||
</association>
|
||||
<association id="10">
|
||||
<end type="SOURCE" refId="3" navigable="false">
|
||||
<attribute id="11" name="todoItemsList"/>
|
||||
<multiplicity id="12" minimum="0" maximum="1"/>
|
||||
</end>
|
||||
<end type="TARGET" refId="2" navigable="true"/>
|
||||
<display labels="true" multiplicity="true"/>
|
||||
</association>
|
||||
<association id="13">
|
||||
<end type="SOURCE" refId="3" navigable="false">
|
||||
<attribute id="14" name="addGroceryItemComponent"/>
|
||||
<multiplicity id="15" minimum="0" maximum="1"/>
|
||||
</end>
|
||||
<end type="TARGET" refId="1" navigable="true"/>
|
||||
<display labels="true" multiplicity="true"/>
|
||||
</association>
|
||||
<classifier-display autosize="true" stereotype="true" package="true" initial-value="false" signature="true"
|
||||
sort-features="false" accessors="true" visibility="true">
|
||||
<attributes public="true" package="true" protected="true" private="true" static="true"/>
|
||||
<operations public="true" package="true" protected="true" private="true" static="true"/>
|
||||
</classifier-display>
|
||||
<association-display labels="true" multiplicity="true"/>
|
||||
</class-diagram>
|
Reference in New Issue
Block a user