• Stars
    star
    50
  • Rank 558,129 (Top 12 %)
  • Language
    Crystal
  • License
    MIT License
  • Created about 6 years ago
  • Updated 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Automated browser tests for web applications. Similar to Ruby's Capybara.

LuckyFlow

API Documentation Website

LuckyFlow is a library for testing user flows in the browser. It is similar to Ruby's Capybara.

LuckyFlow example

Installation in Lucky projects

LuckyFlow is already installed and configured. Check out the guides to see how to use it: https://luckyframework.org/guides/browser-tests/

Installation in other Crystal projects

Add this to your application's shard.yml:

development_dependencies:
  lucky_flow:
    github: luckyframework/lucky_flow

Configure LuckyFlow in spec/spec_helper.cr:

require "lucky_flow"

LuckyFlow.configure do |settings|
  # This is required
  settings.base_uri = "http://localhost:<port>"

  # Optional settings. Defaults are shown here
  settings.retry_delay = 10.milliseconds
  settings.stop_retrying_after = 1.second
  settings.screenshot_directory = "./tmp/screenshots"
  settings.browser_binary = "/Applications/Brave Browser.app/Contents/MacOS/Brave Browser"
end

# Put this at the bottom of the file.
# If a required setting is missing, this will catch it.
Habitat.raise_if_missing_settings!

Then view the guides: https://luckyframework.org/guides/browser-tests/

You should be ready to go!

For use with some of the Lucky shards (including Lucky itself), you'll need to require a few extensions:

# This extension adds an override to `visit` allowing you
# to pass in a Lucky::Action.class or Lucky::RouteHelper
require "lucky_flow/ext/lucky"

# This extension adds a `fill_form` method that you can pass
# an Operation or SaveOperation to which will populate form
# fields for you
require "lucky_flow/ext/avram"

# Similar to the Lucky extension, this gives an additional override
# to `visit` that allows you to visit a page as a specific User
require "lucky_flow/ext/authentic"

Usage

Note that you can only pass string paths to visit since only Lucky has route helpers described in the guide below. Example: visit "/my-path"

View guide at: https://luckyframework.org/guides/browser-tests/

Contributing

  1. Fork it ( https://github.com/luckyframework/lucky_flow/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Install docker and docker-compose: https://docs.docker.com/compose/install/
  4. Run script/setup
  5. Make your changes
  6. Run script/test to run the specs, build shards, and check formatting
  7. Commit your changes (git commit -am 'Add some feature')
  8. Push to the branch (git push origin my-new-feature)
  9. Create a new Pull Request

Contributors

More Repositories

1

lucky

A full-featured Crystal web framework that catches bugs for you, runs incredibly fast, and helps you write code that lasts.
Crystal
2,530
star
2

avram

A Crystal database wrapper for reading, writing, and migrating Postgres databases.
Crystal
159
star
3

lucky_cli

A Crystal command-line tool for generating new Lucky Web Applications.
Crystal
88
star
4

carbon

Email library for Crystal. Testable, adapter-based, and catches bugs for you. Comes with an adapter for SendGrid.
Crystal
83
star
5

habitat

Easily configure settings for Crystal projects
Crystal
81
star
6

lucky_record

Renamed to Avram ->> https://github.com/luckyframework/avram
Crystal
48
star
7

website

The Lucky website
Crystal
37
star
8

lucky_router

The router for the Lucky framework, can be used outside Lucky
Crystal
21
star
9

dexter

A logger with maximum customizability and surgical precision
Crystal
20
star
10

breeze

A development dashboard for Lucky Apps
Crystal
19
star
11

lucky_migrator

LuckyMigrator has been merged into LuckyRecord
Crystal
16
star
12

authentic

An authentication library for Lucky projects
Crystal
14
star
13

pulsar

Pubsub and Instrumentation for Crystal
Crystal
14
star
14

wordsmith

Handles pluralization, ordinalizing words, etc.
Crystal
13
star
15

avram_slugify

AvramSlugify generates slugs for database columns. These slugs can be used for creating nice looking URLs, permalinks, invite codes, etc.
Crystal
13
star
16

website-old

The old website for Lucky (archived)
HTML
11
star
17

carbon_smtp_adapter

An smtp adapter for the carbon email library
Crystal
10
star
18

html2lucky

Convert regular HTML into Lucky's Crystal DSL for HTML.
Crystal
10
star
19

lucky_inflector

This project has been moved to ->
Crystal
8
star
20

lucky_task

Library for creating command line tasks for the Lucky CLI
Crystal
7
star
21

lucky_cache

Caching library for the Lucky Framework
Crystal
5
star
22

lucky_env

An environment variable manager
Crystal
5
star
23

lucky_sec_tester

Crystal
4
star
24

homebrew-lucky

Ruby
3
star
25

teeplate

Fork of mosop/teeplate for generating files
Crystal
3
star
26

lucky_template

A simple, yet versatile, library for creating file and folder structures as code templates.
Crystal
3
star
27

lucky_hxml

Similar to LuckyHTML, but for Hyperview (https://hyperview.org/).
Crystal
2
star
28

upgrade-diffs

Diffs for easier upgrading of Lucky versions
Crystal
1
star
29

carbon_sendgrid_adapter

Crystal
1
star