Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 1 addition & 28 deletions webtau-docs/znai/HTTP/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,7 @@ To learn about all configuration capabilities, head over to [Configuration page]

# Base URL {style: "api"}

Use `url` to set base url for your tests.

```tabs
Groovy:

:include-file: scenarios/rest/urlOnly.cfg.groovy {
title: "webtau.cfg.groovy",
includeRegexp: "localhost"
}

Note: WebTau treats groovy config file as code

Java:

When you use JUnit like runners, e.g. [JUnit5](getting-started/installation#junit5), WebTau expects file named
`webtau.properties` to be present in test classpath, e.g. test resources:

:include-file: webtau-junit5-examples/src/test/resources/webtau.properties {
title: "src/test/resources/webtau.properties",
includeRegexp: "localhost"
}
```

To set base url using environment variables use

```
export WEBTAU_URL=http://another-server
```
:include-markdown: configuration/common/base-url.md

# Proxy {style: "api"}

Expand Down
26 changes: 15 additions & 11 deletions webtau-docs/znai/browser/basic-configuration.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
# Base URL

WebTau provides configuration option to set base url for your browser `open` commands.
This way you can run your tests in different environments without modifying code base.

:include-groovy: scenarios/ui/basic.groovy

Define base URL either inside a `webtau.cfg.groovy` file

:include-file: scenarios/ui/webtau.cfg.groovy

or pass as a command line argument `--url=http://...`
:include-markdown: configuration/common/base-url.md

# Browser Only Base URL

Expand All @@ -19,10 +10,23 @@ Use `browserUrl` to specify `UI` only base url. This can be handy when your back

# Browser Id

Use `browserId` via command line, or a config file parameter to specify which browser to use.
Use `browserId` via command line, system property, env variable or config file parameter to specify which browser to use.

`````tabs
Groovy:
:include-cli-command: webtau --browserId=firefox

```cli
export WEBTAU_BROWSER_ID=firefox
```
Java:
```cli
... -DbrowserId=firefox
```
```cli
export WEBTAU_BROWSER_ID=firefox
```
`````
Note: Default `browserId` is `chrome`

# Access To Base Url
Expand Down
30 changes: 30 additions & 0 deletions webtau-docs/znai/configuration/common/base-url.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
```tabs
Groovy:

:include-file: scenarios/rest/urlOnly.cfg.groovy {
title: "webtau.cfg.groovy",
include: "localhost"
}

Note: WebTau treats groovy config file as code

Alternatively pass `url` as a command line argument `--url=http://...`

Java:

:include-file: webtau-junit5-examples/src/test/resources/webtau.properties {
title: "src/test/resources/webtau.properties",
include: "localhost"
}

When you use JUnit like runners, e.g. [JUnit5](getting-started/installation#junit5), WebTau expects file named
`webtau.properties` to be present in test classpath, e.g. test resources:

Alternatively pass `url` as a system property `-Durl=http://...`
```

To set base url using environment variables use

```
export WEBTAU_URL=http://another-server
```
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Doc: [Browser Basic Config](browser/basic-configuration) Java examples
4 changes: 4 additions & 0 deletions webtau-docs/znai/release-notes/2023.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
title: 2023 Releases
---

# 2.3

:include-markdowns: 2.3

# 2.2

:include-markdowns: 2.2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ class JUnit5FeatureTestRunner implements StepReporter, TestExecutionListener, Te
cfg.reset()
cfg.triggerConfigHandlers()
cfg.setUrl(baseUrl)
cfg.setUserAgent("Safari/537.36")
cfg.setRemoveWebTauFromUserAgent(true)
cfg.reportPath = cfg.fullPath("webtau-reports/" + testClass.canonicalName + ".html")

if (!browserBaseUrl.isEmpty()) {
Expand Down