Skip to content

Commit 8b38e1e

Browse files
Merge pull request #99 from telekom/feature/manual-improvements
Improvements of Testerra documentation
2 parents 1f57e54 + 1fb09c0 commit 8b38e1e

File tree

13 files changed

+56
-27
lines changed

13 files changed

+56
-27
lines changed

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,17 @@
2222
</p>
2323

2424
## About Testerra
25-
Testerra is an integrated framework for automating tests for (web) applications. Testerra can also be understood as a building block for test automation projects with various basic components. It also includes a prepared "foundation" on which complex test automation environments can be built. Testerra is developed by our Test Automation Experts at T-Systems MMS GmbH Dresden (Website). In numerous projects Testerra is used as the standard test automation framework.
25+
26+
<p align="center">
27+
<img src="docs/src/images/s_Testerra_Logo_0256px.png" alt="Testerra logo">
28+
</p>
29+
30+
It is an integrated Java framework for automating tests for (web) applications. Testerra can also be understood as a building block for test automation projects with various basic components.
2631

2732
You may see Testerra as an open source test automation library for web frontend testing. It provides a tool suite for many use cases: a base API for Page Object Pattern (including responsive layouts) and GuiElements (smarter WebElements (Selenium)), enhanced reporting functionality, a utility collection and some additional helpful modules.
2833

34+
Testerra is developed by our Test Automation Experts at T-Systems MMS in Dresden. In numerous projects Testerra is used as the standard test automation framework and includes the experience of more then 10 years of test automation.
35+
2936
## Setup
3037

3138
Include the following dependency in your project. Please replace `1.0` with the latest version.

docs/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ asciidoctor {
5353
toclevels: 2,
5454
sectnums: '',
5555
sectanchors: '',
56-
Author: 'The Testerra Team of T-Systems MMS GmbH',
56+
Author: 'The Testerra Team of T-Systems MMS',
5757
revnumber: "${version}",
5858
'source-highlighter': 'highlightjs',
5959
'highlightjs-theme': 'atom-one-light',
Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
11
= Setting local capabilities
22

3-
A local defined capability means its only available in the current test execution (current TestNG testmethod).
3+
A local defined capability means its only available in a specific browser session.
44

5+
.Set capabilities to a DesktopWebDriverRequest object
56
[source,java]
67
----
7-
WebDriverManager.addThreadCapability(CapabilityType.ACCEPT_INSECURE_CERTS, true);
8+
DesktopWebDriverRequest request = new DesktopWebDriverRequest();
9+
DesiredCapabilities caps = request.getDesiredCapabilities();
10+
caps.setCapability(CapabilityType.ACCEPT_INSECURE_CERTS, true);
11+
12+
// Start your session with the DesktopWebDriverRequest object
13+
WebDriver driver = WebDriverManager.getWebDriver(request);
814
----
915

1016
[NOTE]
1117
=====
12-
Have a look into <<Useful browser capabilities>> for specific browser options.
18+
Have a look into <<Browser specific knowledge>> for specific browser options.
1319
=====

docs/src/docs/execution/execution-highlighting.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ include::../properties/property-attributes.adoc[]
55
In the demo mode actions on pages are marked with distinctive coloured frames around the element of the action. This mechanism is set by a property
66

77
.test.properties
8-
[source, properties]
8+
[source, properties, subs="attributes"]
99
----
1010
# activate demo mode, default = false
1111
{demomode}=true

docs/src/docs/gettingstarted/manual-steps.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,14 @@ Create a new file at `src/test/resources` with the name `test.properties`.
8585
[source, properties, subs="attributes"]
8686
----
8787
# Setting the browser
88-
{browser}=chrome
88+
{browser_setting}=chrome
8989
9090
# Setting the start page
9191
{baseurl}=http://example.org
9292
----
9393

94-
TIP: All defined properties can be overwritten later by adding system parameters to your command +
95-
(e.a `-D{browser}=firefox`)
94+
TIP: All defined properties can be overwritten later by adding system parameters to your command. +
95+
(e.a `-D{browser_setting}=firefox`)
9696

9797
All supported browsers are listed in <<WebdriverManager properties>>
9898

docs/src/docs/index.adoc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ include::common-attributes.adoc[]
55

66
:sectnums!:
77

8-
= What is Testerra?
98
include::what-is-testerra.adoc[leveloffset=+1]
109

1110
:sectnums:

docs/src/docs/pageobject/pageobjects-overview.adoc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ The annoation `Check` marks the GuiElements as mandatory for the page. Testerra
2929
public class SearchPage extends Page {
3030
3131
@Check
32-
private final GuiElement searchButton = new GuiElement(driver, By.name("searchButton"));
32+
private final GuiElement searchButton = new GuiElement(this.getWebDriver(), By.name("searchButton"));
3333
3434
@Check
35-
private final GuiElement inputField = new GuiElement(driver, By.name("inputField"));
35+
private final GuiElement inputField = new GuiElement(this.getWebDriver(), By.name("inputField"));
3636
3737
// constructor
3838
public SearchPage(WebDriver driver) {
@@ -43,7 +43,7 @@ public class SearchPage extends Page {
4343
public ResultPage search(String text){
4444
inputField.type(text);
4545
searchButton.click();
46-
return PageFactory.create(ResultPage.class, driver);
46+
return PageFactory.create(ResultPage.class, this.getWebDriver());
4747
}
4848
}
4949
----
@@ -58,6 +58,7 @@ public class TestClass extends TesterraTest {
5858
5959
@Test
6060
public void myTest() {
61+
WebDriver driver = WebDriverManager.getWebDriver();
6162
HomePage homePage = PageFactory.create(HomePage.class, driver);
6263
SearchPage searchPage = homePage.openSearch();
6364
ResultPage resultPage = searchPage.search("search text");

docs/src/docs/pageobject/pageobjects-responsive.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ In the test method only the base class will be instantiated. The `PageFactory` w
4242

4343
[source,java]
4444
----
45-
ResponsiveTestPage testPage = Pagefactory.create(ResponsiveTestPage.class, driver);
45+
ResponsiveTestPage testPage = Pagefactory.create(ResponsiveTestPage.class, this.getWebDriver());
4646
----
4747

4848
The parameters for the factory are the base class and the current webdriver instance.

docs/src/docs/properties/webdriver-props.adoc

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ include::property-attributes.adoc[]
55

66
| Property | default | Description
77

8-
| {browser} | na.
9-
a| Browser label, the following browsers are possible
8+
| {browser_setting} | na.
9+
a| Define browser type and optional browser version as single string like `firefox` or `firefox:65` (overrides {browser} and {browser_version}) (recommended). +
10+
The following types of browsrs are supported:
1011

1112
* firefox
1213
* chrome
@@ -17,9 +18,10 @@ a| Browser label, the following browsers are possible
1718
* htmlunit
1819
* chromeHeadless
1920
20-
| {browser_version} | na. | Version label
21-
| {browser_setting} | | You can combine browser type and version as single string like `firefox:65` (overrides {browser} and {browser_version})
22-
| {baseurl} | na. | URL of the first site called in a new browser session
21+
| {browser} | na.
22+
a| Only defines the browser type, will be overwritten by {browser_setting}.
23+
| {browser_version} | na. | Only defines the browser version, will be overwritten by {browser_setting}.
24+
| {baseurl} | na. | URL of the first site called in a new browser session.
2325
| {webdriver_mode} | remote | Sets the webdriver mode. remote uses an external Selenium server
2426
| {selenium_server_url} | na. | The complete URL to a remote Selenium server. +
2527
(e.g.: `http://localhost:4444/wd/hub`)

docs/src/docs/webdrivermanager/webdrivermanager-sessions.adoc

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,20 +48,28 @@ You can also pass the wedriver by the command line using
4848
-Dwebdriver.gecko.driver=C:\absolute\path\to\your\geckodriver.exe
4949
```
5050

51-
== Usage of WebDriver sessions
51+
== Define browser type and version
5252

5353
Before starting a `WebDriver` session, you should configure your desired browser like.
5454

5555
[source,properties,subs="attributes"]
5656
----
57-
# ...this way
58-
{browser}=firefox
59-
{browser_version}=65
57+
# Only browser type
58+
{browser_setting}=firefox
6059
61-
# ... or that way
60+
# ... or with version
6261
{browser_setting}=firefox:65
6362
----
6463

64+
[NOTE]
65+
====
66+
You can also define browser config via the settings `{browser}` and `{browser_version}`, but the version is independent from browser type.
67+
68+
If you have different browser configurations in your Selenium grid you have to take care about the correct combination!
69+
====
70+
71+
== Usage of WebDriver sessions
72+
6573
On the first call of
6674

6775
[source,java]

0 commit comments

Comments
 (0)