Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 12:54
    straight-shoota milestoned #13045
  • 12:54
    straight-shoota milestoned #13045
  • 12:02
    straight-shoota labeled #13045
  • 12:02
    straight-shoota labeled #13045
  • 12:02
    straight-shoota assigned #13045
  • 12:02
    straight-shoota opened #13045
  • 10:40
    straight-shoota closed #13040
  • 10:37
    straight-shoota milestoned #12963
  • 10:34
    straight-shoota milestoned #13034
  • 10:34
    straight-shoota milestoned #13034
  • 00:58
    HertzDevil synchronize #13034
  • 00:47
    HertzDevil synchronize #13034
  • Feb 02 22:23
    HertzDevil ready_for_review #13034
  • Feb 02 22:22
    straight-shoota closed #13039
  • Feb 02 22:21
    straight-shoota closed #13020
  • Feb 02 22:21
    straight-shoota closed #11646
  • Feb 02 22:21
    HertzDevil synchronize #13034
  • Feb 02 19:26
    straight-shoota labeled #13044
  • Feb 02 19:26
    straight-shoota labeled #13044
  • Feb 02 19:26
    straight-shoota assigned #13044
George Dietrich
@Blacksmoke16
ofc it's all moot if you remove the need to convert arbitrary strings into exceptions. i.e. if you already know that you want to raise an unknown method exception because of the string, could just do raise UnknownMethodException.new versus going thru the case at all
but i assume there is more to it than this example?
Sean Gregory
@skinnyjames
definitely did the trick!
i was originally iterating, but I'm just being lazy
Sean Gregory
@skinnyjames

almost ready to beta my project!
https://github.com/skinnyjames/webdriver

It's a w3c compliant OO webdriver that pulls from the Watir api

George Dietrich
@Blacksmoke16
nice one!
Sean Gregory
@skinnyjames
thanks! I'm pretty excited. I've been looking at ruby's Spinach library, and I would like to implement a similar test runner in Crystal
George Dietrich
@Blacksmoke16
sounds like quite the challenge
Sean Gregory
@skinnyjames
yeah, I'll probably be bugging you all a little bit :)
Crystal is definitely my favorite language, so I hope that testing can be a bit more first class
George Dietrich
@Blacksmoke16
in regards to E2E testing you mean?
Sean Gregory
@skinnyjames
yeah,ATDD
i'm happy with Spec
George Dietrich
@Blacksmoke16
everyone i know uses https://www.cypress.io/ for that
main downside is ofc it's JS, but will be a large undertaking to try and match them imo
Sean Gregory
@skinnyjames
cypress is cool, but the api is more cumbersome
the one thing that I really like about it, is by mocking the network deps, you can turn a unit test suite into an e2e test suite with a switch
George Dietrich
@Blacksmoke16
they did just add in the #intercept method, which makes that side of it easier more powerful
i also really like their tooling. How you can see what's going on and interact with snapshots of the UI at each point
Sean Gregory
@skinnyjames
driver.findElement(By.id("username");).sendKeys(username);
vs
browser.element(id: /username/i).set(username)
yeah, I think tooling could be better in selenium, but selenium 4 supports video now
George Dietrich
@Blacksmoke16
wait, neither of those looks like cypress
cy.get('#username').click(); is what im familiar with
Sean Gregory
@skinnyjames
oh lol
I was looking at the wrong docs
George Dietrich
@Blacksmoke16
that would do it :P
er .type(username)*
Sean Gregory
@skinnyjames
how would you get the second input if they were like:
<form id="first-form"></form>
<form>
<input id="username-dynamic234231">
<input id="username-dynamic234234">
</form>
I've built abstractions around the query selector api, but it never seems to be the best
cy.get('input[id^="username"]:nth-of-type(2)').type(username)
I'm also a big fan of page object, so I may be biased :)
George Dietrich
@Blacksmoke16
i think in the ideal world of cypress you'd do something like cy.get('[data-test=some-unique-id]') such that you're not relying upon classes/id/order etc
Sean Gregory
@skinnyjames
collections don't usually have unique ids though
George Dietrich
@Blacksmoke16
but, for this example it would be like cy.get('input').eq(2)
er .eq(1), starts at 0
collections of objects from the db or?
Sean Gregory
@skinnyjames
like a list
George Dietrich
@Blacksmoke16
true true, depends on the context. A simple list of strings wouldn't, but a list of something fetched from the db would
From IRC (bridge bot)
@FromIRC
<postmodern> here's a weird question i ran into while porting some ruby code to crystal, how does one do an empty named tuple? Trying to port some spec code where a keyword is given an empty options Hash.
George Dietrich
@Blacksmoke16
i think you can just do NamedTuple.new
but ofc, another option is to not use named tuples like that :S
From IRC (bridge bot)
@FromIRC
<postmodern> yeah... what was originally a clever idea of "oh I'll just keyword-splat that Hash of Symbols" now has me reconsidering things as I'm porting this code to crystal
George Dietrich
@Blacksmoke16
using it as a container of named args is its purpose, but when you get into using it to model data it's not longer ideal
named args with default values would prob be easier/more clear
From IRC (bridge bot)
@FromIRC
<postmodern> i really wish you could write type signatures that contained literal values (ex: Int32 | '*')
George Dietrich
@Blacksmoke16
maybe could use an enum for that?
wouldn't be the greatest UX tho needing to do like MyEnum.new(14) tho :/
George Dietrich
@Blacksmoke16
i wonder if that's something you could implement with like ameba
From IRC (bridge bot)
@FromIRC
<postmodern> my edge-case is hexdump code which omitts repeating rows by yielding '*' instead of the incremental row index, so i have to say Int32 | String
George Dietrich
@Blacksmoke16
do you have to yield at all?
probably?
From IRC (bridge bot)
@FromIRC
<postmodern> there are other cases where i could use an enum, like the numeric base (2, 8, 10, or 16), but it's annoying to have to type Base::BINARY instead of just 2