Skip to content

Commit a042c93

Browse files
updated for modern functionality
1 parent f71bf62 commit a042c93

19 files changed

+52
-330
lines changed

README.md

Lines changed: 26 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,26 @@
44
An open-source Automation Engine that can perform full Front-End & Back-End Automation for scraping data in addition to Test Automation with Docker and Kubernetes integration.
55

66
## Step 1: Install Docker Desktop
7-
Docker Desktop [Instructions](https://docs.docker.com/desktop/mac/install)
7+
Docker Desktop [Instructions](https://docs.docker.com/desktop)
88

9-
## Step 2: Install Minikube
10-
```bash
11-
brew install minikube
12-
```
9+
## Step 2: Install Helm
10+
Helm [Instructions](https://helm.sh/docs/intro/install)
1311

14-
## Step 3: Install Helm
12+
## Step 3a: Setup Local Environment MAC/LINUX [OPTION 1]
1513
```bash
16-
brew install helm
14+
python3 -m venv venv
15+
source venv/bin/activate
16+
pip install -r requirements.txt
1717
```
1818

19-
## Step 4: Setup Local Environment
19+
## Step 3b: Setup Local Environment Windows [OPTION 2]
2020
```bash
2121
python3 -m venv venv
22-
source venv/bin/activate
22+
.\venv\Scripts\activate
2323
pip install -r requirements.txt
2424
```
2525

26-
## Step 5: Setup Voice Recognition
27-
[Instructions](https://support.apple.com/en-us/HT210539)
28-
29-
## Step 6: Build App Locally
26+
## Step 4a: Build App Locally [OPTION 1]
3027
```bash
3128
cd app/website
3229
docker build --tag cortexaai:latest .
@@ -35,48 +32,41 @@ cd ..
3532
cd ..
3633
```
3734

38-
## Step 7: Install Ansible Galaxy kubernetes.core.k8s
39-
```bash
40-
pip install openshift pyyaml kubernetes
41-
cd /Applications/Python\ <version>
42-
./Install\ Certificates.command
43-
ansible-galaxy collection install kubernetes.core
44-
cd <repo>
45-
```
46-
47-
## Step 8: Deploy & Run App to Kubernetes
35+
## Step 4b: Deploy & Run App to Kubernetes [OPTION 2]
4836
```bash
4937
cd app
50-
minikube delete
51-
minikube start
5238
helm install website .
53-
minikube service website-cortexaai [terminal 1]
54-
kubectl port-forward --address 0.0.0.0 service/website-cortexaai 30000:80 [terminal 2]
39+
kubectl -n default get service website-cortexaai
5540
```
5641

57-
## Step 9: Run Docker Compose (Selenium Grid)
42+
## Step 5: Run Docker Compose (Selenium Grid)
5843
```bash
59-
docker-compose -f ./docker-compose.yml up --scale chrome=1 -d
44+
docker compose up --scale chrome=2
6045
```
6146

62-
## Step 10: Observe Selenium Grid Run (Including Built-In VNC Viewer)
47+
## Step 6: Observe Selenium Grid Run (Including Built-In VNC Viewer)
6348
```
64-
http://localhost:4444/ui/index.html#/sessions
49+
http://localhost:4444/ui
6550
```
6651

6752
## CortexaAI (Results Populated In `items.csv`)
6853
```bash
69-
export BROWSER=chrome && python cortexaai_cli.py
54+
export BROWSER=chrome
55+
python cortexaai_cli.py
7056
```
7157

72-
## Run Front-End Tests (Including Snapshot Images)
58+
## Run Front-End Tests MAC/LINUX (Including Snapshot Images) [OPTION 1]
7359
```bash
74-
export BROWSER=chrome URL=http://<internal-ip>:30000 && python -m unittest discover
60+
export BROWSER=chrome
61+
URL=http://localhost:<PORT>
62+
python -m unittest discover
7563
```
7664

77-
## Run Back-End Tests
65+
## Run Front-End Tests Windows (Including Snapshot Images) [OPTION 2]
7866
```bash
79-
ansible-playbook -i hosts roles/tests/main.yml
67+
$env:BROWSER="chrome"
68+
$env:URL="http://host.docker.internal:<PORT>"
69+
python -m unittest discover
8070
```
8171

8272
## Contributing

ansible.cfg

Lines changed: 0 additions & 4 deletions
This file was deleted.

cortexaai_cli.py

Lines changed: 0 additions & 15 deletions
This file was deleted.

ctf.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/bash
2+
3+
function help {
4+
echo " usage: ./ctf.sh tests.<test>"
5+
echo " -a, run entire browser test suite"
6+
echo " <test> run a single test where test would be the actual test name without the .py extension"
7+
exit 1
8+
}
9+
10+
# this case echos the help menu
11+
if [[ $1 == "-h" || $1 == "" || $2 == "" ]]
12+
then
13+
help
14+
# this case runs the entire test suite
15+
elif [[ $2 == "-a" ]]
16+
then
17+
source venv/bin/activate
18+
export BROWSER=chrome && python -m unittest discover
19+
# this case runs a single test
20+
elif [[ $2 != "" ]]
21+
then
22+
source venv/bin/activate
23+
export BROWSER=chrome && python -m unittest "$2"
24+
fi

docker-compose.yml renamed to docker-compose.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: "3"
22
services:
33
chrome:
4-
image: selenium/node-chrome:4.1.2-20220217
4+
image: selenium/node-chrome:latest
55
shm_size: 2gb
66
depends_on:
77
- selenium-hub
@@ -10,7 +10,7 @@ services:
1010
- SE_EVENT_BUS_PUBLISH_PORT=4442
1111
- SE_EVENT_BUS_SUBSCRIBE_PORT=4443
1212
selenium-hub:
13-
image: selenium/hub:4.1.2-20220217
13+
image: selenium/hub:latest
1414
container_name: selenium-hub
1515
ports:
1616
- "4442:4442"

group_vars/tests

Lines changed: 0 additions & 2 deletions
This file was deleted.

hosts

Lines changed: 0 additions & 2 deletions
This file was deleted.

images/20220220_123902.png

-253 KB
Binary file not shown.
76.9 KB
Loading

images/20231104_160302.png

208 KB
Loading

0 commit comments

Comments
 (0)