sus-fixtures-async-webdriver 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6d117bc1968ff83bc9c09fc192f096939e6359d446bd4528c027f65f8f3cffa4
4
- data.tar.gz: 31bf4661190b95dc50faa87e7680adbd5ed6f9d8b9163a4bef72b516b2e598d4
3
+ metadata.gz: 5b2db086816dba9ccdeda6e616fa7061c1bdfc566c1a93f44171a27d3025d469
4
+ data.tar.gz: 683370ebe7cdedb936d9afca32c14a6bdc8ec8258457b9cc0b141fc040010fca
5
5
  SHA512:
6
- metadata.gz: bc36d496b42921bf10368ea166cc69edfa42e1e607c7810bff0bb4e9521feaa87aa092baf7e7698d859028940b42962eca8fd85a4178d6949c2eb98764d41d39
7
- data.tar.gz: 50734787e437a593fda343969b47b10bf480a38de0ce3f9a72495131c65583f43a58a7ebd6ba3a9abff7c4094655309b46185028b131249b46d1c8ebf1c554ac
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 ||= SessionContext.pool.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)
@@ -7,7 +7,7 @@ module Sus
7
7
  module Fixtures
8
8
  module Async
9
9
  module WebDriver
10
- VERSION = "0.1.0"
10
+ VERSION = "0.1.2"
11
11
  end
12
12
  end
13
13
  end
data/license.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # MIT License
2
2
 
3
- Copyright, 2023, by Samuel Williams.
3
+ Copyright, 2023-2024, by Samuel Williams.
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
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
- See `examples/rack` for a full example.
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.0
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: 2023-12-08 00:00:00.000000000 Z
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.0'
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.4.10
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