New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add clickOn function (closes #1405) #1408

Merged
merged 5 commits into from Jun 21, 2017

Conversation

Projects
None yet
2 participants
@mwotton
Contributor

mwotton commented Jun 14, 2017

No description provided.

mwotton added some commits Jun 14, 2017

Show outdated Hide outdated yesod-test/Yesod/Test.hs Outdated
yit "can follow a link via clickOn" $ do
get ("/htmlWithLink" :: Text)
clickOn "a#thelink"
statusIs 200

This comment has been minimized.

@MaxGabriel

MaxGabriel Jun 15, 2017

Member

Should this test that the actual new page is returned after the link is clicked?

@MaxGabriel

MaxGabriel Jun 15, 2017

Member

Should this test that the actual new page is returned after the link is clicked?

This comment has been minimized.

@mwotton

mwotton Jun 15, 2017

Contributor

Probably. Would be nice to just check URL of the last response, but i can't seem to do that - i'll check the content instead.

@mwotton

mwotton Jun 15, 2017

Contributor

Probably. Would be nice to just check URL of the last response, but i can't seem to do that - i'll check the content instead.

Show outdated Hide outdated yesod-test/ChangeLog.md Outdated
@mwotton

This comment has been minimized.

Show comment
Hide comment
@mwotton

mwotton Jun 21, 2017

Contributor

this seems to be failing because of a CI timeout. @MaxGabriel - could you poke travis?

Contributor

mwotton commented Jun 21, 2017

this seems to be failing because of a CI timeout. @MaxGabriel - could you poke travis?

-- ==== __ Examples__
--
-- > get "/foobar"
-- > clickOn "a#idofthelink"

This comment has been minimized.

@MaxGabriel

MaxGabriel Jun 21, 2017

Member

Could you add an @since annotation here?

@MaxGabriel

MaxGabriel Jun 21, 2017

Member

Could you add an @since annotation here?

This comment has been minimized.

@mwotton

mwotton Jun 21, 2017

Contributor

done.

@mwotton

mwotton Jun 21, 2017

Contributor

done.

@MaxGabriel

This comment has been minimized.

Show comment
Hide comment
@MaxGabriel

MaxGabriel Jun 21, 2017

Member

Yes, poked. I made one more comment about a missing @since annotation

Member

MaxGabriel commented Jun 21, 2017

Yes, poked. I made one more comment about a missing @since annotation

case findAttributeBySelector (simpleBody res) query "href" of
Left err -> failure $ query <> " did not parse: " <> T.pack (show err)
Right [[match]] -> get match
Right matches -> failure $ "Expected exactly one match for clickOn: got " <> T.pack (show matches)

This comment has been minimized.

@MaxGabriel

MaxGabriel Jun 21, 2017

Member

I really like this implementation, very clean pattern matching.

@MaxGabriel

MaxGabriel Jun 21, 2017

Member

I really like this implementation, very clean pattern matching.

This comment has been minimized.

@mwotton

mwotton Jun 21, 2017

Contributor

thanks :)

@mwotton

mwotton Jun 21, 2017

Contributor

thanks :)

@MaxGabriel MaxGabriel merged commit 0223c0a into yesodweb:master Jun 21, 2017

1 of 2 checks passed

continuous-integration/travis-ci/pr The Travis CI build could not complete due to an error
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
@MaxGabriel

This comment has been minimized.

Show comment
Hide comment
@MaxGabriel

MaxGabriel Jun 21, 2017

Member

Great PR!

Member

MaxGabriel commented Jun 21, 2017

Great PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment