Skip to content

Commit

Permalink
chore: library updates
Browse files Browse the repository at this point in the history
  • Loading branch information
eliasnogueira committed Oct 27, 2024
1 parent 1832f49 commit eb2fd86
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 13 deletions.
27 changes: 17 additions & 10 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ The browser used in the test is placed on the `browser` property in the `general

##### Local Suite

It's the same as the Local Execution, where the difference is that the browser is taken from the TestNG suite file instead of the `general.properties`
It's the same as the Local Execution, where the difference is that the browser is taken from the TestNG suite file
instead of the `general.properties`
file, enabling you to run multi-browser test approach locally.

##### Testcontainers
Expand All @@ -118,6 +119,7 @@ the container based on the browser set in the `browser` property. Currently, Tes
Firefox.

Example

```shell
mvn test -Pweb-execution -Dtarget=testcontainers -Dbrowser=chrome
```
Expand Down Expand Up @@ -153,7 +155,8 @@ Each browser is an `enum`, and each enum implements four methods:
* `createDriver()`: creates the browser instance for the remote execution
* `getOptions()`: creates a new browser `Options` setting some specific configurations, and it's used for the remote
executions using the Selenium Grid
* `createTestContainerDriver()` : Creates selenium grid lightweight test container in Standalone mode with Chrome/Firefox/Edge browser support.
* `createTestContainerDriver()` : Creates selenium grid lightweight test container in Standalone mode with
Chrome/Firefox/Edge browser support.

You can see that the `createLocalDriver()` method use the `getOptions()` to get specific browser configurations, as
starting the browser maximized and others.
Expand Down Expand Up @@ -211,7 +214,8 @@ factory [BookingDataFactory](https://github.com/eliasnogueira/selenium-java-lean

The parallel test execution is based on
the [parallel tests](https://testng.org/doc/documentation-main.html#parallel-tests)
feature on TestNG. This is used by `selenium-grid.xml` test suite file which has the `parallel="tests"` attribute and value,
feature on TestNG. This is used by `selenium-grid.xml` test suite file which has the `parallel="tests"` attribute and
value,
whereas `test` item inside the test suite will execute in parallel.
The browser in use for each `test` should be defined by a parameter, like:

Expand All @@ -237,18 +241,21 @@ Please note that you need to do the following actions before running it in paral

* Docker installed
* Pull the images for Chrome Edge and Firefox - Optional
* Images are pulled if not available and initial test execution will be slow
* `docker pull selenium-standalog-chrome`
* `docker pull selenium-standalog-firefox`
* `docker pull selenium/standalone-edge`
* If you are using a MacBook with either M1 or M2 chip you must check the following experimental feature in Docker Desktop: Settings -> Features in development -> Use Rosetta for x86/amd64 emulation on Apple Silicon
* Images are pulled if not available and initial test execution will be slow
* `docker pull selenium-standalog-chrome`
* `docker pull selenium-standalog-firefox`
* `docker pull selenium/standalone-edge`
* If you are using a MacBook with either M1 or M2 chip you must check the following experimental feature in Docker
Desktop: Settings -> Features in development -> Use Rosetta for x86/amd64 emulation on Apple Silicon
* Pay attention to the `grid/config.toml` file that has comments for each specific SO
* Start the Grid by running the following command inside the `grid` folder
* `docker-compose up`
* Run the project using the following command

```shell
mvn test -Pweb-execution -Dsuite=selenium-grid -Dtarget=selenium-grid -Dheadless=true
```

* Open the [Selenium Grid] page to see the node status

### Configuration files
Expand Down Expand Up @@ -295,7 +302,7 @@ To execute this suite, via the command line you can call the parameter `-P` and
Eg: executing the multi_browser suite

``` bash
mvn test -Pweb-execution -Dtestng.dtd.http=true
mvn test -Pweb-execution
```

If you have more than one suite on _src/test/resources/suites_ folder you can parameterize the xml file name.
Expand Down Expand Up @@ -333,7 +340,7 @@ To do this you need:
* Use `-Dsuite=suite_name` to call the suite

````bash
mvn test -Pweb-execution -Dsuite=parallel
mvn test -Pweb-execution -Dsuite=suite_name
````

### Pipeline as a code
Expand Down
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.eliasnogueira</groupId>
<artifactId>selenium-java-lean-test-architecture</artifactId>
<version>3.4.6</version>
<version>3.4.7</version>

<scm>
<connection>scm:[email protected]:eliasnogueira/selenium-java-lean-test-architecture.git</connection>
Expand All @@ -25,7 +25,7 @@
<selenium.version>4.25.0</selenium.version>
<testng.version>7.10.2</testng.version>
<assertj.version>3.26.3</assertj.version>
<datafaker.version>2.4.0</datafaker.version>
<datafaker.version>2.4.1</datafaker.version>
<log4j.version>2.23.1</log4j.version>
<owner.version>1.0.12</owner.version>
<allure.version>2.29.0</allure.version>
Expand All @@ -34,7 +34,7 @@
<allure.cmd.download.url>
https://repo.maven.apache.org/maven2/io/qameta/allure/allure-commandline
</allure.cmd.download.url>
<testcontainers.selenium.version>1.20.2</testcontainers.selenium.version>
<testcontainers.selenium.version>1.20.3</testcontainers.selenium.version>

<!-- Vulnerability temp libs-->
<commons-compress.version>1.27.1</commons-compress.version>
Expand Down

0 comments on commit eb2fd86

Please sign in to comment.