Skip to content
This repository was archived by the owner on Jan 17, 2020. It is now read-only.

Commit 7750cec

Browse files
committed
Merge pull request #15 from cryogenian/ready/combinators
combinators, spy-xhr, reader interface
2 parents b9886f0 + f3ddc35 commit 7750cec

File tree

12 files changed

+1045
-10
lines changed

12 files changed

+1045
-10
lines changed

docs/Selenium.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,18 @@ affLocator \el -> do
7373
foldFn a _ = a
7474
```
7575

76+
#### `findExact`
77+
78+
``` purescript
79+
findExact :: forall e. Driver -> Locator -> Aff (selenium :: SELENIUM | e) Element
80+
```
81+
82+
#### `childExact`
83+
84+
``` purescript
85+
childExact :: forall e. Element -> Locator -> Aff (selenium :: SELENIUM | e) Element
86+
```
87+
7688
#### `findElement`
7789

7890
``` purescript
@@ -109,7 +121,7 @@ Same as `findElements` but starts searching from custom element
109121
#### `setFileDetector`
110122

111123
``` purescript
112-
setFileDetector :: forall e. Driver -> FileDetector -> Eff (selenium :: SELENIUM | e) Unit
124+
setFileDetector :: forall e. Driver -> FileDetector -> Aff (selenium :: SELENIUM | e) Unit
113125
```
114126

115127
#### `navigateBack`
@@ -130,10 +142,10 @@ navigateForward :: forall e. Driver -> Aff (selenium :: SELENIUM | e) Unit
130142
refresh :: forall e. Driver -> Aff (selenium :: SELENIUM | e) Unit
131143
```
132144

133-
#### `to`
145+
#### `navigateTo`
134146

135147
``` purescript
136-
to :: forall e. String -> Driver -> Aff (selenium :: SELENIUM | e) Unit
148+
navigateTo :: forall e. String -> Driver -> Aff (selenium :: SELENIUM | e) Unit
137149
```
138150

139151
#### `getCurrentUrl`

docs/Selenium/Combinators.md

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
## Module Selenium.Combinators
2+
3+
#### `retry`
4+
5+
``` purescript
6+
retry :: forall e o a. Int -> Selenium e o a -> Selenium e o a
7+
```
8+
9+
Retry computation until it successed but not more then `n` times
10+
11+
#### `tryFind`
12+
13+
``` purescript
14+
tryFind :: forall e o. String -> Selenium e o Element
15+
```
16+
17+
Tries to find element by string checks: css, xpath, id, name and classname
18+
19+
#### `waitUntilJust`
20+
21+
``` purescript
22+
waitUntilJust :: forall e o a. Selenium e o (Maybe a) -> Int -> Selenium e o a
23+
```
24+
25+
#### `checker`
26+
27+
``` purescript
28+
checker :: forall e o a. Selenium e o Boolean -> Selenium e o Boolean
29+
```
30+
31+
#### `getElementByCss`
32+
33+
``` purescript
34+
getElementByCss :: forall e o. String -> Selenium e o Element
35+
```
36+
37+
#### `checkNotExistsByCss`
38+
39+
``` purescript
40+
checkNotExistsByCss :: forall e o. String -> Selenium e o Unit
41+
```
42+
43+
#### `contra`
44+
45+
``` purescript
46+
contra :: forall e o a. Selenium e o a -> Selenium e o Unit
47+
```
48+
49+
#### `waiter`
50+
51+
``` purescript
52+
waiter :: forall e o a. Selenium e o a -> Int -> Selenium e o a
53+
```
54+
55+
takes value and repeatedly tries to evaluate it for timeout of ms (second arg)
56+
if it evaluates w/o error returns its value
57+
else throws error
58+
59+
#### `waitExistentCss`
60+
61+
``` purescript
62+
waitExistentCss :: forall e o. String -> Int -> Selenium e o Element
63+
```
64+
65+
#### `waitNotExistentCss`
66+
67+
``` purescript
68+
waitNotExistentCss :: forall e o. String -> Int -> Selenium e o Unit
69+
```
70+
71+
#### `await`
72+
73+
``` purescript
74+
await :: forall e o. Int -> Selenium e o Boolean -> Selenium e o Unit
75+
```
76+
77+
Repeatedly tries to evaluate check (third arg) for timeout ms (first arg)
78+
finishes when check evaluates to true.
79+
If there is an error during check or it constantly returns `false`
80+
throws error with message (second arg)
81+
82+
#### `awaitUrlChanged`
83+
84+
``` purescript
85+
awaitUrlChanged :: forall e o. String -> Selenium e o Boolean
86+
```
87+
88+

0 commit comments

Comments
 (0)