codedownio / sandwich

Yet another test framework for Haskell.
https://codedownio.github.io/sandwich
Other
67 stars 5 forks source link

Can't start examples #87

Open fzhulitov opened 4 months ago

fzhulitov commented 4 months ago

from https://codedownio.github.io/sandwich/docs/extensions/sandwich-webdriver i make this example runSandwich defaultOptions spec and spec

spec :: TopSpec
spec = introduceWebDriver (defaultWdOptions "/tmp/tools") $ do
  it "opens Google and searches" $ withSession1 $ do
    openPage "http://www.google.com"
    search <- findElem (ByCSS "input[title='Search']")
    click search
    sendKeys "asdf\n" search

get this

Beginning suite of 1 tests

  opens Google and searches
      Context exception:
      Got exception (Failure in introduce 'Introduce WebDriver session' allocation handler)
          Failed to obtain geckodriver: 'ExpectedButGot {failureCallStack = Just [("shouldBe",SrcLoc {srcLocPackage = "sandwich-webdriver-0.2.3.1-JV0aJiV9iIHBOwGgn8Mebj", srcLocModule = "Test.Sandwich.WebDriver.Internal.Binaries", srcLocFile = "src/Test/Sandwich/WebDriver/Internal/Binaries.hs", srcLocStartLine = 188, srcLocStartCol = 38, srcLocEndLine = 188, srcLocEndCol = 48})], failureValue1 = ExitSuccess, failureValue2 = ExitFailure 2}'
          CallStack (from HasCallStack):
            error, called at src/Test/Sandwich/WebDriver/Internal/StartWebDriver.hs:82:21 in sandwich-webdriver-0.2.3.1-JV0aJiV9iIHBOwGgn8Mebj:Test.Sandwich.WebDriver.Internal.StartWebDriver
            startWebDriver, called at src/Test/Sandwich/WebDriver.hs:76:3 in sandwich-webdriver-0.2.3.1-JV0aJiV9iIHBOwGgn8Mebj:Test.Sandwich.WebDriver
            allocateWebDriver, called at src/Test/Sandwich/WebDriver.hs:61:83 in sandwich-webdriver-0.2.3.1-JV0aJiV9iIHBOwGgn8Mebj:Test.Sandwich.WebDriver
            introduceWebDriver, called at app/Main.hs:43:8 in main:Main
thomasjm commented 4 months ago

Hmm, can you turn on debug logging with --debug or similar?

Downloading dependencies like geckodriver currently requires a few tools like wget, curl, and tar. Is it possible one of those isn't on your PATH?

This situation will improve soon when we add support for obtaining things like geckodriver automatically via Nix.