Coder Social home page Coder Social logo

lefthandedgoat / canopy Goto Github PK

View Code? Open in Web Editor NEW
503.0 37.0 117.0 85.35 MB

f# web automation and testing library, built on top of Selenium (friendly to c# also)

Home Page: http://lefthandedgoat.github.io/canopy/

License: MIT License

F# 51.14% Ruby 0.11% Shell 0.03% Batchfile 0.01% C# 1.60% JavaScript 40.65% CSS 1.57% Dockerfile 0.04% HTML 4.84%

canopy's Introduction

canopy's People

Contributors

amirrajan avatar ataylorm avatar bfrierson avatar charlesj avatar cunning-pony avatar dharmatech avatar draganjovanovic1 avatar edhzsz avatar forki avatar joncanning avatar kberridge avatar kevm avatar knocte avatar lefthandedgoat avatar milkeg avatar morganpersson avatar navmed avatar olivercoad avatar pedro-ramirez-suarez avatar pottereric avatar rachelblasucci avatar rubenoen avatar sergey-tihon avatar skalinets avatar soerennielsen avatar stefanalfbo avatar vbop9834 avatar vladimirlogachev avatar voronoipotato avatar ztone avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

canopy's Issues

help user find misspelled elements

If a css selector fails, it would be nice of the framework helped the developer find what the problem is. for example:

if someone defines an element with the following misspelling "grwlInfo", and in the test they say

".growlInfo" == "some message"

it would be good if canopy could say:

unable to find element growlinfo, did you mean grwlinfo?

better discoverability of timeouts

Got a failure stating that an element couldn't be found in the allotted time. Would be nice if the failure would tell me that I have the ability to increase the time outs (compareTimeout, elementTimeout, pageTimeout).

Example:
"Element not found in the allotted time. If you want to increase the time, put elementTimeout <- {your new time} at the beginning of your test file, k thnks bye"

failure if not visible, but in dom

If a failure in click, type or etc occurs, canopy should tell me if it failed because it couldn't find the element or it failed because the element was in the dom but not visible (these kind of hints would help in diagnosing problems)

elementWithText and elementsWithText

Need a way to find an element with a given innerHtml/text:

elementWithText "cssSelector" "regex"

I would say the the second parameter should be a regex string

Run only wips

new context code will run only the wips in a given context, but if you have more than one context it will run the manys/tests for other contexts too.

Inconsistency in finding elements on page when elements fade in slowly with jquery

element is visible on page but is not clickable immediately it looks like.

Adding random thread.sleeps solved the issue, but maybe reliability should be built into the click method to try multiple time if an element isn't immediately found.

Here is a link to a video that I recorded showing the problem.

If the video resolution is too high using ctrl+- to make the video fit.

http://dl.dropbox.com/u/10614633/canopybug.mp4

need a sleep method

Would be nice to have a sleep method that understood seconds. So I don't have to enter System.Threading.Thread.Sleep(milliseconds).

The UI automation goes really fast, so when I'm authoring a test, there are times where I want things to happen more slowly, thoughts?

failed tests run first

UI automation test take a long time to run, would be good if canopy kept track of recent failures so it can run those tests first (this is going under the assumption that all tests are independent...so something they opt into)

Spectator Mode

It would be helpful to have a runtime mode for a script that ran at WIP speeds but used some form of on screen cursor to highlight the element that the script is currently inspecting or changing. For instance, a colored semi-transparent overlay shown over the element currently being read, with one color reserved to display a read and a different color to show that it's modifying the element.

Add feature: Warnings when you do two actions in a row, but didnt do a url check

example:

click "#page1Element"
click "#page2Element"

between is a page transition and the implicit wait of the 2nd click will wait 5 seconds, but maybe the user should do an explicit wait via on "newurl".

log all actions in a collection then do some simple pattern matching to detect potential issues and print as warnings at the end of the test run.

need to determine which browser instance failed

with multiple browsers (and when a failure occurs), it's hard to tell which browser had the failure. some visual indicator or something in the console stating which browser is currently selected would be good.

Get a value from the DOM

Can we get a value from the DOM? In jQuery, I'd go
var x = $('#hiddenField').val();

Can we do this with canopy? If so, how?

xtest to comment out tests

there are times where I want to comment out a test. would be nice if there was a method called xtest so that I can turn this:

test(fun _ -> 
    describe "registering a user"
    reset()
    registerUser "[email protected]")

into

xtest(fun _ -> 
    describe "registering a user"
    reset()
    registerUser "[email protected]")

as opposed to having to do

//test(fun _ -> 
//    describe "registering a user"
//    reset()
//    registerUser "[email protected]")

add failfast

if one test fails dont run anymore tests in that script

Context/Spec with F#

Found a need for running a shared setup...trying to think of ways to run a shared setup between tests...here is one idea:

context(fun _ ->
    describe "returning a borrowed game"

    before(fun _ ->
        logOff()
        requestGame()
        logOff()
    )

    test(fun _ ->
        describe "borrower returns game"
        loginAs "user2"
        is (elementsWithText "#wantedGames .brand" "Borrowed").Length 1
        click deleteGameLink
        is (elementsWithText "#wantedGames .brand" "Borrowed").Length 0
    )

    test(fun _ ->
        describe "lender marks game as returned"
        loginAs "user1"
        is (numberOfRequestedGames()) 1
        click gameReturnedLink
        is (numberOfRequestedGames()) 0
    )
)

global wait before performing actions such as click or write

Would be nice if there was a function that could be set that would be initially consulted before allow a click or write to continue.

For example:

waitFor <- loadingDivToDisappear()

click "#save" //this would wait until loadingDivToDisappear() returns

click take in more than just a css selector?

I started using elementsWithText and found myself wanting to pass the output into a click method.

It would be nice if I could do:

click (elementsWithText "#wantedGames .brand" "Borrowed").Head

or

click (elementWithText "#wantedGames .brand" "Borrowed")

(I may lean towards wanting this feature for write, read, etc)....thoughts?

Spectator Mode Seek Indicator

The spectator mode is great when the script actually finds what it's looking for but it's common for a script to be stuck trying to find something that is actually not on the page. It would be helpful to show a blinking green light (analogous to a hd seek indicator light) with the locator (xpath/css/etc) of the thing it's looking for.

Tiny typo in BP message

In the message that reads "Element not found in the allotted time ..." where it says "elementTimeout <- 10" should read "elementTimeout <- 10.0"

... I know ... picking nits here.

Add a 'contains' or 'matches' assert operation

We can currently assert that an element is exactly equal to a value with "selector == value". Can we have one that says that the element has the value somewhere inside it?

If it could honor Regex, that would be fantastic! Like ...
selector .= /regex/;
or
selector.match(/regex/)

failure of *= should print out what was found

got tripped up on using *=. I forgot to include something in the CSS selector that I used which caused the failure. It would be good if the failure message contained all the innerhtml that WAS found (it would have shown me that I had the CSS selector partially wrong)

Highlight element that is being read/written to during wip mode

Aaron had a great suggestion.

When running a test in wip mode, highlight the element that is being interacted with.

I am thinking set the current element to an orange color, then when done set it to yellow to show that it was interacted with at some point in the test.

suggestion to assert that I was on about:blank misleading?

Got this output:
Passed
Suggestion: as a best practice you should check that you are on a page before
accessing an element on it
you were on about:blank
then on http://localhost:3000/Account/LogOn?ReturnUrl=%2f
Suggestion: as a best practice you should check that you are on a page before
accessing an element on it
you were on http://localhost:3000/Account/LogOn?ReturnUrl=%2f
then on http://localhost:3000/Account/Register

for the following test:
url "http://localhost:3000"
click "a[href='/Account/Register']"
write "#Email" email
write "#Password" "Password"
write "#PasswordConfirmation" "Password"
click "input[value='register']"
url "http://localhost:3000/account/logoff"

ability to clear a textbox

Need a way to clear what's in a text box. The write method appends to what's already in the text box. Do you think it'd be better for write to just clear what's there and write the new value?

compiler warning on quit() method

I get the following warning on the quit() method:
C:\Development\Oak\Sample Apps\BorrowedGames\BorrowedGames.UI.Tests\Program.fs(48,1): warning FS0020: This expression sh
ould have type 'unit', but has type 'bool'. Use 'ignore' to discard the result of the expression, or 'let' to bind the r
esult to a name. [C:\Development\Oak\Sample Apps\BorrowedGames\BorrowedGames.UI.Tests\BorrowedGames.UI.Tests.fsproj]

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.