amberframework / garnet-spec Goto Github PK
View Code? Open in Web Editor NEWExtends Crystal Spec for testing web applications
License: MIT License
Extends Crystal Spec for testing web applications
License: MIT License
Lines 60 and 66.
I think it needs to be changed to terminate.
Walking through the readme, I copied (close to) this code out to run:
class SomeFeatureSpec < GarnetSpec::System::Test
describe "Some Feature test" do
it "works" do
visit "http://crystal-lang.org/api"
fill "", "Client", "search"
types_list = page.find_element(:id, "types-list")
types = types_list.find_elements(:css, "li:not([class~='hide'])")
types.size.should eq 512
end
end
end
however:
[lots of backtrace]
instantiating 'GarnetSpec::SeleniumServer:Class#boot()'
in lib/garnet_spec/src/garnet_spec/selenium_server.cr:10: no overload matches 'Process.new', command: String, output: Bool, error: Bool
Overloads are:
- Process.new(command : String, args = nil, env : Env = nil, clear_env : Bool = false, shell : Bool = false, input : Stdio = Redirect::Close, output : Stdio = Redirect::Close, error : Stdio = Redirect::Close, chdir : String | ::Nil = nil)
- Process.new(pid)
Process.new(command: "selenium-server", output: true, error: true)
Perhaps this is out of date with the Crystal API?
Right know is possible to test controller actions preloading routes of your application and borrowing a helper method from Amber's source.
For example, for making an HTTP GET request we could do the following:
def get(path)
handler = Amber::Server.instance.handler
handler.prepare_pipelines # Preload routes
request = HTTP::Request.new("GET", path) # Create request
create_request_and_return_io(handler, request) # Generate response
end
With that a user could test its route as this:
response = get("/my_path")
response.status_code.should eq 200
It would be very useful to have a method for each HTTP verb to make requests and be able to attach params and headers as well.
adding garnet-spec to shard.yml with
development_dependencies:
garnet_spec:
github: amberframework/garnet-spec
version: ~> 0.2.0
installs version 0.2.3 which has version 0.2.1 in it's shard.yml file, apparently causing this issue
crystal-lang/shards#353
JSON.mapping is being used which is deprecated.
Seems to be fixed in amberframework/selenium-webdriver-crystal but the version downloaded by garnet still has the issue.
Probably needs to be fixed here and on amberframework/selenium-webdriver-crystal.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.