Code Monkey home page Code Monkey logo

cypress-cotps-automation's Introduction

cotps-cypress

Description

Update: The COTPS.com website rug pulled and no longer exists, this project is now useless and has been put to sleep 🪦.
See screenshots and video examples are in the `/examples` folder.

Automated cypress suite to log into COTPS.com and sell any available wallet funds. The app.js wraps cypress and runs it on a cron schedule, deployed to an AWS EC2 instance for 24/7 up time. The node processes are run using the pm2 [https://www.npmjs.com/package/pm2] npm library. All error are sent to the Discord text channel.

Environment (process.env)

  • Environment variables are set via node CLI and passed into the cypress process by app.js
  • COTPS_USERNAME - required
  • COPTS_PASSWORD - required
  • CYPRESS_RECORD_KEY - optional
  • DISCORD_KEY - optional

example cypress env (cypress.env.json)

{
    "username": "xxx",
    "password": "xxx",
    "DISCORD_KEY": "xxx"
}

Commands

  • See .linux-cli-commands for running in EC2 etc.

Local

  • npm start: Starts cypress directly with UI.
  • node app.js: Starts the wrapper node schedule to run cypress via CLI (no UI)

EC2 instance

Connect to ec2 instance:

  • (Navigate to where file is) and run: ssh -i "cypress-automation-ec2-key.pem" [email protected];

  • cd cypress-cotps-automation

  • Use git to pull latest changes

  • List running processes: pm2 list

  • See running processes: pm2 describe {name} e.g. pm2 describe app

Running in EC2

  • Debug/run app: DISPLAY_NAME={firstName} COTPS_USERNAME={username} COTPS_PASSWORD={password} node app.js
  • Start a pm2 process: DISPLAY_NAME={firstName} COTPS_USERNAME={username} COTPS_PASSWORD={password} pm2 start app.js --cron "0,20,40 * * * *" --no-autorestart
  • Example: DISPLAY_NAME=xxx COTPS_USERNAME=xxx COTPS_PASSWORD=xxx pm2 start app.js --name app-ben --cron "0,20,40 * * * *" --no-autorestart

cypress-cotps-automation's People

Contributors

bensmith123 avatar

Watchers

 avatar

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.