Lurker News

Comments (106) 29 threads

Show all comments

Showing thread 3 of 29

aloisdg1 reply#
We can do this with Canopy in F# (repl/interactive style too!):

    //go to url
    url "http://lefthandedgoat.github.io/canopy/testpages/"

    //assert that the element with an id of 'welcome' has
    //the text 'Welcome'
    "#welcome" == "Welcome"

    //assert that the element with an id of 'firstName' has the value 'John'
    "#firstName" == "John"

    //change the value of element with
    //an id of 'firstName' to 'Something Else'
    "#firstName" << "Something Else"

    //verify another element's value, click a button,
    //verify the element is updated
    "#button_clicked" == "button not clicked"
    click "#button"
    "#button_clicked" == "button clicked"
https://lefthandedgoat.github.io/canopy/
Dontrememberit1 reply#
The idea of this library is exactly to not use HTML ids (or css paths etc), but use instructions you could give to an human browsing the web (enter the page, press tab, type this..)
holtalanm#
the problem with that is anything that can 'detect' an html element based on human-language will eventually fail to find something described with human-language due to crappy html on legacy systems.