Skip to content

Commit

Permalink
Merge pull request #49 from AxaFrance/complete-java-doc
Browse files Browse the repository at this point in the history
Documentation of Java version of the framework
  • Loading branch information
huaxing-yuan authored Nov 27, 2023
2 parents c55a50a + 2464ab3 commit 698d9e8
Show file tree
Hide file tree
Showing 32 changed files with 1,496 additions and 44 deletions.
53 changes: 53 additions & 0 deletions src/AxaFrance.WebEngine.Doc/articles/appsettings-java.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Test Configuration File

To simplify command line arguments, some parameters can be specified in a configuration file `application.yml`.
If a parameter is provided in both side, the value provided in command-line will be taken account.

```yaml
webengineConfiguration:
name: myproject-automation
platformName: WINDOWS
browserName: CHROME
browserOptionList:
- --incognito
- --remote-allow-origins=*
appiumConfiguration:
gridConnection: https://hub-cloud.browserstack.com/wd/hub
userName: XXXXXXX
password: XXXXXXX
localTesting:
activate: false
arguments:
force: true
forcelocal: true
binarypath: C:\\BrowserStack\\BrowserStackLocal.exe
localIdentifier: XXXX-YYYY
capabilities:
desiredCapabilitiesMap:
geoLocation: FR
deviceName: Samsung Galaxy S20 Ultra
osVersion: 10.0
projectName: myproject-automation
buildName: myproject-automation-mobile
sessionName: Samsung
local: true
networkLogs: true
localIdentifier: XXXX-YYYY
applicationConfiguration:
values:
key-1: value-1
key-2: value-2
key-3: value-3
```
## General Options
* `name`: The automation project name.
* `platformName`: WINDOWS, ANDROID OR IOS
* `browserName`: CHROMIUM_EDGE, CHROME, FIREFOX, SAFARI.
* `browserOptionList`: Browser option list
* `appiumConfiguration`: Configuration properties for browserstack. Refer to the browserstack documentation
* `localTesting.activate`: Activate or not local testing
* `Capabilities`: To provided necessary Appium capabilities or options for special need.

> [!NOTE]
> Modifying capabilities may affect the behavior for Web Mobile and App Mobile testing, use it only when it's necessary.
58 changes: 29 additions & 29 deletions src/AxaFrance.WebEngine.Doc/articles/dev-status.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,34 +19,34 @@ These actions are available for WebElementDescription. Please note that some act

|Action|.NET|Java|Description|Synchronized|
|---------|----|----|-----------|--------|
|FindElement()|||Finds a unique Web Element with current element description.||
|FindElement(By)|| |Finds an sub-element of the current Web Element||
|FindElements()|||Finds one or more Web Elements with current element description.(for example options of a `select` element or buttons in the same `radio button group`)||
|FindElements(By)|||Finds one or more sub-element of the current unique Web Element||
|Exists()|||Checks if an Web Element exists on the DOM||
|Clear()|||Clears the value of the element (for text-boxes, text-areas and password-boxes)||
|Click()|||Clicks on the Web Element||
|CheckByValue(String)|||Checks an option of radio button group based on html attribute `value`. The current description corresponds to all radio buttons of the same group||
|DragAndDropTo(ElementDescription)|||Drags the current element and drops to another element. (works only on desktop browser)||
|GetAttribute(string)|||Gets the value of the given html attribute||
|GetInnerHtml()|||Gets the value of the html attribute `innerHTML`||
|GetOuterHtml()|||Gets the value of the html attribute `outerHTML`||
|GetScreenshot()|||Generates a screenshot of the current web page||
|MouseHover()|||Hovers the mouse on a given element (Desktop only. on mobile devices, a Click will be performed instead.)||
|RightClick()|||Preforms right-click on an element. On Mobile devices, an long touch will be performed||
|ScrollIntoView()|||Scrolls the screen until the element is shown in the current view port||
|SendKeys(string)|||Sends the text to textbox based elements (for text-box, text-area and password-box)||
|SetSecure(String)|||Takes a crypted data, and set the value to a password-box (works only on password-box)||
|SetValue(string)|||Clear the current value of textbox based elements and replace with provided value (for text-box, text-area and password-box)||
|GetText()|||Gets the text property of the element (for text-box and text-area)||
|Value|||Gets the `value` attribute of the element (usually in html forms)||
|IsSelected|||Checks if the Web Element is selected. Applies only on checkboxes, options in a select element and radio buttons||
|IsEnabled|||Checks if the Web Element is enabled||
|IsDisplayed|||Checks if the Web Element is visible (Either in viewport or not on mobile devices)||
|IsVisibleInViewPort|||Checks if the Web Element is visible in the current view port||
|AsSelect()|||Converts the Web Element into a `SelectElement`||
|SelectByIndex(Int32)|||Considers current Web Element is `select` and choose an option based on index||
|SelectByText(String)|||Considers current Web Element is `select` and choose an option based on displayed text||
|SelectByValue(String)|||Considers current Web Element is `select` and choose an option based on `value` attribute||
|FindElement()|||Finds a unique Web Element with current element description.||
|FindElement(By)|| |Finds an sub-element of the current Web Element||
|FindElements()|||Finds one or more Web Elements with current element description.(for example options of a `select` element or buttons in the same `radio button group`)||
|FindElements(By)|||Finds one or more sub-element of the current unique Web Element||
|Exists()|||Checks if an Web Element exists on the DOM||
|Clear()|||Clears the value of the element (for text-boxes, text-areas and password-boxes)||
|Click()|||Clicks on the Web Element||
|CheckByValue(String)|||Checks an option of radio button group based on html attribute `value`. The current description corresponds to all radio buttons of the same group||
|DragAndDropTo(ElementDescription)|||Drags the current element and drops to another element. (works only on desktop browser)||
|GetAttribute(string)|||Gets the value of the given html attribute||
|GetInnerHtml()|||Gets the value of the html attribute `innerHTML`||
|GetOuterHtml()|||Gets the value of the html attribute `outerHTML`||
|GetScreenshot()|||Generates a screenshot of the current web page||
|MouseHover()|||Hovers the mouse on a given element (Desktop only. on mobile devices, a Click will be performed instead.)||
|RightClick()|||Preforms right-click on an element. On Mobile devices, an long touch will be performed||
|ScrollIntoView()|||Scrolls the screen until the element is shown in the current view port||
|SendKeys(string)|||Sends the text to textbox based elements (for text-box, text-area and password-box)||
|SetSecure(String)|||Takes a crypted data, and set the value to a password-box (works only on password-box)||
|SetValue(string)|||Clear the current value of textbox based elements and replace with provided value (for text-box, text-area and password-box)||
|GetText()|||Gets the text property of the element (for text-box and text-area)||
|Value|||Gets the `value` attribute of the element (usually in html forms)||
|IsSelected|||Checks if the Web Element is selected. Applies only on checkboxes, options in a select element and radio buttons||
|IsEnabled|||Checks if the Web Element is enabled||
|IsDisplayed|||Checks if the Web Element is visible (Either in viewport or not on mobile devices)||
|IsVisibleInViewPort|||Checks if the Web Element is visible in the current view port||
|AsSelect()|||Converts the Web Element into a `SelectElement`||
|SelectByIndex(Int32)|||Considers current Web Element is `select` and choose an option based on index||
|SelectByText(String)|||Considers current Web Element is `select` and choose an option based on displayed text||
|SelectByValue(String)|||Considers current Web Element is `select` and choose an option based on `value` attribute||


6 changes: 6 additions & 0 deletions src/AxaFrance.WebEngine.Doc/articles/report-viewer.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,14 @@ ReportViewer is an application to view test results in a graphical way.

As shown as follow, Test cases executed have been listed on the left side. Once a test case is selected, detailed test steps, test data, screenshot and other necessary information will be shown on the right side.

With thick client :

![Report Viewer](../images/report-viewer.png)

With thin client :

![Html report viewer](../images/img-report-html.png)


## When report is generated?
Each test execution via `WebRunner.exe` or `webrunner.jar` generates a test report in the given directory provided by `-outputDir` parameter.
Expand Down
2 changes: 1 addition & 1 deletion src/AxaFrance.WebEngine.Doc/articles/webengine-web.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ else
LoginPage page = new LoginPage(driver);
page.getTxtUsername().setValue("admin@test.com"); //fill username
page.getTxtPassword().sendKeys("password"); //fill password
page.getButtonSubmit().Click();
page.getButtonSubmit().click();

if (page.getSpanErrorMessage().isDisplayed()){ //check if error message shows
//error message displayed, test failed.
Expand Down
16 changes: 10 additions & 6 deletions src/AxaFrance.WebEngine.Doc/articles/webrunner.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ webrunner "-a:<testproject>" [-data:<testdata>] [-env:<env_ariable>] [-browser:<
```
# [Java](#tab/java)
```batch
java -jar webrunner.jar "-a:<testproject>" [-data:<testdata>] [-env:<env_ariable>] [-browser:<browser-type>] [optional_arguments]
java -jar MyProject.jar [-data:<testdata>] [-env:<env_ariable>] [-browser:<browser-type>] [optional_arguments]
```
***

## Prerequisites
To run tests build with WebEngine Framework, you have to provide compiled test automation solution.
* `-a:<testproject>`: the filename or full path of compiled test project: DLL library for .NET or a JAR package for Java.
* `-a:<testproject>`: the filename or full path of compiled test project: DLL library for .NET.

If your solution use Data-Driven approach, it is required to provide at least one of following files:
* `-data:<testdata>`: Test Data to be used for data-driven test execution, in XML format. The file can be exported via `Excel Add-in`
Expand All @@ -36,7 +36,7 @@ WebRunner.exe "-a:MyProject.dll" "-data:Data.xml" "-env:Staging.xml" "-browser:F

# [Java](#tab/java)
```batch
java -jar webrunner.jar "-a:project.jar" "-data:Data.xml" "-env:Staging.xml" "-browser:Firefox" "-outputDir:C:\Temp"
java -jar MyProject.jar "-data:Data.xml" "-env:Staging.xml" "-browser:Firefox" "-outputDir:C:\Temp"
```
***

Expand All @@ -51,7 +51,7 @@ WebRunner.exe "-a:MyProject.dll" "-data:Data.xml" "-env:Env.xml" "-platform:Andr

# [Java](#tab/java)
```batch
java -jar webrunner.jar "-a:MyProject.jar" "-data:Data.xml" "-env:Env.xml" "-platform:Android" "-browser:Chrome" "-device:Emulator" "-outputDir:C:\Temp"
java -jar MyProject.jar "-data:Data.xml" "-env:Env.xml" "-platform:Android" "-browser:Chrome" "-device:Emulator" "-outputDir:C:\Temp"
```
***

Expand All @@ -65,15 +65,19 @@ WebRunner.exe "-a:AppProject.dll" "-data:Data.xml" "-env:Staging.xml" -platform:
## Optional parameters

> [!NOTE]
> Some parameters can be provided in the configuration file `appsettings.json` for C# and `application-properties.yml` for JAVA. please refer to [Test Configuration](appsettings.md)
> Some parameters can be provided in the configuration file `appsettings.json` for C# and `application-properties.yml` for JAVA.
> Please refer to [Test Configuration C#](appsettings.md) for C#
> Please refer to [Test Configuration JAVA](appsettings-java.md) for Java
### Commun parameters
#### -browser:\<browser>
Specifies the browser on which to run test. see: <xref:AxaFrance.WebEngine.BrowserType>.
#### -platform:\<platform>
Specifies The platform for test execution: see: <xref:AxaFrance.WebEngine.Platform>. Default value is `Windows`.
#### -outputDir:\<outputFolder>
Specifies the folder to store output of test execution and test report. This parameter is can be defined in `appsetting.json` for C# and `application-properties.yml` for JAVA.
Specifies the folder to store output of test execution and test report. This parameter is can be defined in `appsetting.json` for C# and `application.yml` for JAVA.

#### -m
Specifies the manual debug mode. Use this mode for debugging test scenarios locally. When the test is failed test will pause for manual intervention before clean-up process.
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 698d9e8

Please sign in to comment.