git.iko.soy/rowtype-yoga/purescript-playwright
on main help sign in
Updates
commit3638634ae1e77c30ab557f959de43952862e6f13 authorVladimir Kalnitsky <klntsky@gmail.com> dateMon 12 Jul 2021, 15:45 (5 years ago) parent31188cc
8 files changed+75−64
packages.dhall+2−3 spago.dhall+12 src/Playwright.purs+49−49 src/Playwright/ConsoleMessage.purs+1−1 src/Playwright/FileChooser.purs+3−3 src/Playwright/JSHandle.purs+1−1 src/Playwright/Keyboard.purs+3−3 src/Playwright/Mouse.purs+4−4
packages.dhall+2−3
@@ -1,5 +1,5 @@
11let upstream =
2− https://github.com/purescript/package-sets/releases/download/psc-0.13.8-20200911-2/packages.dhall sha256:872c06349ed9c8210be43982dc6466c2ca7c5c441129826bcb9bf3672938f16e
2+ https://github.com/purescript/package-sets/releases/download/psc-0.14.2-20210629/packages.dhall sha256:534c490bb73cae75adb5a39871142fd8db5c2d74c90509797a80b8bb0d5c3f7b
33
44let overrides =
55 { untagged-union =
@@ -12,13 +12,12 @@ let overrides =
1212 , "literals"
1313 , "maybe"
1414 , "newtype"
15− , "proxy"
1615 , "psci-support"
1716 , "tuples"
1817 , "unsafe-coerce"
1918 ]
2019 , repo = "https://github.com/jvliwanag/purescript-untagged-union.git"
21− , version = "edc091a1fde2cb6ac775865ee6e761b2fb99fc22"
20+ , version = "v0.3.0"
2221 }
2322 }
2423
spago.dhall+12
@@ -11,6 +11,18 @@
1111 , "node-buffer"
1212 , "node-fs-aff"
1313 , "undefined"
14+ , "aff"
15+ , "either"
16+ , "exceptions"
17+ , "foreign"
18+ , "foreign-object"
19+ , "literals"
20+ , "maybe"
21+ , "node-streams"
22+ , "ordered-collections"
23+ , "refs"
24+ , "strings"
25+ , "transformers"
1426 ]
1527, packages = ./packages.dhall
1628, sources = [ "src/**/*.purs", "test/**/*.purs" ]
src/Playwright.purs+49−49
@@ -57,19 +57,19 @@ import Playwright.Internal (effCall, effProp, affCall)
5757import Playwright.Options
5858import Prelude (Unit, ($))
5959import Undefined (undefined)
60−import Untagged.Coercible (class Coercible)
60+import Untagged.Castable (class Castable)
6161import Untagged.Union (type (|+|), UndefinedOr)
6262
6363launch
6464 :: forall o
65− . Coercible o LaunchOptions
65+ . Castable o LaunchOptions
6666 => BrowserType -> o -> Aff Browser
6767launch =
6868 affCall "launch" \_ -> launch
6969
7070close
7171 :: forall x
72− . Coercible x (Browser |+| BrowserContext |+| Page)
72+ . Castable x (Browser |+| BrowserContext |+| Page)
7373 => x -> Aff Unit
7474close =
7575 affCall "close" \_ -> close
@@ -88,30 +88,30 @@ version =
8888
8989newPage
9090 :: forall x o
91− . Coercible x (Browser |+| BrowserContext)
92− => Coercible o NewpageOptions
91+ . Castable x (Browser |+| BrowserContext)
92+ => Castable o NewpageOptions
9393 => x -> o -> Aff Page
9494newPage =
9595 affCall "newPage" \_ -> newPage
9696
9797goForward
9898 :: forall o
99− . Coercible o GoOptions
99+ . Castable o GoOptions
100100 => Page -> o -> Aff (Null |+| Response)
101101goForward =
102102 affCall "goForward" \_ -> goForward
103103
104104goBack
105105 :: forall o
106− . Coercible o GoOptions
106+ . Castable o GoOptions
107107 => Page -> o -> Aff (Null |+| Response)
108108goBack =
109109 affCall "goBack" \_ -> goBack
110110
111111goto
112112 :: forall x o
113− . Coercible x (Page |+| Frame)
114− => Coercible o GotoOptions
113+ . Castable x (Page |+| Frame)
114+ => Castable o GotoOptions
115115 => x -> URL -> o -> Aff (Null |+| Response)
116116goto =
117117 affCall "goto" \_ -> goto
@@ -131,24 +131,24 @@ addCookies =
131131
132132hover
133133 :: forall x o
134− . Coercible x (Page |+| Frame |+| ElementHandle)
135− => Coercible o HoverOptions
134+ . Castable x (Page |+| Frame |+| ElementHandle)
135+ => Castable o HoverOptions
136136 => x -> o -> Aff Unit
137137hover =
138138 affCall "hover" \_ -> hover
139139
140140innerHTML
141141 :: forall x o
142− . Coercible x (Page |+| Frame)
143− => Coercible o InnerHTMLOptions
142+ . Castable x (Page |+| Frame)
143+ => Castable o InnerHTMLOptions
144144 => x -> Selector -> o -> Aff String
145145innerHTML =
146146 affCall "innerHTML" \_ -> innerHTML
147147
148148innerText
149149 :: forall x o
150− . Coercible o InnerTextOptions
151− => Coercible x (Page |+| Frame |+| ElementHandle)
150+ . Castable o InnerTextOptions
151+ => Castable x (Page |+| Frame |+| ElementHandle)
152152 => x
153153 -> Selector
154154 -> o
@@ -171,7 +171,7 @@ name = effCall "name" \_ -> name
171171-- | `sth.$(selector)`
172172query
173173 :: forall x
174− . Coercible x (ElementHandle |+| Page |+| Frame)
174+ . Castable x (ElementHandle |+| Page |+| Frame)
175175 => x -> Selector -> Aff (Null |+| ElementHandle)
176176query =
177177 affCall "$" \_ -> query
@@ -179,29 +179,29 @@ query =
179179-- | `sth.$$(selector)`
180180queryMany
181181 :: forall x
182− . Coercible x (ElementHandle |+| Page |+| Frame)
182+ . Castable x (ElementHandle |+| Page |+| Frame)
183183 => x -> Selector -> Aff (Array ElementHandle)
184184queryMany =
185185 affCall "$$" \_ -> queryMany
186186
187187screenshot
188188 :: forall x o
189− . Coercible x (ElementHandle |+| Page)
190− => Coercible o ScreenshotOptions
189+ . Castable x (ElementHandle |+| Page)
190+ => Castable o ScreenshotOptions
191191 => x -> o -> Aff Buffer
192192screenshot =
193193 affCall "screenshot" \_ -> screenshot
194194
195195textContent
196196 :: forall x
197− . Coercible x (Page |+| Frame |+| ElementHandle)
197+ . Castable x (Page |+| Frame |+| ElementHandle)
198198 => x -> Selector -> Aff (Null |+| String)
199199textContent =
200200 affCall "textContent" \_ -> textContent
201201
202202url
203203 :: forall x
204− . Coercible x (Page |+| Frame |+| Download |+| Request |+| Response |+| Worker)
204+ . Castable x (Page |+| Frame |+| Download |+| Request |+| Response |+| Worker)
205205 => x
206206 -> Effect URL
207207url =
@@ -209,8 +209,8 @@ url =
209209
210210addInitScript
211211 :: forall x o
212− . Coercible x (Page |+| BrowserContext)
213− => Coercible o AddInitScriptOptions
212+ . Castable x (Page |+| BrowserContext)
213+ => Castable o AddInitScriptOptions
214214 => x
215215 -> o
216216 -> Aff Unit
@@ -223,8 +223,8 @@ clearCookies =
223223
224224click
225225 :: forall x o
226− . Coercible x (Page |+| Frame)
227− => Coercible o ClickOptions
226+ . Castable x (Page |+| Frame)
227+ => Castable o ClickOptions
228228 => x
229229 -> Selector
230230 -> o
@@ -234,7 +234,7 @@ click =
234234
235235content
236236 :: forall x
237− . Coercible x (Page |+| Frame)
237+ . Castable x (Page |+| Frame)
238238 => x
239239 -> Aff String
240240content =
@@ -242,8 +242,8 @@ content =
242242
243243dblclick
244244 :: forall x o
245− . Coercible x (Page |+| Frame |+| ElementHandle)
246− => Coercible o ClickOptions
245+ . Castable x (Page |+| Frame |+| ElementHandle)
246+ => Castable o ClickOptions
247247 => x
248248 -> Selector
249249 -> o
@@ -253,7 +253,7 @@ dblclick =
253253
254254evaluate
255255 :: forall x
256− . Coercible x (Page |+| Frame |+| Worker |+| JSHandle)
256+ . Castable x (Page |+| Frame |+| Worker |+| JSHandle)
257257 => x
258258 -> String
259259 -- ^ Function to be evaluated in browser context
@@ -263,7 +263,7 @@ evaluate =
263263
264264evaluateHandle
265265 :: forall x
266− . Coercible x (Page |+| Frame |+| Worker |+| JSHandle)
266+ . Castable x (Page |+| Frame |+| Worker |+| JSHandle)
267267 => x
268268 -> String
269269 -- ^ Function to be evaluated in browser context
@@ -273,8 +273,8 @@ evaluateHandle =
273273
274274waitForNavigation
275275 :: forall x o
276− . Coercible x (Page |+| Frame)
277− => Coercible o WaitForNavigationOptions
276+ . Castable x (Page |+| Frame)
277+ => Castable o WaitForNavigationOptions
278278 => x
279279 -> o
280280 -> Aff (Null |+| Response)
@@ -283,8 +283,8 @@ waitForNavigation =
283283
284284waitForRequest
285285 :: forall url o
286− . Coercible url (URL |+| Regex |+| URL -> Boolean)
287− => Coercible o WaitForRequestOptions
286+ . Castable url (URL |+| Regex |+| URL -> Boolean)
287+ => Castable o WaitForRequestOptions
288288 => Page
289289 -> url
290290 -> o
@@ -293,8 +293,8 @@ waitForRequest = affCall "waitForRequest" \_ -> waitForRequest
293293
294294waitForResponse
295295 :: forall url o
296− . Coercible url (URL |+| Regex |+| URL -> Boolean)
297− => Coercible o WaitForResponseOptions
296+ . Castable url (URL |+| Regex |+| URL -> Boolean)
297+ => Castable o WaitForResponseOptions
298298 => Page
299299 -> url
300300 -> o
@@ -303,8 +303,8 @@ waitForResponse = affCall "waitForResponse" \_ -> waitForResponse
303303
304304waitForSelector
305305 :: forall x o
306− . Coercible x (Page |+| Frame |+| ElementHandle)
307− => Coercible o WaitForSelectorOptions
306+ . Castable x (Page |+| Frame |+| ElementHandle)
307+ => Castable o WaitForSelectorOptions
308308 => x
309309 -> Selector
310310 -> o
@@ -313,8 +313,8 @@ waitForSelector = affCall "waitForSelector" \_ -> waitForSelector
313313
314314waitForFunction
315315 :: forall x o
316− . Coercible x (Page |+| Frame)
317− => Coercible o WaitForFunctionOptions
316+ . Castable x (Page |+| Frame)
317+ => Castable o WaitForFunctionOptions
318318 => x
319319 -> String
320320 -- ^ Function to be evaluated in browser context
@@ -326,8 +326,8 @@ waitForFunction x s o = waitForFunction' x s (unsafeToForeign undefined) o
326326
327327waitForLoadState
328328 :: forall x o
329− . Coercible x (Page |+| Frame)
330− => Coercible o WaitForLoadStateOptions
329+ . Castable x (Page |+| Frame)
330+ => Castable o WaitForLoadStateOptions
331331 => x
332332 -> WaitUntil
333333 -> o
@@ -336,7 +336,7 @@ waitForLoadState = affCall "waitForLoadState" \_ -> waitForLoadState
336336
337337waitForTimeout
338338 :: forall x
339− . Coercible x (Page |+| Frame)
339+ . Castable x (Page |+| Frame)
340340 => x
341341 -> Int
342342 -> Aff Unit
@@ -344,7 +344,7 @@ waitForTimeout = affCall "waitForTimeout" \_ -> waitForTimeout
344344
345345pdf
346346 :: forall o
347− . Coercible o PdfOptions
347+ . Castable o PdfOptions
348348 => Page
349349 -> o
350350 -> Aff Buffer
@@ -352,9 +352,9 @@ pdf = affCall "pdf" \_ -> pdf
352352
353353setInputFiles
354354 :: forall x o f
355− . Coercible x (Page |+| Frame |+| ElementHandle)
356− => Coercible o SetFilesOptions
357− => Coercible f
355+ . Castable x (Page |+| Frame |+| ElementHandle)
356+ => Castable o SetFilesOptions
357+ => Castable f
358358 ( String
359359 |+| Array String
360360 |+| { name :: String
@@ -383,14 +383,14 @@ setViewportSize = affCall "setViewportSize" \_ -> setViewportSize
383383
384384title
385385 :: forall x
386− . Coercible x (Page |+| Frame)
386+ . Castable x (Page |+| Frame)
387387 => x
388388 -> Aff String
389389title = affCall "title" \_ -> title
390390
391391exposeBinding
392392 :: forall x b
393− . Coercible x (Page |+| BrowserContext)
393+ . Castable x (Page |+| BrowserContext)
394394 => x
395395 -> String
396396 -- ^ Name of the function on the window object.
src/Playwright/ConsoleMessage.purs+1−1
@@ -5,7 +5,7 @@ import Playwright.Data (ConsoleMessage, JSHandle, URL)
55import Effect (Effect)
66import Playwright.Internal (effCall)
77import Data.Generic.Rep (class Generic)
8−import Data.Generic.Rep.Show (genericShow)
8+import Data.Show.Generic (genericShow)
99import Data.String.Common (toLower)
1010
1111type ConsoleMessageLocation =
src/Playwright/FileChooser.purs+3−3
@@ -7,7 +7,7 @@ import Playwright.Data (ElementHandle, FileChooser, Page)
77import Playwright.Internal (affCall, effCall)
88import Playwright.Options (SetFilesOptions)
99import Prelude
10−import Untagged.Coercible (class Coercible)
10+import Untagged.Castable (class Castable)
1111import Untagged.Union (type (|+|))
1212
1313element :: FileChooser -> Effect ElementHandle
@@ -21,8 +21,8 @@ page = effCall "page" \_ -> page
2121
2222setFiles
2323 :: forall o f
24− . Coercible o SetFilesOptions
25− => Coercible f
24+ . Castable o SetFilesOptions
25+ => Castable f
2626 ( String
2727 |+| Array String
2828 |+| { name :: String
src/Playwright/JSHandle.purs+1−1
@@ -19,7 +19,7 @@ dispose :: JSHandle -> Aff Unit
1919dispose = affCall "dispose" \_ -> dispose
2020
2121getProperties :: JSHandle -> Aff (Map String JSHandle)
22−getProperties = toAffE <<< getProperties_ Map.insert mempty
22+getProperties = toAffE <<< getProperties_ Map.insert Map.empty
2323
2424getProperty :: JSHandle -> Aff JSHandle
2525getProperty = affCall "getProperty" \_ -> getProperty
src/Playwright/Keyboard.purs+3−3
@@ -6,7 +6,7 @@ import Playwright.Data (Keyboard)
66import Playwright.Options (KeyboardPressOptions)
77import Effect.Aff (Aff)
88import Control.Promise (toAffE)
9−import Untagged.Coercible (class Coercible, coerce)
9+import Untagged.Castable (class Castable, cast)
1010
1111type Key = String
1212
@@ -20,14 +20,14 @@ insertText =
2020
2121press
2222 :: forall o
23− . Coercible o KeyboardPressOptions
23+ . Castable o KeyboardPressOptions
2424 => Keyboard -> Key -> o -> Aff Unit
2525press =
2626 affCall "press" \_ -> press
2727
2828type'
2929 :: forall o
30− . Coercible o KeyboardPressOptions
30+ . Castable o KeyboardPressOptions
3131 => Keyboard -> String -> o -> Aff Unit
3232type' =
3333 affCall "type" \_ -> type'
src/Playwright/Mouse.purs+4−4
@@ -5,7 +5,7 @@ import Playwright.Data
55import Playwright.Internal
66import Playwright.Options
77import Prelude
8−import Untagged.Coercible (class Coercible)
8+import Untagged.Castable (class Castable)
99import Untagged.Union
1010
1111click
@@ -26,7 +26,7 @@ dblclick = affCall "dblclick" \_ -> dblclick
2626
2727down
2828 :: forall o
29− . Coercible o MouseUpDownOptions
29+ . Castable o MouseUpDownOptions
3030 => Mouse
3131 -> o
3232 -> Aff Unit
@@ -34,7 +34,7 @@ down = affCall "down" \_ -> down
3434
3535move
3636 :: forall o
37− . Coercible o MouseMoveOptions
37+ . Castable o MouseMoveOptions
3838 => Mouse
3939 -> o
4040 -> Aff Unit
@@ -42,7 +42,7 @@ move = affCall "move" \_ -> move
4242
4343up
4444 :: forall o
45− . Coercible o MouseUpDownOptions
45+ . Castable o MouseUpDownOptions
4646 => Mouse
4747 -> o
4848 -> Aff Unit