packages feed

webdriver-precore-0.0.0.2: webdriver-precore.cabal

cabal-version: 3.12

name:           webdriver-precore
version:        0.0.0.2
homepage:       https://github.com/pyrethrum/webdriver-precore#readme
bug-reports:    https://github.com/pyrethrum/webdriver-precore/issues
author:         John Walker, Adrian Glouftsis
maintainer:     theghostjw@gmail.com
category:       Webb, WebDriver, Testing
copyright:      2025 John Walker, Adrian Glouftsis
license:        BSD-3-Clause
license-file:   LICENSE
build-type:     Simple
extra-doc-files: 
  README.md
  ChangeLog.md
tested-with: GHC == { 9.8.2, 9.10.1 }
    

synopsis:       A typed wrapper for W3C WebDriver protocol. A base for other libraries.

description:
  This library provides typed definitions for the endpoints of the @<https://www.w3.org/TR/2025/WD-webdriver2-20250306/ W3C Webdriver>@.

  It is intended to be used as a base for other libraries that provide a WebDriver client implementation and higher level functions. 
  
  A WebDriver client implementation can be built by pattern matching on the 'W3Spec' type returned by the functions in this library,
  sending the corresponding HTTP requests to a vendor provided WebDriver, then parsing the response using the parser provided as part 
  of the 'W3Spec' type.

  See "WebDriverPreCore" for further details and [the project repo](https://github.com/pyrethrum/webdriver/blob/main/webdriver-examples/driver-demo-e2e/WebDriverE2EDemoTest.hs) for an examples.
  
  If you are looking for a fully implemented web client library, you should check out an alternative such as [haskell-webdriver](https://github.com/haskell-webdriver/haskell-webdriver#readme).
  

common commonExtensions
  default-extensions:
    AllowAmbiguousTypes
      BangPatterns
      BlockArguments
      ConstrainedClassMethods
      ConstraintKinds
      DisambiguateRecordFields
      DuplicateRecordFields
      DataKinds
      DefaultSignatures
      DeriveFoldable
      DeriveFunctor
      DeriveGeneric
      DeriveLift
      DeriveTraversable
      DerivingStrategies
      EmptyCase
      ExistentialQuantification
      ExtendedDefaultRules
      FlexibleContexts
      FlexibleInstances
      FunctionalDependencies
      GADTs
      GeneralizedNewtypeDeriving
      ImportQualifiedPost
      InstanceSigs
      KindSignatures
      LambdaCase
      LiberalTypeSynonyms
      MultiParamTypeClasses
      MultiWayIf
      NamedFieldPuns
      NoFieldSelectors
      NoImplicitPrelude
      NumericUnderscores
      OverloadedStrings
      OverloadedRecordDot
      PartialTypeSignatures
      PatternSynonyms
      PolyKinds
      QuasiQuotes
      RankNTypes
      RecordWildCards
      ScopedTypeVariables
      StandaloneDeriving
      StrictData
      TemplateHaskell
      TupleSections
      TypeApplications
      TypeFamilies
      TypeFamilyDependencies
      TypeOperators

common commonGhcOptions
  ghc-options:
    -fmax-pmcheck-models=10000000 
    -ferror-spans 
    -fprint-potential-instances 
    -Wall 
    -Wcompat 
    -Wincomplete-record-updates 
    -Wincomplete-uni-patterns 
    -Wredundant-constraints
    -fwarn-tabs 
    -fwrite-ide-info 
    -fno-warn-type-defaults 
    -fno-warn-unused-do-bind 
    -Wno-overlapping-patterns 
    -fprefer-byte-code 
    -fbyte-code-and-object-code
    -haddock
    -- -fdefer-type-errors

library
  import: commonExtensions, commonGhcOptions
  exposed-modules:
      WebDriverPreCore
      WebDriverPreCore.Internal.Utils
  other-modules:
      WebDriverPreCore.SpecDefinition
      WebDriverPreCore.Capabilities
      WebDriverPreCore.Error
      WebDriverPreCore.HttpResponse
  hs-source-dirs: src
  build-depends:
    aeson         >=1.4   && <2.3, 
    aeson-pretty  >=0.8   && <0.9,
    base          >=4.16  && <5,
    bytestring    >=0.10  && <0.12.3,
    text          >=2.1   && <2.2,
    containers    >=0.6   && <0.8,
    vector        >=0.12  && <0.14
  default-language: Haskell2010

test-suite test
  import: commonExtensions, commonGhcOptions
  type: exitcode-stdio-1.0
  main-is: Driver.hs
  hs-source-dirs: test
  build-depends:
    , aeson
    , base
    , containers
    , ghc
    , pretty-show
    , text
    , tasty
    , tasty-hunit
    , tasty-quickcheck
    , tasty-discover
    , falsify
    , webdriver-precore
    , raw-strings-qq
  other-modules:
    ApiCoverageTest,
    ErrorCoverageTest,
    JSONParsingTest,
  build-tool-depends:
    tasty-discover:tasty-discover
  default-language: Haskell2010