sus-fixtures-async-webdriver 0.1.0 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/sus/fixtures/async/webdriver/session_context.rb +18 -1
- data/lib/sus/fixtures/async/webdriver/version.rb +1 -1
- data/license.md +1 -1
- data/readme.md +8 -2
- data.tar.gz.sig +0 -0
- metadata +6 -5
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5b2db086816dba9ccdeda6e616fa7061c1bdfc566c1a93f44171a27d3025d469
|
4
|
+
data.tar.gz: 683370ebe7cdedb936d9afca32c14a6bdc8ec8258457b9cc0b141fc040010fca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: adb1ad8e5ad03fbc42cce1a599a6f7057034e343d901bd296e615b3cce3536785bc990378b2fbe01de43ec5853a9408c894942c07e4d0a99e855e8499940e9fb
|
7
|
+
data.tar.gz: 00b007a710ebbfdeda0ef446717485b17ff83dfd3ee3c45902711de70f3d2c2f08a0fa913ca53beb78240a32787cf66f9d0a143dcbacf8f93cd657e28b9e57c7
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
@@ -10,6 +10,7 @@ module Sus
|
|
10
10
|
module Fixtures
|
11
11
|
module Async
|
12
12
|
module WebDriver
|
13
|
+
# The session context provides a way to manage the lifecycle of a WebDriver session.
|
13
14
|
module SessionContext
|
14
15
|
GUARD = Thread::Mutex.new
|
15
16
|
|
@@ -25,8 +26,16 @@ module Sus
|
|
25
26
|
end
|
26
27
|
end
|
27
28
|
|
29
|
+
def make_session
|
30
|
+
SessionContext.pool.session.tap do |session|
|
31
|
+
# 1 second timeout for implicit waits.
|
32
|
+
session.implicit_wait_timeout = 1000
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
# The current session, that represents the browser window.
|
28
37
|
def session
|
29
|
-
@session ||=
|
38
|
+
@session ||= make_session
|
30
39
|
end
|
31
40
|
|
32
41
|
def before
|
@@ -44,14 +53,20 @@ module Sus
|
|
44
53
|
super
|
45
54
|
end
|
46
55
|
|
56
|
+
# Navigate to a specific path within the website.
|
57
|
+
# @parameter path [String] The path to navigate to.
|
47
58
|
def navigate_to(path)
|
48
59
|
session.navigate_to(URI.join(bound_url, path))
|
49
60
|
end
|
50
61
|
|
62
|
+
# Find an element within the current session.
|
63
|
+
# @parameter locator [Hash] The locator to use to find the element.
|
51
64
|
def find_element(...)
|
52
65
|
session.find_element(::Async::WebDriver::Locator.wrap(...))
|
53
66
|
end
|
54
67
|
|
68
|
+
# Find all elements matching the given locator.
|
69
|
+
# @parameter locator [Hash] The locator to use to find the elements.
|
55
70
|
def find_elements(...)
|
56
71
|
session.find_elements(::Async::WebDriver::Locator.wrap(...))
|
57
72
|
end
|
@@ -87,6 +102,7 @@ module Sus
|
|
87
102
|
end
|
88
103
|
end
|
89
104
|
|
105
|
+
# Check if the current session has an element matching the given locator.
|
90
106
|
def have_element(...)
|
91
107
|
HaveElement.new(::Async::WebDriver::Locator.wrap(...))
|
92
108
|
end
|
@@ -106,6 +122,7 @@ module Sus
|
|
106
122
|
end
|
107
123
|
end
|
108
124
|
|
125
|
+
# Check if an element has properties matching the given key-value pairs.
|
109
126
|
def have_properties(**properties)
|
110
127
|
predicates = properties.map do |key, value|
|
111
128
|
HaveProperty.new(key, value)
|
data/license.md
CHANGED
data/readme.md
CHANGED
@@ -6,7 +6,13 @@ Provides test fixtures for [async-webdriver](https://github.com/socketry/async-w
|
|
6
6
|
|
7
7
|
## Usage
|
8
8
|
|
9
|
-
|
9
|
+
Please see the [project documentation](https://socketry.github.io/sus-fixtures-async-webdriver/) for more details.
|
10
|
+
|
11
|
+
- [Getting Started](https://socketry.github.io/sus-fixtures-async-webdriver/guides/getting-started/index) - This guide is designed to help you get started with the `sus-fixtures-async-webdriver` gem.
|
12
|
+
|
13
|
+
## See Also
|
14
|
+
|
15
|
+
- [async-webdriver](https://github.com/socketry/async-webdriver) - Asynchronous WebDriver client used by this fixture.
|
10
16
|
|
11
17
|
## Contributing
|
12
18
|
|
@@ -24,4 +30,4 @@ This project uses the [Developer Certificate of Origin](https://developercertifi
|
|
24
30
|
|
25
31
|
### Contributor Covenant
|
26
32
|
|
27
|
-
This project is governed by [Contributor Covenant](https://www.contributor-covenant.org/). All contributors and participants agree to abide by its terms.
|
33
|
+
This project is governed by the [Contributor Covenant](https://www.contributor-covenant.org/). All contributors and participants agree to abide by its terms.
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sus-fixtures-async-webdriver
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
@@ -37,7 +37,7 @@ cert_chain:
|
|
37
37
|
Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
|
38
38
|
voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
|
39
39
|
-----END CERTIFICATE-----
|
40
|
-
date:
|
40
|
+
date: 2024-05-04 00:00:00.000000000 Z
|
41
41
|
dependencies:
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: async-webdriver
|
@@ -63,12 +63,13 @@ files:
|
|
63
63
|
- lib/sus/fixtures/async/webdriver/version.rb
|
64
64
|
- license.md
|
65
65
|
- readme.md
|
66
|
-
homepage: https://github.com/socketry/sus-fixtures-async-webdriver
|
66
|
+
homepage: https://github.com/socketry/sus-fixtures-async-webdriver
|
67
67
|
licenses:
|
68
68
|
- MIT
|
69
69
|
metadata:
|
70
70
|
documentation_uri: https://socketry.github.io/sus-fixtures-async-webdriver/
|
71
71
|
funding_uri: https://github.com/sponsors/ioquatix
|
72
|
+
source_code_uri: https://github.com/socketry/sus-fixtures-async-webdriver.git
|
72
73
|
post_install_message:
|
73
74
|
rdoc_options: []
|
74
75
|
require_paths:
|
@@ -77,14 +78,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
77
78
|
requirements:
|
78
79
|
- - ">="
|
79
80
|
- !ruby/object:Gem::Version
|
80
|
-
version: '3.
|
81
|
+
version: '3.1'
|
81
82
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
82
83
|
requirements:
|
83
84
|
- - ">="
|
84
85
|
- !ruby/object:Gem::Version
|
85
86
|
version: '0'
|
86
87
|
requirements: []
|
87
|
-
rubygems_version: 3.
|
88
|
+
rubygems_version: 3.5.3
|
88
89
|
signing_key:
|
89
90
|
specification_version: 4
|
90
91
|
summary: A set of sus fixtures for writing integration tests.
|
metadata.gz.sig
CHANGED
Binary file
|