Coder Social home page Coder Social logo

cometa-rocks / cometa Goto Github PK

View Code? Open in Web Editor NEW
18.0 3.0 4.0 42.11 MB

Co.Meta - Open Source Code [Community Edition]

License: Other

Dockerfile 0.03% Python 11.55% JavaScript 6.51% CSS 1.10% Shell 1.03% PLpgSQL 0.10% HTML 62.54% TypeScript 13.63% SCSS 3.50%
django angular testing testing-platforms selenium selenium-grid postgres no-code low-code visualregression

cometa's Introduction

Cometa

Open source is the future. Co.Meta is an advanced & evolving meta-test product that has been made with ❤️ for DevOps and QA Engineers. Learn more

Support

YouTube video (Clicking the thumbnail will redirect you to a quick YouTube video)

Built With

Getting started

Prerequisites

Here is what you need to be able to run Cometa.

  • Docker and Docker Compose

    Docker and Docker Compose run seamlessly on both Mac and Windows. Installations have been successfully carried out using Docker Desktop 4.25.2 on macOS 14.1 with Rosetta x86/amd64 emulation. Additionally, running WSL with Ubuntu is a viable option. The choice ultimately depends on your personal preference. We recommend running Co.meta on Linux, considering that Linux is its native environment. Please use Linux as the operating system. You can explore pre-built Virtual Boxes for your convenience.

  • Internet Connection

    Co.Meta needs to be able to fetch software from the internet. For example python libraries, pre-built containers with virtual browser.

    When installing Co.meta in a corporate environment, make sure to whitelist the following domains on the Secure Proxy:

    For corporate environments using a Secure Proxy the Proxy usage needs to be configured: Edit the following nano ~/.docker/config.json


    Add the following:
    {
      "proxies":
      {
      	"default":
      		{
      			"httpProxy": "http://<host>:<port>",
      			"httpsProxy": "http://<host>:<port>",
      			"noProxy": "localhost,127.0.0.1,172.0.0.1/8,cometa_socket,cometa_zalenium,cometa_front,cometa_behave,cometa_django,cometa_postgres,behave" 
      		}
      	}
    }
    

    This configuration ensures, that the Co.Meta container use the proxy server, when spinning up virtual browsers. Add any internal Websites, ERPs or Application Endpoints into the above file to be accessible without Proxy.

    Selenoid Container must be built without above file. So, before rebuilding (e.g. with option --force-recreate) move above to *_bkp (mv ~/.docker/config.json ~/.docker/config.json_bkp), then rebuilt selenoid and finally move the file back to original name using mv ~/.docker/config.json_bkp ~/.docker/config.json.

    Modify /etc/systemd/system/docker.service.d/http_proxy.conf or create the file if missing and add this content:

    [Service]
    Environment="HTTP_PROXY=http://<host>:<port>/" "NOPROXY=localhost,127.0.0.1,behave,cometa_behave,cometa_django" 
    

    Then restart the services: run systemctl daemon-reload and systemctl restart docker.service


  • ulimit -n 8192

    Normally a ulimit -n of 1024 is sufficient. When using cntlm to divert internal and external traffic in a corporate environment, the ulimit should be set to 8192. Use below command to update ulimit.

    Update ulimit using command ulimit -n 8192

  • Required disk space

    Cometa requires approximately 28GB of disk space. Please ensure that your system has a minimum of 28GB of available disk space before installing Cometa. If necessary, consider freeing up space or upgrading your storage capacity.

    To check the available disk space, use the following command df -h . | awk 'NR==2 { print $4 }'

    To obtain more details on disk space, use the following command df -h .

  • Server time

    Your server must be in sync with the global time - consider using NTP to keep your local server time synchronized. Time deviation of more than 10 minutes is not supported.

    Why is this important? Because Co.Meta supports Single Sign On Providers like oAuth from Gitlab, Github, Azure, Google, Facebook, Ping or others. And the cookie timestamp must be accurate.

In case you are stuck for more than 5 minutes - please let us know. And please give us the opportunity to help you. We want to learn how you are using Co.Meta and what problems you encounter. Contact us. We are happy to help.

Installation

  1. Clone the repo

    git clone https://github.com/cometa-rocks/cometa.git
  2. Setup at least 1 authentication provider:

    To setup Google (for a more in detail guide click here ):

    • Go to Google Developer Console

    • Create an OAuth application

    • Add your domain to the allowed hosts

    • Retrieve the client_id and secret_id and paste them in ./front/apache-conf/metadata/accounts.google.com.client

    • Set redirect_uri to https://<domain>/callback on your project's credential page

    • For further information please refer to Google Cloud Platform Console Help

    To setup Gitlab (for a more in detail guide click here ):

    • Go to git.amvara.de

    • Create a new account

    • Settings > Application > Add new application

    • Add your domain to the allowed hosts

    • Retrieve the client_id and secret_id and paste them in ./front/apache-conf/metadata/accounts/git.amvara.de.client

    • Set redirect_uri to https://<domain>/callback

    In both cases, the default URL when installing on you Desktop or Laptop, is localhost.

Don't miss this note: Instead of following the manual setup instructions below, you may execute ./cometa.sh to bring up a localhost version on your machine.

  1. Create a crontab file for scheduling your automated tests

    mkdir -p backend/behave/schedules && touch backend/behave/schedules/crontab
  2. Get all Docker containers up:

    In docker-compose.yml change to 'local' and to '80' or according to your needs.

    • Change the <outside_port> port to 80 or any other port you'd like. Keep in mind that this port should match with what is configured inside the openidc.conf
    • Change the <server> to local or your custom configuration file in front/apache-conf/openidc.conf_<custom_name>
    docker-compose up -d && docker-compose logs -f --tail=10

    Co.Meta starts on port 443. If that port is used on your machine, change it docker-compose.yml to e.g. "8443:443" Co.Meta also starts on port 80. If that is not available you could change that to 8081 in docker-compose.yml

    View some logs docker-compose logs -f --tail=10 of the installation process, to get a understanding, when Co.Meta is ready.

    Give Co.Meta some minutes to install python, setup django, download npm and docker files, compile the front end. Depending on your computer this can take a couple of minutes.

    You want a development server?

    docker-compose -f docker-compose-dev.yml up -d
  3. (Optional) Create superuser for the Backend Admin

    Default superuser is created on runtime as admin:admin.

    bash
    docker exec -it cometa_django bash
    root@cometa_django:/opt/code# python manage.py createsuperuser
    
  4. (Optional) Install latest browser versions

    ./backend/selenoid/deploy_selenoid.sh -n 3.

    This will configure and pull the three newest Docker images with virtual browsers for Selenoid.

    Selenoid image are the browser that you will be able use and select in Co.Meta.

    Of course there are options to include browserstack, headspin or sourcelabs browsers. But that is a bit you would not want to configure on your first setup.

    This step will take some time as all the default browser images are being pulled.

    Once Co.Meta is up and running, you can parse the new browser images available into Co.Meta by calling https://localhost/backend/parseBrowsers/

  5. See Co.Meta in your browser

    Test server access curl -k https://<yourdomain>:<specified port - default 443>/

    Example curl -k https://localhost:443/

    You should see something like this:

    The document has moved here.

  6. Import the over 70 pre-defined actions

    On first start you have to manually parse the actions.py file. This enables cometa to use any steps defined in the UI. The user can then choose from the steps in the UI. https://localhost/backend/parseActions/ ... as a result cometa will show all actions that have been parsed and are now available for selection in cometa-front.

  7. Run your first test

    Click on the "+" on the very top. Select Department, Environment and Feature Name

    Please delete or disable the first step shown as an example and import this JSON to search for "Cometa Rocks" on google

    [{"enabled":true,"screenshot":true,"step_keyword":"Given","compare":false,"step_content":"Goto URL \"https://www.google.de/\"","step_type":"normal","continue_on_failure":false,"timeout":60},{"enabled":true,"screenshot":false,"step_keyword":"Given","compare":false,"step_content":"Maximize the browser","step_type":"normal","continue_on_failure":false,"timeout":60},{"enabled":true,"screenshot":true,"step_keyword":"Given","compare":false,"step_content":"wait until I can see \"google\" on page","step_type":"normal","continue_on_failure":false,"timeout":60},{"enabled":true,"screenshot":true,"step_keyword":"Given","compare":false,"step_content":"I move mouse to \"//button[2]\" and click","step_type":"normal","continue_on_failure":true,"timeout":5},{"enabled":true,"screenshot":true,"step_keyword":"Given","compare":false,"step_content":"I move mouse to \"//textarea\" and click","step_type":"normal","continue_on_failure":false,"timeout":60},{"enabled":true,"screenshot":true,"step_keyword":"Given","compare":false,"step_content":"Send keys \"cometa rocks\"","step_type":"normal","continue_on_failure":false,"timeout":60},{"enabled":true,"screenshot":true,"step_keyword":"Given","compare":false,"step_content":"Press Enter","step_type":"normal","continue_on_failure":false,"timeout":60},{"enabled":true,"screenshot":true,"step_keyword":"Given","compare":false,"step_content":"wait until I can see \"cometa rocks\" on page","step_type":"normal","continue_on_failure":false,"timeout":60},{"enabled":true,"screenshot":true,"step_keyword":"Given","compare":true,"step_content":"I sleep \"1\" seconds","step_type":"normal","continue_on_failure":false,"timeout":6}]

Notes

  • Final Co.Meta is available at https://localhost/
  • To enable Debug mode on front:
     docker exec -it cometa_front bash
     root@cometa_front:/code# ./start.sh serve
    Front Debug mode will available at https://localhost/debug/

Backups

To create a backup simply execute ./backup.sh on the root folder (make sure it has +x permission).

A folder will be created inside backups with the date of the backup, this folder includes a backup of the database, all features metadata and the screenshots already taken.

Restore backups

  1. Unzip db_data.zip and copy contents to folder db_data.
  2. Unzip features.zip and screenshots.zip directly inside behave folder.
  3. docker-compose restart

That's all, easy peasy.

Backend resources

Directory Layout

  • ./behave Behave related files
  • ./crontabs contains crontab files for Django & Behave
  • ./selenoid Selenoid related files
  • ./front Apache and Angular files
  • ./src Django related files
  • ./src/backend contains the Backend code for URLs
  • ./src/cometa_pj: contains the configuration of Django
  • ./ws-server WebSocket server related files

License

Copyright 2022 COMETA ROCKS S.L.

Portions of this software are licensed as follows:

  • All content that resides under "ee/" directory of this repository (Enterprise Edition) is licensed under the license defined in "ee/LICENSE". (Work in progress)
  • All third party components incorporated into the Co.Meta Software are licensed under the original license provided by the owner of the applicable component.
  • Content outside of the above mentioned directories or restrictions above is available under the "AGPLv3" license as defined in LICENSE file.

cometa's People

Contributors

anandkushwaha064 avatar arslansb avatar raro42 avatar santoshyadavdev avatar tornike-papuashvili avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

cometa's Issues

last downloaded file opens wrong file

  1. While downloading a file using step Download a file by clicking on "{linktext}" multiple times attach the wrong file in the step report
  2. After downloading multiple files attach in a step report containing the wrong list of files, containing previous files.
  3. Step not available to delete downloaded files while executing a feature.
  4. last_downloaded_file opened the wrong file

User Perspective Production Link Review

Issue 1

  1. For the above image: When the image icon is clicked, I am not able to see any image. I waited for more than 5 min to see if the issue was on my end.

  2. When I click on the video icon where the time stamp is 0 ms, it redirects me to a different page on my laptop but on my mobile, it says error. In scenarios, where no video is recorded, the pop-up should simply say: No video has been recorded for the selected test run.

Required docker-compose Version for cometa (2.2x.x or Above)

Installed the docker-compose version (1.x.x) on the Debian OS and started running cometa.sh. Every other container is running except cometa_selenoid.

selenoid_1  | 2023/12/14 13:48:58 [-] [INIT] [Loading configuration files...]
selenoid_1  | 2023/12/14 13:48:58 [-] [INIT] [/usr/bin/selenoid: browsers config: read error: open config/browsers.json: no such file

Content Edit in GitHub Documentation

  1. Copy as-is under GETTING STARTED:

Use Linux as the operating system. Have a look at pre-build Virtual Boxes.
In case you are stuck for more than 5 minutes, please let us know. And please allow us to help you. We want to learn how you are using Co.Meta and what problems you are encountering. Contact us at [Company Emails only]. We love to help.

NOTE: Do not confuse the community user with too many options. Please stick to official emails from now on.

  1. For closed-source networks, insert guidelines for installing Co.Meta so that they do not have to only rely on our URL for using the application.

  2. Don't insert a website link until we upgrade it. For now, insert a link to early access only.
    image

Under README.md

  1. Screenshot 2023-12-01 110453

a) Co.Meta as title. Not Cometa
b) Edit description as follows and remove Learn More (The website is outdated):
Open source is the future. Co.Meta is an advanced & evolving meta-test platform made with ❤️ for DevOps, SDET and QA Engineers.
c) Remove Support from here.

  1. Screenshot 2023-12-01 110519

Edit as follows:
Here is what you need to be able to run Co.Meta.

Docker [Insert Installation Link]
Docker Compose [Insert Installation Link]
Use Linux as the operating system. Have a look at pre-build Virtual Boxes

In case, you are stuck for more than 5 min, please let us know and allow us to help you. We want to learn how you are using Co.Meta and what problems you're encountering. Contact us at [Insert Company emails only].

  1. Screenshot 2023-12-01 110547
    Only insert early access link. Do not insert website link for now.

  2. For those who have closed-source networks, provide instructions for ease of installation so that they don't have to rely on the prod URL.

  3. For those who choose on-prem, mention URLs to be whitelisted, HAR instructions and SSO/IAM instructions to be adhered to.

Change Product Description

In the next update from today, please ensure that the product label is changed from "Complete Meta Test Automation" to "Complete Meta Test Platform".

Our capabilities now go beyond automation engineering.

Comments about the project

First of all thank you to open source a such helpful tool.
Improvements:

  • Add to the docs that ./cometa.sh needs to have +x perms.
  • Add an example on how to create an Oauth app with Google
  • Add something like boto3 to store data on an S3
  • Might be more convenient to have the help button with the tour on the navbar
  • Might be more convenient to clone a script that does everything as follows:
    1.-cloning all the project
    2.-waiting to receive a couple of inputs for google Oauth
    3.-asking if the user wants to donwload the latests browser versions (if so download it)
    4.-asking if the user wants to donwload the default actions
  • Maybe show an estimation of the time that it will take for the tests to complete

Issues:

  • The language settings seems that it only translates some parts (mostly tooltips)
  • Not an actual issue (it's more an improvement but...) the backend part isn't well structured neither follows pep conventions.
  • There isn't any test.

MAIN OLD to be removed as Default Screen

@raro42 @ArslanSB

When you log in to the platform, it takes you to MAIN OLD instead of MAIN by default. Many new users will get confused.

The platform should take you to the latest MAIN version by default. Down the line, we will work on refining the UI/UX but as of now, we must have the main version displayed.

Waiting for frontend to compile angular typescript into executable code -> [failed]

Ubuntu 22

I got this issue

[2023-03-16T15:13:00][INFO][cometa.sh:21] - This is ./cometa.sh version 2022-09-08 running for your convinience

[2023-03-16T15:13:02][INFO][cometa.sh:123] - Replaced in docker-compose.yml with local

[2023-03-16T15:13:02][INFO][cometa.sh:128] - Replaced <outside_port> in docker-compose.yml with 80

[2023-03-16T15:13:02][INFO][cometa.sh:137] - The default string in accounts.google.com.client was replaced with something else - hopefully your google oAuth client credentials

[2023-03-16T15:13:02][INFO][cometa.sh:143] - Starting containers

cometa_behave is up-to-date

cometa_postgres is up-to-date

cometa_novnc is up-to-date

cometa_selenoid is up-to-date

cometa_front is up-to-date

cometa_django is up-to-date

cometa_socket is up-to-date

[2023-03-16T15:13:04][INFO][cometa.sh:144] - Started docker ... now waiting for container to come alive

[2023-03-16T15:13:04][INFO][cometa.sh:171] - Waiting for parseBrowsers -> [done]

[2023-03-16T15:13:09][INFO][cometa.sh:174] - Waiting for parseActions -> [done]

[2023-03-16T15:13:11][INFO][cometa.sh:177] - Waiting for frontend to compile angular typescript into executable code -> [failed]

[2023-03-16T15:23:13][WARNING][cometa.sh:178] - Waited for 600 seconds, docker-container front is not running

[2023-03-16T15:23:13][INFO][cometa.sh:195] - The test automation platform is ready to rumble at https://localhost/

[2023-03-16T15:23:13][INFO][cometa.sh:196] - Thank you for using the easy peasy setup script.

root@osboxes:~/cometa# docker exec -it cometa_front bash

root@f354256807dd:/code# ./start.sh serve

Checking SSL certificate...

SSL certificate exists ... checking expiration date

SSL certificate expires on: 2024-03-15

SSL Certificate is valid ... meaning it's not expiring in 10 days.

npx: installed 1 in 9.021s

command not found: ng

Successful

httpd: Syntax error on line 589 of /usr/local/apache2/conf/httpd.conf: Syntax error on line 45 of /usr/local/apache2/conf/openidc.conf: Cannot load modules/mod_auth_openidc.so into server: libcjose.so.0: cannot open shared object file: No such file or directory

tail: cannot open '/usr/local/apache2/logs/error_log' for reading: No such file or directory

tail: cannot open '/usr/local/apache2/logs/access.log' for reading: No such file or directory

tail: no files remaining

root@f354256807dd:/code# exit

exit

root@osboxes:~/cometa# ls

VirtualBoxVM_hGZlx5LfN4

Inside Co.Meta App Edit

@raro42 @ArslanSB

  1. When you click on Help in the middle of the screen, it should take you to the steps section and not the website. Please rectify. - This one should be looked at now.
  2. When you click on the tutorial, it takes you to a Spanish video. As we are dealing with a global audience, please insert a new video in English. - This can be looked at later.

Screenshot (2)

Cometa Installation on M1 Chip

./cometa.sh
[2022-10-03T20:40:15][INFO][cometa.sh:21] - This is ./cometa.sh version 2022-09-08 running for your convinience
sed: 1: "docker-compose.yml": extra characters at the end of d command
[2022-10-03T20:40:15][INFO][cometa.sh:76] - Created schedules directory
[2022-10-03T20:40:15][INFO][cometa.sh:91] - Created crontab file
[2022-10-03T20:40:15][INFO][cometa.sh:99] - Created browsers.json file
sed: 1: "docker-compose.yml": extra characters at the end of d command
sed: 1: "docker-compose.yml": extra characters at the end of d command
[2022-10-03T20:40:15][INFO][cometa.sh:119] - The default string in accounts.google.com.client was replaced with something else - hopefully your google oAuth client credentials
[2022-10-03T20:40:15][INFO][cometa.sh:125] - Starting containers
1 error(s) decoding:

  • error decoding 'Ports': Invalid hostPort: <outside_port>
    ./cometa.sh: line 126: warn: command not found
    [2022-10-03T20:40:18][INFO][cometa.sh:137] - Downloading latest browser versions
    [2022-10-03T20:40:19][INFO][deploy_selenoid.sh:8] - Executing Deploy Selenoid Script
    [2022-10-03T20:40:19][INFO][deploy_selenoid.sh:24] - *********************** COMETA ***********************
    [2022-10-03T20:40:19][INFO][deploy_selenoid.sh:25] - This script automatically retrieves the latest browsers
    [2022-10-03T20:40:19][INFO][deploy_selenoid.sh:26] - for Selenoid and recreates/updates the docker.
    [2022-10-03T20:40:19][INFO][deploy_selenoid.sh:27] - ******************************************************
    [2022-10-03T20:40:19][INFO][deploy_selenoid.sh:31] - jq: already installed.
    ./getLatestBrowsers.sh: line 36: realpath: command not found
    usage: dirname string [...]
    ./getLatestBrowsers.sh: line 84: /../../helpers/logger.sh: No such file or directory
    ./getLatestBrowsers.sh: line 143: log_wfr: command not found
    ./getLatestBrowsers.sh: line 172: log_res: command not found
    ./getLatestBrowsers.sh: line 143: log_wfr: command not found
    Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
    ./getLatestBrowsers.sh: line 172: log_res: command not found
    ./getLatestBrowsers.sh: line 143: log_wfr: command not found
    ./getLatestBrowsers.sh: line 194: log_wfr: command not found
    ./getLatestBrowsers.sh: line 195: log_res: command not found

Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
[2022-10-03T20:41:11][INFO][deploy_selenoid.sh:38] - pulling selenoid/video-recorder
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
[2022-10-03T20:41:11][INFO][deploy_selenoid.sh:51] - Replacing background image volume in Selenoid images ...
sed: 1: "browsers.json": undefined label 'rowsers.json'
[2022-10-03T20:41:11][INFO][deploy_selenoid.sh:58] - Replacing downloads folder in Selenoid Chrome Image ...
sed: 1: "browsers.json": undefined label 'rowsers.json'
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
[2022-10-03T20:41:12][INFO][deploy_selenoid.sh:71] - Selenoid docker was not found or exited, recreating docker ... -> [failed]
[2022-10-03T20:41:12][INFO][cometa.sh:153] - Waiting for parseBrowsersCannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
Error response from daemon: dial unix docker.raw.sock: connect: connection refused
Error: No such container: cometa_django
Error: No such container: cometa_django

jq is also not normally installed - there are no arm64 packages. I compiled it myself for other purposes.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.