Giter Site home page Giter Site logo

cybuddy's Introduction

CyBuddy

Create Cypress tests visually.

License

Licensed under MIT license.

Logo created by Sarah JOY from the Noun Project.

cybuddy's People

Contributors

karimsa avatar

Watchers

James Cloos avatar Taylor Abraham avatar

cybuddy's Issues

Support for custom actions

Right now, only the fixed actions that already exist in CyBuddy are the only ones you can use. I was dealing with this in HireFast by just adding actions I needed manually. However, it would be nice to pass an array of new actions and for CyBuddy to just support those actions.

Add auto-saving and simpler opens

Now that we have a CLI, saving files can be done automatically into the cypress folder.

Opening files should also be made easier, similar to how the functionality of templates works.

Always errors on start

On initial start, the hooks kick in and try to attempt the last step of the test. Instead, it should probably run the whole test or do nothing. Preferably nothing in the event of refreshes.

Needs tests

I'm just testing it manually using either the example project in this repo or using a special branch of HireFast.

Test methodology:

  • Spin up a page with CyBuddy
  • Simulate mouse clicks on the page (this might require puppeteer since CyBuddy relies on an overlay to catch clicks)
  • Save the generated test file from CyBuddy
  • Pass generated file to Cypress and expect it to succeed

Figure out how to implement env resets

For HireFast, I make a POST request to the backend to trigger a env reset and let cypress reset the storage + cookies on the frontend.

Some setups might directly modify the DB or possibly run commands to perform resets.

How do we make it simple to override that behaviour? Perhaps with forcing the reset action to always be a custom action rather than builtin?

Add cybuddy CLI

We should add a CLI to run CyBuddy. Starting it should be as simple as: cybuddy https://localhost:1234.

This enables us to support different things:

  • Auto-saving files
  • Storing things local to cybuddy, without affecting the app's storage
  • No changes to the app to start using cybuddy
  • Test templating

Actions should only need an implementation, not generation

If we make it mandatory that action implementations cannot access variables outside their function scope, we can simplify action implementations so that they only need to provide an implementation instead of a generation + implementation. For example:

const resetAction = {
  type: 'reset',
  run() {
    cy.clearLocalStorage()
    cy.clearCookies()
    cy.reload()
  },
}

This can then be executed in a "VM" in the browser:

const resetVM = new Function('cy', getFunctionBody(resetAction.run))
resetVM(polyfills.cy)

The function body passed to the VM is also the generated form that can be added to the cypress file.

This might be confusing because it looks like the function pointer will be called on execution, but it actually moves into a VM that runs in a different scope. However, at least errors caused by this mistake will be visible in CyBuddy and not just cypress.

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.