This repository was archived by the owner on Jan 17, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +18
-12
lines changed Expand file tree Collapse file tree 2 files changed +18
-12
lines changed Original file line number Diff line number Diff line change @@ -46,27 +46,23 @@ checkNotExistsByCss :: forall e o. String -> Selenium e o Unit
46
46
contra :: forall e o a. Selenium e o a -> Selenium e o Unit
47
47
```
48
48
49
- #### ` waiter `
49
+ #### ` tryToFind' `
50
50
51
51
``` purescript
52
- waiter :: forall e o a. Selenium e o a -> Int -> Selenium e o a
52
+ tryToFind' :: forall e o. Int -> Selenium e o Locator -> Selenium e o Element
53
53
```
54
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
55
+ Repeatedly attempts to find an element using the provided selector until the
56
+ provided timeout elapses.
58
57
59
- #### ` waitExistentCss `
58
+ #### ` tryToFind `
60
59
61
60
``` purescript
62
- waitExistentCss :: forall e o. String -> Int -> Selenium e o Element
61
+ tryToFind :: forall e o. Selenium e o Locator -> Selenium e o Element
63
62
```
64
63
65
- #### ` waitNotExistentCss `
66
-
67
- ``` purescript
68
- waitNotExistentCss :: forall e o. String -> Int -> Selenium e o Unit
69
- ```
64
+ Repeatedly tries to find an element using the provided selector until
65
+ the provided ` Selenium ` 's ` defaultTimeout ` elapses.
70
66
71
67
#### ` await `
72
68
Original file line number Diff line number Diff line change @@ -59,6 +59,16 @@ contra check = do
59
59
(const $ pure unit)
60
60
(const $ throwError $ error " check successed in contra" ) eR
61
61
62
+ -- | Repeatedly attempts to find an element using the provided selector until the
63
+ -- | provided timeout elapses.
64
+ tryToFind' :: forall e o . Int -> Selenium e o Locator -> Selenium e o Element
65
+ tryToFind' timeout locator = tryRepeatedlyTo' timeout $ locator >>= findExact
66
+
67
+ -- | Repeatedly tries to find an element using the provided selector until
68
+ -- | the provided `Selenium`'s `defaultTimeout` elapses.
69
+ tryToFind :: forall e o . Selenium e o Locator -> Selenium e o Element
70
+ tryToFind locator = tryRepeatedlyTo $ locator >>= findExact
71
+
62
72
-- | Repeatedly tries to evaluate check (third arg) for timeout ms (first arg)
63
73
-- | finishes when check evaluates to true.
64
74
-- | If there is an error during check or it constantly returns `false`
You can’t perform that action at this time.
0 commit comments