<commit_before># jpagefactory

## Summary:

JPageFactory is a set of Selenium Java `FindBy` annotations that eases the usage of Selenium page object pattern for automating Angular based web application. 

JPageFactory is implemented based on [JProtractor fork from sergueik](https://github.com/sergueik/jProtractor) and provides the following web elements locators as original Selenium `FindBy` annotations:
* ID
* Name
* XPath
* CSS
* Class Name
* Tag Name
* Link Text / Partial Link Text
   
as well as the following locators from Protractor:
* Binding
* Input
* Model
* Repeater
* Button Text / Partial Button Text
* Options / Selected Options / Repeater Selected Options

JPageFactory also supports defining different locators of the same web element for both desktop web and mobile web applications (Angular applications running in mobile browsers).

## Initializing page object
Using the following APIs to initializing the page object:
```
JPageFactory.initElements(SearchContext searchContext, Channel channel, Object page);

JPageFactory.initWebElements(SearchContext searchContext, Object page);

JPageFacotry.initMobileElements(SearchContext searchContext, Object page);
```
 
## Locator Usage:
Here are examples of using locators from Protractor:

**- Find element by Angular binding**  
_html_: `<h2>{{latest}}</h2>`
_annotation example_: 
```
@FindBy(how = How.BINDING, using = "latest")
private WebElement latestResult;
```

**- Find input element with Angular ng-model**  
_html_: `<input ng-model="first" type="text" class="input-small"/>`
_annotation example_: 
```
@FindBy(how = How.INPUT, using = "first")
private WebElement firstNumber;
```  

**- Find element with Angular ng-model**  <commit_msg>add readme content<commit_after># jpagefactory

## Summary:

JPageFactory is a set of Selenium Java `FindBy` annotations that eases the usage of Selenium page factory pattern for automating Angular based web application. 

JPageFactory is implemented based on [JProtractor fork from sergueik](https://github.com/sergueik/jProtractor) and provides the following web elements locators as original Selenium `FindBy` annotations:
* ID
* Name
* XPath
* CSS
* Class Name
* Tag Name
* Link Text / Partial Link Text
   
as well as the following locators from Protractor:
* Binding
* Input
* Model
* Repeater
* Button Text / Partial Button Text
* Options / Selected Options / Repeater Selected Options

JPageFactory also supports defining different locators of the same web element for both desktop web and mobile web applications (Angular applications running in mobile browsers).

## Initializing page object
Using the following page factory APIs to initializing the page object:
```
JPageFactory.initElements(SearchContext searchContext, Channel channel, Object page);

JPageFactory.initWebElements(SearchContext searchContext, Object page);

JPageFacotry.initMobileElements(SearchContext searchContext, Object page);
```
 
## Locator Usage:
Here are examples of using locators from Protractor:

**- Find element by Angular binding**  
_html_: `<h2>{{latest}}</h2>`
_annotation example_: 
```
@FindBy(how = How.BINDING, using = "latest")
private WebElement latestResult;
```

**- Find input element with Angular ng-model**  
_html_: `<input ng-model="first" type="text" class="input-small"/>`
_annotation example_: 
```
@FindBy(how = How.INPUT, using = "first")
private WebElement firstNumber;
```  

**- Find element with Angular ng-model**  
{'fraction_non_alphanumeric': 0.08856729377713458, 'fraction_numerical': 0.0011577424023154848, 'mean_word_length': 5.341284403669725, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6129289', 'n_tokens_mistral': 990, 'n_tokens_neox': 921, 'n_words': 376}