Skip to content

Commit 25ecc7b

Browse files
authored
Merge pull request #26 from Skejven/feature/aet-docker-client
AET Docker client
2 parents f5058bf + c2cec7d commit 25ecc7b

4 files changed

Lines changed: 103 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Not released yet
2+
- [PR-26](https://github.com/Skejven/aet-docker/pull/26) - AET Docker client for running AET suites with no dependencies but Docker
23
- [PR-22](https://github.com/Skejven/aet-docker/pull/22) - changed no of Selenium Grid Nodes replicas in order to improve tests results stability.
34
- [PR-23](https://github.com/Skejven/aet-docker/pull/23) - updated mongodb image version to `3.6`. **Important**: if you are upgrading AET from the version that used mongo 3.2, please read carefully upgrade notes before migrating. Updated docker swarm schema to `3.7`.
45

README.md

Lines changed: 39 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ You may find released versions of AET Docker images at [Docker Hub](https://clou
99
- [Docker Images](#docker-images)
1010
* [AET ActiveMq](#aet-activemq)
1111
* [AET Browsermob](#aet-browsermob)
12-
* [AET Apache Karaf](#aet-apache-karaf)
13-
* [AET Apache Server](#aet-apache-server)
12+
* [AET Karaf](#aet-karaf)
13+
* [AET Report](#aet-report)
14+
* [AET Docker Client](#aet-docker-client)
1415
- [Running AET instance with Docker Swarm](#running-aet-instance-with-docker-swarm)
1516
* [Prerequisites](#prerequisites)
1617
* [Instance setup](#instance-setup)
@@ -19,7 +20,9 @@ You may find released versions of AET Docker images at [Docker Hub](https://clou
1920
+ [OSGi configs](#osgi-configs)
2021
+ [Throughput and scaling](#throughput-and-scaling)
2122
* [Updating instance](#updating-instance)
22-
* [Executing AET Suite](#executing-aet-suite)
23+
* [Running AET Suite](#running-aet-suite)
24+
+ [Docker Client](#docker-client)
25+
+ [Other Clients](#other-clients)
2326
* [Best practices](#best-practices)
2427
* [Available consoles](#available-consoles)
2528
* [Troubleshooting](#troubleshooting)
@@ -54,6 +57,8 @@ All custom AET extensions are kept in the `/aet/custom` directory.
5457
Runs [Apache Server](https://httpd.apache.org/) that hosts [AET Report](https://github.com/Cognifide/aet/wiki/SuiteReport).
5558
The [AET report application](https://github.com/Cognifide/aet/tree/master/report) is placed under `/usr/local/apache2/htdocs`.
5659
Defines very basic `VirtualHost` (see [aet.conf](https://github.com/Skejven/aet-docker/blob/master/report/aet.conf)).
60+
### AET Docker Client
61+
[AET bash client](https://github.com/Cognifide/aet/tree/master/client/client-scripts) embedded into Docker image with all its dependencies (`jq`, `curl`, `xmllint`).
5762

5863
## Running AET instance with Docker Swarm
5964
This chapter shows how to setup a fully functional AET instance with [Docker Swarm](https://docs.docker.com/engine/swarm/).
@@ -154,6 +159,10 @@ When you see status `healthy` it means Karaf is running correctly
154159
> IMAGE STATUS
155160
> skejven/aet_karaf:0.4.0 Up 20 minutes (healthy)
156161

162+
Now you may want to run a sample suite by executing:
163+
```
164+
docker run skejven/aet_client
165+
```
157166

158167
#### Minimum requirements
159168
To run example AET instance make sure that machine you run it at has at least enabled:
@@ -240,7 +249,33 @@ detect automatic changes in the config. You will need to restart Karaf service a
240249
changes in the configuration files (e.g. by removing `aet_karaf` service and running stack deploy).
241250

242251

243-
### Executing AET Suite
252+
### Running AET Suite
253+
There are couple of ways to start AET Suite.
254+
255+
#### Docker Client
256+
You may use an image that embeds AET Bash client together with its dependencies by running:
257+
> `docker run --rm -v "$(pwd)/suite:/aet/suite" -v "$(pwd)/report:/aet/report" skejven/aet_client AET_INSTANCE_IP /aet/suite/SUITE_YOU_WANT_TO_RUN`
258+
259+
E.g. when you run AET on Docker for Mac/Win and have following setup:
260+
```
261+
.
262+
├── custom
263+
│   └── my-suite.xml
264+
```
265+
and want to run `my-suite.xml` file, simply run:
266+
`docker run --rm -v "$(pwd)/custom:/aet/suite" -v "$(pwd)/report:/aet/report" skejven/aet_client http://host.docker.internal /aet/suite/my-suite.xml`
267+
268+
The results will be saved to the `report` directory:
269+
```
270+
.
271+
├── report
272+
│   ├── redirect.html
273+
│   └── xUnit.xml
274+
```
275+
276+
> Notice that we are using here `host.docker.internal` as the address of AET instance - that works only for Docker for Mac/Win with local AET setup. In other cases, use the AET server's IP/domain.
277+
278+
#### Other Clients
244279
To run AET Suite simply define `endpointDomain` to AET Karaf IP with `8181` port, e.g.:
245280
> `./aet.sh http://localhost:8181`
246281
or

client/Dockerfile

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#
2+
# AET Docker
3+
#
4+
# Copyright (C) 2020 Maciej Laskowski
5+
#
6+
# Licensed under the Apache License, Version 2.0 (the "License");
7+
# you may not use this file except in compliance with the License.
8+
# You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
#
18+
19+
FROM alpine:3.12.0
20+
LABEL maintainer="Maciej Laskowski <skejven@gmail.com>"
21+
22+
RUN apk add --no-cache \
23+
bash \
24+
curl \
25+
jq \
26+
libxml2-utils
27+
28+
# Download AET bash client and sample suite
29+
RUN mkdir -p /aet/client \
30+
&& curl -sS https://raw.githubusercontent.com/Cognifide/aet/master/client/client-scripts/aet.sh > /aet/client/aet.sh \
31+
&& chmod +x /aet/client/aet.sh
32+
33+
# Sample suite
34+
RUN mkdir -p /aet/suite
35+
COPY ./example.xml /aet/suite/example.xml
36+
VOLUME /aet/suite
37+
38+
# Report
39+
RUN mkdir -p /aet/report
40+
VOLUME /aet/report
41+
42+
WORKDIR /aet/report
43+
44+
ENTRYPOINT ["/aet/client/aet.sh"]
45+
CMD ["http://host.docker.internal:8181", "/aet/suite/example.xml"]

client/example.xml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<suite name="example" company="example" project="example">
3+
<test name="layout-test">
4+
<collect>
5+
<open/>
6+
<wait-for-page-loaded />
7+
<resolution width="1280" height="1024"/>
8+
<sleep duration="2000"/>
9+
<screen name="desktop"/>
10+
</collect>
11+
<compare>
12+
<screen comparator="layout"/>
13+
</compare>
14+
<urls>
15+
<url href="https://www.google.com"/>
16+
</urls>
17+
</test>
18+
</suite>

0 commit comments

Comments
 (0)