atsfill 0.0.7.dev211__tar.gz → 0.0.8__tar.gz
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.
- {atsfill-0.0.7.dev211 → atsfill-0.0.8}/PKG-INFO +4 -4
- {atsfill-0.0.7.dev211 → atsfill-0.0.8}/pyproject.toml +9 -9
- {atsfill-0.0.7.dev211 → atsfill-0.0.8}/pyproject.toml.orig +9 -9
- {atsfill-0.0.7.dev211 → atsfill-0.0.8}/src/atsfill/adapters/adp.py +62 -5
- {atsfill-0.0.7.dev211 → atsfill-0.0.8}/src/atsfill/adapters/adpmyjobs.py +24 -7
- {atsfill-0.0.7.dev211 → atsfill-0.0.8}/src/atsfill/adapters/bamboohr.py +34 -0
- {atsfill-0.0.7.dev211 → atsfill-0.0.8}/src/atsfill/adapters/breezy.py +5 -0
- {atsfill-0.0.7.dev211 → atsfill-0.0.8}/src/atsfill/adapters/eightfold.py +60 -3
- {atsfill-0.0.7.dev211 → atsfill-0.0.8}/src/atsfill/adapters/greenhouse.py +42 -3
- {atsfill-0.0.7.dev211 → atsfill-0.0.8}/src/atsfill/adapters/gupy.py +103 -12
- {atsfill-0.0.7.dev211 → atsfill-0.0.8}/src/atsfill/adapters/hiringthing.py +20 -2
- {atsfill-0.0.7.dev211 → atsfill-0.0.8}/src/atsfill/adapters/hrmdirect.py +24 -7
- {atsfill-0.0.7.dev211 → atsfill-0.0.8}/src/atsfill/adapters/isolvedhire.py +20 -0
- {atsfill-0.0.7.dev211 → atsfill-0.0.8}/src/atsfill/adapters/jazzhr.py +3 -0
- {atsfill-0.0.7.dev211 → atsfill-0.0.8}/src/atsfill/adapters/jobaffinity.py +25 -2
- {atsfill-0.0.7.dev211 → atsfill-0.0.8}/src/atsfill/adapters/jobstreet.py +14 -0
- {atsfill-0.0.7.dev211 → atsfill-0.0.8}/src/atsfill/adapters/join.py +12 -2
- {atsfill-0.0.7.dev211 → atsfill-0.0.8}/src/atsfill/adapters/lever.py +19 -6
- {atsfill-0.0.7.dev211 → atsfill-0.0.8}/src/atsfill/adapters/manatal.py +20 -0
- {atsfill-0.0.7.dev211 → atsfill-0.0.8}/src/atsfill/adapters/oracle.py +73 -9
- {atsfill-0.0.7.dev211 → atsfill-0.0.8}/src/atsfill/adapters/paycor.py +21 -6
- {atsfill-0.0.7.dev211 → atsfill-0.0.8}/src/atsfill/adapters/personio.py +4 -0
- {atsfill-0.0.7.dev211 → atsfill-0.0.8}/src/atsfill/adapters/recruitee.py +4 -0
- {atsfill-0.0.7.dev211 → atsfill-0.0.8}/src/atsfill/adapters/recruiterflow.py +1 -0
- {atsfill-0.0.7.dev211 → atsfill-0.0.8}/src/atsfill/adapters/rippling.py +35 -6
- {atsfill-0.0.7.dev211 → atsfill-0.0.8}/src/atsfill/adapters/successfactors.py +3 -0
- {atsfill-0.0.7.dev211 → atsfill-0.0.8}/src/atsfill/adapters/taleo.py +25 -10
- {atsfill-0.0.7.dev211 → atsfill-0.0.8}/src/atsfill/adapters/ukg.py +29 -7
- {atsfill-0.0.7.dev211 → atsfill-0.0.8}/src/atsfill/adapters/welcomekit.py +5 -0
- {atsfill-0.0.7.dev211 → atsfill-0.0.8}/src/atsfill/adapters/wellfound.py +16 -0
- {atsfill-0.0.7.dev211 → atsfill-0.0.8}/src/atsfill/adapters/werecruit.py +3 -0
- {atsfill-0.0.7.dev211 → atsfill-0.0.8}/src/atsfill/adapters/workable.py +15 -9
- {atsfill-0.0.7.dev211 → atsfill-0.0.8}/src/atsfill/adapters/workatastartup.py +18 -1
- {atsfill-0.0.7.dev211 → atsfill-0.0.8}/src/atsfill/adapters/workday.py +81 -27
- {atsfill-0.0.7.dev211 → atsfill-0.0.8}/src/atsfill/adapters/wttj.py +7 -2
- {atsfill-0.0.7.dev211 → atsfill-0.0.8}/src/atsfill/cli.py +1 -1
- {atsfill-0.0.7.dev211 → atsfill-0.0.8}/src/atsfill/core/adapter.py +17 -0
- {atsfill-0.0.7.dev211 → atsfill-0.0.8}/src/atsfill/core/browser.py +17 -22
- {atsfill-0.0.7.dev211 → atsfill-0.0.8}/src/atsfill/core/commands.py +27 -7
- {atsfill-0.0.7.dev211 → atsfill-0.0.8}/src/atsfill/core/matching.py +36 -21
- {atsfill-0.0.7.dev211 → atsfill-0.0.8}/src/atsfill/core/results.py +2 -0
- {atsfill-0.0.7.dev211 → atsfill-0.0.8}/src/atsfill/core/telemetry.py +2 -0
- {atsfill-0.0.7.dev211 → atsfill-0.0.8}/LICENSE +0 -0
- {atsfill-0.0.7.dev211 → atsfill-0.0.8}/README.md +0 -0
- {atsfill-0.0.7.dev211 → atsfill-0.0.8}/src/atsfill/__init__.py +0 -0
- {atsfill-0.0.7.dev211 → atsfill-0.0.8}/src/atsfill/adapters/__init__.py +0 -0
- {atsfill-0.0.7.dev211 → atsfill-0.0.8}/src/atsfill/adapters/ashby.py +0 -0
- {atsfill-0.0.7.dev211 → atsfill-0.0.8}/src/atsfill/adapters/dayforce.py +0 -0
- {atsfill-0.0.7.dev211 → atsfill-0.0.8}/src/atsfill/adapters/hireology.py +0 -0
- {atsfill-0.0.7.dev211 → atsfill-0.0.8}/src/atsfill/adapters/paylocity.py +0 -0
- {atsfill-0.0.7.dev211 → atsfill-0.0.8}/src/atsfill/adapters/phenom.py +0 -0
- {atsfill-0.0.7.dev211 → atsfill-0.0.8}/src/atsfill/adapters/pinpoint.py +0 -0
- {atsfill-0.0.7.dev211 → atsfill-0.0.8}/src/atsfill/adapters/smartrecruiters.py +0 -0
- {atsfill-0.0.7.dev211 → atsfill-0.0.8}/src/atsfill/adapters/successfactors.js +0 -0
- {atsfill-0.0.7.dev211 → atsfill-0.0.8}/src/atsfill/adapters/teamtailor.py +0 -0
- {atsfill-0.0.7.dev211 → atsfill-0.0.8}/src/atsfill/adapters/zohorecruit.py +0 -0
- {atsfill-0.0.7.dev211 → atsfill-0.0.8}/src/atsfill/core/__init__.py +0 -0
- {atsfill-0.0.7.dev211 → atsfill-0.0.8}/src/atsfill/core/accounts.py +0 -0
- {atsfill-0.0.7.dev211 → atsfill-0.0.8}/src/atsfill/core/attempts.py +0 -0
- {atsfill-0.0.7.dev211 → atsfill-0.0.8}/src/atsfill/core/conditions.py +0 -0
- {atsfill-0.0.7.dev211 → atsfill-0.0.8}/src/atsfill/core/countries.py +0 -0
- {atsfill-0.0.7.dev211 → atsfill-0.0.8}/src/atsfill/core/html.py +0 -0
- {atsfill-0.0.7.dev211 → atsfill-0.0.8}/src/atsfill/core/otp.py +0 -0
- {atsfill-0.0.7.dev211 → atsfill-0.0.8}/src/atsfill/core/passwords.py +0 -0
- {atsfill-0.0.7.dev211 → atsfill-0.0.8}/src/atsfill/core/paths.py +0 -0
- {atsfill-0.0.7.dev211 → atsfill-0.0.8}/src/atsfill/core/registry.py +0 -0
- {atsfill-0.0.7.dev211 → atsfill-0.0.8}/src/atsfill/core/snapshot.py +0 -0
- {atsfill-0.0.7.dev211 → atsfill-0.0.8}/src/atsfill/py.typed +0 -0
- {atsfill-0.0.7.dev211 → atsfill-0.0.8}/src/atsfill/registry.toml +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: atsfill
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.8
|
|
4
4
|
Summary: Read, dry-run and submit job application forms on hiring systems: Ashby, Greenhouse, Teamtailor, Welcome to the Jungle.
|
|
5
5
|
Keywords: job-applications,ats,ashby,greenhouse,teamtailor,ai-agents,cli
|
|
6
6
|
Author: shbernal
|
|
@@ -16,11 +16,11 @@ Classifier: Programming Language :: Python :: 3
|
|
|
16
16
|
Classifier: Programming Language :: Python :: 3.14
|
|
17
17
|
Classifier: Topic :: Office/Business
|
|
18
18
|
Classifier: Typing :: Typed
|
|
19
|
-
Requires-Dist: camoufox==0.5.
|
|
20
|
-
Requires-Dist: filelock==4.
|
|
19
|
+
Requires-Dist: camoufox==0.5.9
|
|
20
|
+
Requires-Dist: filelock==4.2.10
|
|
21
21
|
Requires-Dist: keyring==25.7.0
|
|
22
22
|
Requires-Dist: packaging==26.3
|
|
23
|
-
Requires-Dist: posthog==7.
|
|
23
|
+
Requires-Dist: posthog==7.87.1
|
|
24
24
|
Requires-Python: >=3.14
|
|
25
25
|
Project-URL: Homepage, https://github.com/shbernal/atsfill
|
|
26
26
|
Project-URL: Repository, https://github.com/shbernal/atsfill
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "atsfill"
|
|
3
|
-
version = "0.0.
|
|
3
|
+
version = "0.0.8"
|
|
4
4
|
description = "Read, dry-run and submit job application forms on hiring systems: Ashby, Greenhouse, Teamtailor, Welcome to the Jungle."
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
license = "MIT"
|
|
@@ -28,11 +28,11 @@ classifiers = [
|
|
|
28
28
|
"Typing :: Typed",
|
|
29
29
|
]
|
|
30
30
|
dependencies = [
|
|
31
|
-
"camoufox==0.5.
|
|
32
|
-
"filelock==4.
|
|
31
|
+
"camoufox==0.5.9",
|
|
32
|
+
"filelock==4.2.10",
|
|
33
33
|
"keyring==25.7.0",
|
|
34
34
|
"packaging==26.3",
|
|
35
|
-
"posthog==7.
|
|
35
|
+
"posthog==7.87.1",
|
|
36
36
|
]
|
|
37
37
|
|
|
38
38
|
[[project.authors]]
|
|
@@ -51,13 +51,13 @@ requires = ["uv_build>=0.13.0,<0.14.0"]
|
|
|
51
51
|
build-backend = "uv_build"
|
|
52
52
|
|
|
53
53
|
[dependency-groups]
|
|
54
|
-
docs = ["zensical==0.
|
|
55
|
-
commit-check = ["commit-check==2.
|
|
54
|
+
docs = ["zensical==0.1.1"]
|
|
55
|
+
commit-check = ["commit-check==2.20.5"]
|
|
56
56
|
dev = [
|
|
57
|
-
"pytest>=9.
|
|
57
|
+
"pytest>=9.2.0",
|
|
58
58
|
"pytest-xdist>=3.8.0",
|
|
59
|
-
"ruff>=0.17.
|
|
60
|
-
"ty==0.0.
|
|
59
|
+
"ruff>=0.17.4",
|
|
60
|
+
"ty==0.0.101",
|
|
61
61
|
]
|
|
62
62
|
|
|
63
63
|
[tool.ruff]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "atsfill"
|
|
3
|
-
version = "0.0.
|
|
3
|
+
version = "0.0.8"
|
|
4
4
|
description = "Read, dry-run and submit job application forms on hiring systems: Ashby, Greenhouse, Teamtailor, Welcome to the Jungle."
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
license = "MIT"
|
|
@@ -21,11 +21,11 @@ classifiers = [
|
|
|
21
21
|
"Typing :: Typed",
|
|
22
22
|
]
|
|
23
23
|
dependencies = [
|
|
24
|
-
"camoufox==0.5.
|
|
25
|
-
"filelock==4.
|
|
24
|
+
"camoufox==0.5.9",
|
|
25
|
+
"filelock==4.2.10",
|
|
26
26
|
"keyring==25.7.0",
|
|
27
27
|
"packaging==26.3",
|
|
28
|
-
"posthog==7.
|
|
28
|
+
"posthog==7.87.1",
|
|
29
29
|
]
|
|
30
30
|
|
|
31
31
|
[project.urls]
|
|
@@ -42,16 +42,16 @@ build-backend = "uv_build"
|
|
|
42
42
|
|
|
43
43
|
[dependency-groups]
|
|
44
44
|
docs = [
|
|
45
|
-
"zensical==0.
|
|
45
|
+
"zensical==0.1.1",
|
|
46
46
|
]
|
|
47
47
|
commit-check = [
|
|
48
|
-
"commit-check==2.
|
|
48
|
+
"commit-check==2.20.5",
|
|
49
49
|
]
|
|
50
50
|
dev = [
|
|
51
|
-
"pytest>=9.
|
|
51
|
+
"pytest>=9.2.0",
|
|
52
52
|
"pytest-xdist>=3.8.0",
|
|
53
|
-
"ruff>=0.17.
|
|
54
|
-
"ty==0.0.
|
|
53
|
+
"ruff>=0.17.4",
|
|
54
|
+
"ty==0.0.101",
|
|
55
55
|
]
|
|
56
56
|
|
|
57
57
|
[tool.ruff]
|
|
@@ -49,6 +49,9 @@ NEXT = "#ja_sv_cw_next_footer_btn"
|
|
|
49
49
|
PREVIOUS = "#ja_sv_cw_prev_footer_btn"
|
|
50
50
|
SUBMIT = "#submitApplication"
|
|
51
51
|
ATTEST = "input[name=self_att_agree_chk]"
|
|
52
|
+
SIGNATURE = "attestation.signature"
|
|
53
|
+
OPT_OUT = "resume.ai_opt_out"
|
|
54
|
+
LATE = {SIGNATURE: OPTION_TIMEOUT_MS, OPT_OUT: UPLOAD_TIMEOUT_MS} # boxes shown a moment after
|
|
52
55
|
PERSON = "/jobApplication/applicant/person"
|
|
53
56
|
PAY = "/jobApplication/requestedPayRate"
|
|
54
57
|
|
|
@@ -74,6 +77,7 @@ SHOWN_BY_COUNTRY = {"county"} # once a country with counties is picked
|
|
|
74
77
|
ADDRESS_MAX = 30 # "Address Line 1 must not exceed 30 characters"
|
|
75
78
|
FIXED = {"personal.email"} # the verified email, read only
|
|
76
79
|
QUESTIONS = "#question_0, #questionYes_0, #desiredSalaryId, #refferalOptions, #commentTextArea"
|
|
80
|
+
NOT_FIELDS = re.compile(r"select-filter-input|react-select-.*") # a list's own inputs
|
|
77
81
|
|
|
78
82
|
# Voluntary Self-ID: its lists and radio groups, each with the meta's indicator that shows it
|
|
79
83
|
# and its code list; a radio's value is its code
|
|
@@ -113,6 +117,7 @@ class ADP:
|
|
|
113
117
|
self._values: dict[str, Answer] = {}
|
|
114
118
|
self._codes: dict[str, dict[str, str]] = {} # a radio's label by its value, by field id
|
|
115
119
|
self._amounts: set[str] = set() # the page shows them formatted: `50,000.00`
|
|
120
|
+
self._shown: dict[str, None] = {} # the fields each step showed, in order
|
|
116
121
|
|
|
117
122
|
def detect(self, url: str, page: Page | None) -> bool:
|
|
118
123
|
return _posting(url) is not None
|
|
@@ -166,7 +171,7 @@ class ADP:
|
|
|
166
171
|
asked = self._questions(control, transforms)
|
|
167
172
|
self._steps = [
|
|
168
173
|
Step("Personal Information", PERSONAL[0][1], self._personal(page, transforms)),
|
|
169
|
-
Step("Resume", "input[type=file]", [self._resume()]),
|
|
174
|
+
Step("Resume", "input[type=file]", [self._resume(), self._opt_out()]),
|
|
170
175
|
] # fmt: skip
|
|
171
176
|
# A wizard with nothing to ask has no Questions step; one that asks nothing the meta
|
|
172
177
|
# lists has no box of its own: Next moves past it
|
|
@@ -176,25 +181,44 @@ class ADP:
|
|
|
176
181
|
fields = self._self_id(transforms, indicators)
|
|
177
182
|
self._steps.append(Step("Voluntary Self-ID", "#vsidWhy, #vsidEthRace", fields))
|
|
178
183
|
self._steps.append(Step("Review Your Application", ""))
|
|
179
|
-
|
|
184
|
+
attest = [self._attestation(control), self._signature()]
|
|
185
|
+
self._steps.append(Step("Self-Attest & Submit", SUBMIT, attest))
|
|
180
186
|
return [f for s in self._steps for f in s.fields]
|
|
181
187
|
|
|
182
188
|
def fill(self, page: Page, answers: dict[str, Answer]) -> None:
|
|
183
189
|
"""Answers each step and moves on with Next, up to the attestation, which it agrees to
|
|
184
190
|
without Submit."""
|
|
185
|
-
self._values = {}
|
|
191
|
+
self._values, self._shown = {}, {}
|
|
186
192
|
answers = {f.id: f.prefilled for s in self._steps for f in s.fields
|
|
187
193
|
if f.prefilled is not None} | answers # fmt: skip
|
|
188
194
|
for step in self._steps:
|
|
189
195
|
_wait_for_step(page, step)
|
|
196
|
+
before = {key for key, _ in page.evaluate(_CONTROLS)}
|
|
190
197
|
for f in step.fields:
|
|
191
198
|
if f.id in answers and f.id not in FIXED:
|
|
192
199
|
self._set(page, f, answers[f.id])
|
|
200
|
+
self._shown |= dict.fromkeys(self._shown_on(page, step, before))
|
|
193
201
|
self._values |= self._read(page, step)
|
|
194
202
|
if step.marker == SUBMIT:
|
|
195
203
|
return
|
|
196
204
|
_next(page, step)
|
|
197
205
|
|
|
206
|
+
def shown_fields(self, page: Page) -> list[str]:
|
|
207
|
+
"""The fields each step showed once answered: the wizard holds one step at a time."""
|
|
208
|
+
return list(self._shown)
|
|
209
|
+
|
|
210
|
+
def _shown_on(self, page: Page, step: Step, before: set[str]) -> list[str]:
|
|
211
|
+
"""The open step's fields: those with an enabled box, then the controls its answers
|
|
212
|
+
added that no field has. What it showed before them is not all fields, such as a
|
|
213
|
+
preferred name's box, so a control counts only as an answer's."""
|
|
214
|
+
boxes = {name for box in self._boxes.values() for name in re.findall(r"[\w-]+", box)}
|
|
215
|
+
shown = [f.id for f in step.fields if _enabled(page.locator(self._boxes[f.id]).first)]
|
|
216
|
+
for key, dom in page.evaluate(_CONTROLS):
|
|
217
|
+
listed = key in boxes or dom in boxes or NOT_FIELDS.fullmatch(key)
|
|
218
|
+
if key and key not in before and not listed:
|
|
219
|
+
shown.append(key)
|
|
220
|
+
return shown
|
|
221
|
+
|
|
198
222
|
def read_back(self, page: Page) -> dict[str, Answer]:
|
|
199
223
|
"""Each step's values as it was left."""
|
|
200
224
|
return dict(self._values)
|
|
@@ -246,6 +270,17 @@ class ADP:
|
|
|
246
270
|
self._boxes["resume"] = "input[type=file]"
|
|
247
271
|
return Field("resume", "Resume", FieldType.FILE, True, accept=[".pdf", ".doc", ".docx"])
|
|
248
272
|
|
|
273
|
+
def _opt_out(self) -> Field:
|
|
274
|
+
"""The opt-out an employer's uploaded résumé shows, in no meta: listed on every form,
|
|
275
|
+
its box left alone unless answered."""
|
|
276
|
+
self._boxes[OPT_OUT] = "input[name=candidateProfileRelevanceOptionDivId]"
|
|
277
|
+
label = (
|
|
278
|
+
"I want to opt out from having my resume reviewed by artificial intelligence as "
|
|
279
|
+
"part of the application process."
|
|
280
|
+
)
|
|
281
|
+
return Field(OPT_OUT, label, FieldType.CHOICE, False, YES_NO, default="No",
|
|
282
|
+
shown_when=Is("resume")) # fmt: skip
|
|
283
|
+
|
|
249
284
|
def _questions(self, control: dict[str, Any], transforms: dict[str, Any]) -> list[Field]:
|
|
250
285
|
"""The questionnaire, each question its `#question_<n>` by position; then the desired
|
|
251
286
|
pay and the comment where the meta does not hide them."""
|
|
@@ -356,8 +391,17 @@ class ADP:
|
|
|
356
391
|
self._boxes["attestation"] = ATTEST
|
|
357
392
|
return Field("attestation", label, FieldType.CHOICE, True, YES_NO)
|
|
358
393
|
|
|
394
|
+
def _signature(self) -> Field:
|
|
395
|
+
"""The name agreeing shows beneath the box, in no meta; the page's own words."""
|
|
396
|
+
self._boxes[SIGNATURE] = "#electronicSignature"
|
|
397
|
+
return Field(SIGNATURE, "Please type your full name.", FieldType.TEXT, True,
|
|
398
|
+
shown_when=Is("attestation", ["Yes"])) # fmt: skip
|
|
399
|
+
|
|
359
400
|
def _set(self, page: Page, f: Field, answer: Answer) -> None:
|
|
360
401
|
box = page.locator(self._boxes[f.id]).first
|
|
402
|
+
if f.id in LATE:
|
|
403
|
+
with suppress(Timeout):
|
|
404
|
+
box.wait_for(state="attached", timeout=LATE[f.id])
|
|
361
405
|
if not box.count():
|
|
362
406
|
return # not shown: its condition is unmet
|
|
363
407
|
if f.type is FieldType.FILE:
|
|
@@ -416,6 +460,10 @@ class ADP:
|
|
|
416
460
|
return values
|
|
417
461
|
|
|
418
462
|
|
|
463
|
+
# The open step's controls: what names each, and its id
|
|
464
|
+
_CONTROLS = """() => [...document.querySelectorAll(
|
|
465
|
+
"input, textarea, select, sdf-select-simple, wfn-dropdown-list"
|
|
466
|
+
)].map(e => [e.name || e.id, e.id])"""
|
|
419
467
|
# The meta lists the questionnaire of the posting its header names
|
|
420
468
|
_FETCH = """async ([url, requisition]) => {
|
|
421
469
|
const headers = {requisitionoid: requisition, 'x-requested-with': 'XMLHttpRequest'};
|
|
@@ -520,6 +568,11 @@ def _label(page: Page, selector: str) -> str:
|
|
|
520
568
|
return ""
|
|
521
569
|
|
|
522
570
|
|
|
571
|
+
def _enabled(box: Locator) -> bool:
|
|
572
|
+
"""A box the step shows and takes an answer in: race stays disabled until ethnicity allows."""
|
|
573
|
+
return box.count() > 0 and not box.evaluate("e => e.disabled === true")
|
|
574
|
+
|
|
575
|
+
|
|
523
576
|
def _wait_for_step(page: Page, step: Step) -> None:
|
|
524
577
|
if not step.marker:
|
|
525
578
|
page.wait_for_timeout(SETTLE_MS)
|
|
@@ -531,8 +584,12 @@ def _wait_for_step(page: Page, step: Step) -> None:
|
|
|
531
584
|
|
|
532
585
|
|
|
533
586
|
def _next(page: Page, step: Step) -> None:
|
|
534
|
-
"""Next, once the step is left; the page's errors where it stays.
|
|
535
|
-
|
|
587
|
+
"""Next, once the step is left; the page's errors where it stays. It is disabled while a
|
|
588
|
+
résumé uploads, past the moment the step lists the file."""
|
|
589
|
+
try:
|
|
590
|
+
page.locator(NEXT).click(timeout=UPLOAD_TIMEOUT_MS)
|
|
591
|
+
except Timeout:
|
|
592
|
+
raise NotTaken(f"{step.name}: Next stayed disabled: {_errors(page)}") from None
|
|
536
593
|
deadline = time.monotonic() + STEP_TIMEOUT_MS / 1000
|
|
537
594
|
while step.marker and page.locator(step.marker).first.count():
|
|
538
595
|
if time.monotonic() > deadline:
|
|
@@ -95,6 +95,7 @@ class ADPMyJobs:
|
|
|
95
95
|
self._codes: dict[str, dict[str, str]] = {} # by field id: an option's label by code
|
|
96
96
|
self._values: dict[str, Answer] = {}
|
|
97
97
|
self._fixed: set[str] = set() # disabled questions, their value shown as text
|
|
98
|
+
self._shown: dict[str, None] = {} # the fields each page showed, in order
|
|
98
99
|
|
|
99
100
|
def detect(self, url: str, page: Page | None) -> bool:
|
|
100
101
|
return _posting(url) is not None
|
|
@@ -202,7 +203,7 @@ class ADPMyJobs:
|
|
|
202
203
|
def fill(self, page: Page, answers: dict[str, Answer]) -> None:
|
|
203
204
|
"""Answers each section page by page, saving each with Next, up to the last section's
|
|
204
205
|
last page, or its review."""
|
|
205
|
-
self._values = {}
|
|
206
|
+
self._values, self._shown = {}, {}
|
|
206
207
|
answers = {f.id: f.prefilled for s in self._sections for f in s.fields
|
|
207
208
|
if f.prefilled is not None} | answers # fmt: skip
|
|
208
209
|
for section in self._sections:
|
|
@@ -210,9 +211,10 @@ class ADPMyJobs:
|
|
|
210
211
|
_on_section(page, section)
|
|
211
212
|
_to_page(page, section, ids)
|
|
212
213
|
_add_entries(page, section, number)
|
|
213
|
-
|
|
214
|
-
raise NotTaken(f"{section.title} shows {unlisted}, which the read did not list")
|
|
214
|
+
_all_listed(page, section)
|
|
215
215
|
self._answer(page, section, answers)
|
|
216
|
+
_all_listed(page, section) # before a Next saves what the answers showed
|
|
217
|
+
self._shown |= dict.fromkeys(_shown_ids(page, section))
|
|
216
218
|
self._values |= self._read(page, section)
|
|
217
219
|
last = number == max(len(section.pages), 1) - 1
|
|
218
220
|
if section is self._sections[-1] and last and not section.review:
|
|
@@ -221,6 +223,10 @@ class ADPMyJobs:
|
|
|
221
223
|
if section.review and section is not self._sections[-1]:
|
|
222
224
|
self._next(page, section) # the review's Next saves the section
|
|
223
225
|
|
|
226
|
+
def shown_fields(self, page: Page) -> list[str]:
|
|
227
|
+
"""The fields each page showed once answered: the workflow keeps one page at a time."""
|
|
228
|
+
return list(self._shown)
|
|
229
|
+
|
|
224
230
|
def read_back(self, page: Page) -> dict[str, Answer]:
|
|
225
231
|
"""Each section's values as it was left."""
|
|
226
232
|
return dict(self._values)
|
|
@@ -654,13 +660,24 @@ _SHOWN = """es => es
|
|
|
654
660
|
.map(e => [e.dataset.name, e.querySelector('label')?.innerText.trim()])"""
|
|
655
661
|
|
|
656
662
|
|
|
657
|
-
def
|
|
658
|
-
"""
|
|
663
|
+
def _all_listed(page: Page, section: Section) -> None:
|
|
664
|
+
"""Stops on a question the open page shows that the read did not list, before its Next
|
|
665
|
+
saves the section for good."""
|
|
659
666
|
if section.component.startswith("prescreen"):
|
|
660
|
-
return
|
|
667
|
+
return
|
|
661
668
|
listed = {f.id.removeprefix(f"{section.component}.") for f in section.fields}
|
|
662
669
|
shown = page.locator("adp-form-group").evaluate_all(_SHOWN)
|
|
663
|
-
|
|
670
|
+
unlisted = ", ".join(repr(label or name) for name, label in shown if name not in listed)
|
|
671
|
+
if unlisted:
|
|
672
|
+
raise NotTaken(f"{section.title} shows {unlisted}, which the read did not list")
|
|
673
|
+
|
|
674
|
+
|
|
675
|
+
def _shown_ids(page: Page, section: Section) -> list[str]:
|
|
676
|
+
"""The ids of the fields the open page shows; a prescreen's questions have no group."""
|
|
677
|
+
if section.component.startswith("prescreen"):
|
|
678
|
+
return [f.id for f in section.fields if _box(page, section, f).count()]
|
|
679
|
+
shown = page.locator("adp-form-group").evaluate_all(_SHOWN)
|
|
680
|
+
return [f"{section.component}.{name}" for name, _ in shown]
|
|
664
681
|
|
|
665
682
|
|
|
666
683
|
def _on_section(page: Page, section: Section) -> None:
|
|
@@ -95,6 +95,9 @@ TYPES = {
|
|
|
95
95
|
"file": FieldType.FILE,
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
+
CUSTOM_CONTROL = re.compile(r"customQuestionAnswers\.[a-z_]+?_(\d+)(_other)?")
|
|
99
|
+
VETERAN_RADIOS = ("declineToAnswer", "notVeteran", "veteran")
|
|
100
|
+
|
|
98
101
|
# The form's JSON answer and the state lists, fetched as the page fetches them.
|
|
99
102
|
_FETCH = """async urls => {
|
|
100
103
|
const out = [];
|
|
@@ -105,6 +108,12 @@ _FETCH = """async urls => {
|
|
|
105
108
|
return out;
|
|
106
109
|
}"""
|
|
107
110
|
|
|
111
|
+
# Each control of the form: what names it, and whether a person sees it.
|
|
112
|
+
_CONTROLS = """form => [...form.querySelectorAll("input, select, textarea")].map(e => ({
|
|
113
|
+
name: e.name, id: e.id, date: (e.placeholder ?? "").includes("yyyy"),
|
|
114
|
+
visible: e.offsetParent !== null,
|
|
115
|
+
}))"""
|
|
116
|
+
|
|
108
117
|
# What each present control shows, by the field's kind.
|
|
109
118
|
_READ_BACK = """(form, specs) => {
|
|
110
119
|
const named = name => form.querySelector(`[name="${name}"]`);
|
|
@@ -151,6 +160,7 @@ class BambooHR:
|
|
|
151
160
|
# each field's (kind, control name, extra): a radio's option ids by text, the
|
|
152
161
|
# veteran kinds' texts by id, a date's nothing
|
|
153
162
|
self._specs: dict[str, tuple[str, str | None, Any]] = {}
|
|
163
|
+
self._on_read: set[str] = set() # the controls' names as the form opened: its honeypot
|
|
154
164
|
|
|
155
165
|
def detect(self, url: str, page: Page | None) -> bool:
|
|
156
166
|
return _job(url) is not None
|
|
@@ -208,6 +218,7 @@ class BambooHR:
|
|
|
208
218
|
self._specs = {
|
|
209
219
|
f.id: spec for f, (_, spec) in zip(out, fields, strict=True) if not f.unfillable
|
|
210
220
|
}
|
|
221
|
+
self._on_read = {control["name"] for control in form.evaluate(_CONTROLS)}
|
|
211
222
|
return out
|
|
212
223
|
|
|
213
224
|
def fill(self, page: Page, answers: dict[str, Answer]) -> None:
|
|
@@ -266,6 +277,17 @@ class BambooHR:
|
|
|
266
277
|
continue # its question was not answered Other
|
|
267
278
|
control.fill(value)
|
|
268
279
|
|
|
280
|
+
def shown_fields(self, page: Page) -> list[str]:
|
|
281
|
+
"""The fields the form holds a control for, once filled; a visible control that came
|
|
282
|
+
after the read and no field names, by its name."""
|
|
283
|
+
shown: dict[str, None] = {}
|
|
284
|
+
for control in page.locator(FORM).evaluate(_CONTROLS):
|
|
285
|
+
if field_id := _field_of(control):
|
|
286
|
+
shown[field_id] = None
|
|
287
|
+
elif control["visible"] and control["name"] not in self._on_read:
|
|
288
|
+
shown[control["name"]] = None
|
|
289
|
+
return [i for i in shown if i != "dateAvailable" or i in self._specs]
|
|
290
|
+
|
|
269
291
|
def read_back(self, page: Page) -> dict[str, Answer]:
|
|
270
292
|
specs = {
|
|
271
293
|
i: (kind, name, extra if kind == "veteran" else None)
|
|
@@ -307,6 +329,18 @@ class BambooHR:
|
|
|
307
329
|
return f"{response.url} {response.status}"
|
|
308
330
|
|
|
309
331
|
|
|
332
|
+
def _field_of(control: dict[str, Any]) -> str | None:
|
|
333
|
+
"""The field a control belongs to: by its name, the date by its placeholder and the veteran
|
|
334
|
+
radios, whose name React makes up, by their ids."""
|
|
335
|
+
if control["date"]:
|
|
336
|
+
return "dateAvailable"
|
|
337
|
+
if control["id"] in VETERAN_RADIOS:
|
|
338
|
+
return "veteranStatusId"
|
|
339
|
+
if custom := CUSTOM_CONTROL.fullmatch(control["name"]):
|
|
340
|
+
return f"question_{custom[1]}{custom[2] or ''}"
|
|
341
|
+
return next((k for k, (_, name) in STANDARD.items() if name == control["name"]), None)
|
|
342
|
+
|
|
343
|
+
|
|
310
344
|
def _job(url: str) -> tuple[str, str] | None:
|
|
311
345
|
parts = urlsplit(url)
|
|
312
346
|
if not (parts.hostname and HOST.match(parts.hostname)) or not (m := JOB.match(parts.path)):
|
|
@@ -328,6 +328,11 @@ class Breezy:
|
|
|
328
328
|
case _:
|
|
329
329
|
controls.first.fill(values[0])
|
|
330
330
|
|
|
331
|
+
def shown_fields(self, page: Page) -> list[str]:
|
|
332
|
+
"""The controls `browser_read` names; a work history or education entry's have no name.
|
|
333
|
+
Every step stays in the page, the others hidden."""
|
|
334
|
+
return [raw["id"] for raw in page.locator(FORM).evaluate(_READ)]
|
|
335
|
+
|
|
331
336
|
def read_back(self, page: Page) -> dict[str, Answer]:
|
|
332
337
|
form = page.locator(FORM)
|
|
333
338
|
out: dict[str, Answer] = {}
|
|
@@ -36,6 +36,9 @@ PICKER = "[data-testid=picker-dialog]"
|
|
|
36
36
|
FORM_TIMEOUT_MS = 30_000
|
|
37
37
|
SHOWN_TIMEOUT_MS = 2_000
|
|
38
38
|
OPTIONS_TIMEOUT_MS = 5_000
|
|
39
|
+
FOCUS_TIMEOUT_MS = 500
|
|
40
|
+
LIST_CLOSE_TIMEOUT_MS = 2_000 # a list can close late on a page still loading
|
|
41
|
+
PICK_CLICKS = 3 # the list can lose a click on its option
|
|
39
42
|
UPLOAD_TIMEOUT_MS = 30_000
|
|
40
43
|
SUBMIT_TIMEOUT_MS = 90_000
|
|
41
44
|
PARSE_SETTLE_MS = 2_000
|
|
@@ -92,6 +95,9 @@ _DOM_IDS = """keys => {
|
|
|
92
95
|
return out;
|
|
93
96
|
}"""
|
|
94
97
|
|
|
98
|
+
# The element ids of the controls on the page.
|
|
99
|
+
_SHOWN = """() => [...document.querySelectorAll('[id$="_error"]')].map(e => e.id.slice(0, -6))"""
|
|
100
|
+
|
|
95
101
|
_READ_BACK = """controls => {
|
|
96
102
|
const out = {};
|
|
97
103
|
for (const [qid, dom, kind] of controls) {
|
|
@@ -150,6 +156,7 @@ class Eightfold:
|
|
|
150
156
|
def __init__(self) -> None:
|
|
151
157
|
self._controls: list[_Control] = [] # in the form's order
|
|
152
158
|
self._fields: list[Field] = []
|
|
159
|
+
self._ends: dict[str, str] = {} # each question's id, by what its element id ends with
|
|
153
160
|
|
|
154
161
|
def detect(self, url: str, page: Page | None) -> bool:
|
|
155
162
|
if _pid(url) is None:
|
|
@@ -216,6 +223,7 @@ class Eightfold:
|
|
|
216
223
|
if control.field.id in held and control.field.prefilled is None:
|
|
217
224
|
control.field = replace(control.field, default=held[control.field.id])
|
|
218
225
|
self._fields = [c.field for c in self._controls]
|
|
226
|
+
self._ends = {end: c.field.id for c in self._controls for end in c.ends}
|
|
219
227
|
self._controls = [c for c in self._controls if not c.field.unfillable]
|
|
220
228
|
return self._fields
|
|
221
229
|
|
|
@@ -236,6 +244,24 @@ class Eightfold:
|
|
|
236
244
|
continue
|
|
237
245
|
_fill(page, control, answer)
|
|
238
246
|
given[control.field.id] = answer
|
|
247
|
+
self._again(page, given)
|
|
248
|
+
|
|
249
|
+
def _again(self, page: Page, given: dict[str, Answer]) -> None:
|
|
250
|
+
"""Fills once more an answered control a later render emptied."""
|
|
251
|
+
placed = [c for c in self._controls if c.dom and given.get(c.field.id)]
|
|
252
|
+
values = self._values(page, placed)
|
|
253
|
+
for control in placed:
|
|
254
|
+
if not values.get(control.field.id):
|
|
255
|
+
_fill(page, control, given[control.field.id])
|
|
256
|
+
|
|
257
|
+
def shown_fields(self, page: Page) -> list[str]:
|
|
258
|
+
"""The questions rendered once filled, each control's by the longest question id its
|
|
259
|
+
element id ends with; one no question's id ends as the page names it."""
|
|
260
|
+
shown: dict[str, None] = {}
|
|
261
|
+
for dom in page.evaluate(_SHOWN):
|
|
262
|
+
ends = [end for end in self._ends if dom == end or dom.endswith(f"_{end}")]
|
|
263
|
+
shown[self._ends[max(ends, key=len)] if ends else dom] = None
|
|
264
|
+
return list(shown)
|
|
239
265
|
|
|
240
266
|
def read_back(self, page: Page) -> dict[str, Answer]:
|
|
241
267
|
unplaced = [[c.field.id, c.ends] for c in self._controls if c.dom is None]
|
|
@@ -456,18 +482,49 @@ def _pick(page: Page, combo, value: str, exact: bool) -> None:
|
|
|
456
482
|
if not option.count():
|
|
457
483
|
page.keyboard.press("Escape")
|
|
458
484
|
raise NotTaken(f"no option {value!r}")
|
|
459
|
-
option
|
|
485
|
+
_choose(page, combo, option)
|
|
486
|
+
|
|
487
|
+
|
|
488
|
+
def _choose(page: Page, combo, option) -> None:
|
|
489
|
+
"""Clicks a combobox's option and waits for its list to close and the combobox to take the
|
|
490
|
+
focus back: typed before that, the next answer lands in the combobox. A list still open over
|
|
491
|
+
an unchanged combobox lost the click, so the option is clicked again; clicked once it took,
|
|
492
|
+
it would clear. A list that stays open is dismissed, as it lies over the next control, for
|
|
493
|
+
the read-back to catch what the combobox holds."""
|
|
494
|
+
listbox = page.locator(f"[id={json.dumps(combo.get_attribute('aria-controls'))}]")
|
|
495
|
+
held = combo.input_value()
|
|
496
|
+
for _ in range(PICK_CLICKS):
|
|
497
|
+
with suppress(Timeout):
|
|
498
|
+
option.click(timeout=LIST_CLOSE_TIMEOUT_MS)
|
|
499
|
+
listbox.wait_for(state="hidden", timeout=LIST_CLOSE_TIMEOUT_MS)
|
|
500
|
+
if listbox.is_hidden():
|
|
501
|
+
with suppress(Timeout):
|
|
502
|
+
page.wait_for_function(
|
|
503
|
+
"el => document.activeElement === el",
|
|
504
|
+
arg=combo.element_handle(),
|
|
505
|
+
timeout=FOCUS_TIMEOUT_MS,
|
|
506
|
+
)
|
|
507
|
+
return
|
|
508
|
+
if combo.input_value() != held:
|
|
509
|
+
break
|
|
510
|
+
combo.press("Escape")
|
|
460
511
|
|
|
461
512
|
|
|
462
513
|
def _phone(page: Page, box, value: str) -> None:
|
|
463
514
|
"""Picks the country code the number starts with, the longest that fits, then types the
|
|
464
|
-
rest of the number. Where several countries share it, its main country.
|
|
515
|
+
rest of the number. Where several countries share it, its main country. One already showing
|
|
516
|
+
a code that fits stays: clicking the selected option clears it."""
|
|
465
517
|
digits = re.sub(r"\D", "", value)
|
|
466
518
|
combo = box.locator("input[role=combobox]").first
|
|
467
519
|
number = box.locator("input:not([role=combobox])").first
|
|
468
520
|
if not value.startswith("+"):
|
|
469
521
|
number.fill(value)
|
|
470
522
|
return
|
|
523
|
+
if (held := DIAL.search(combo.input_value())) and digits.startswith(
|
|
524
|
+
code := held[1].replace(" ", "")
|
|
525
|
+
):
|
|
526
|
+
number.fill(digits[len(code) :])
|
|
527
|
+
return
|
|
471
528
|
_click(combo)
|
|
472
529
|
options = page.locator(f"[id={json.dumps(combo.get_attribute('aria-controls'))}] [role=option]")
|
|
473
530
|
options.first.wait_for(timeout=OPTIONS_TIMEOUT_MS)
|
|
@@ -481,7 +538,7 @@ def _phone(page: Page, box, value: str) -> None:
|
|
|
481
538
|
number.fill(digits)
|
|
482
539
|
return
|
|
483
540
|
_, _, i, code = max(fits)
|
|
484
|
-
options.nth(-i)
|
|
541
|
+
_choose(page, combo, options.nth(-i))
|
|
485
542
|
number.fill(digits[len(code) :])
|
|
486
543
|
|
|
487
544
|
|
|
@@ -11,13 +11,14 @@ import re
|
|
|
11
11
|
import time
|
|
12
12
|
import urllib.request
|
|
13
13
|
from contextlib import suppress
|
|
14
|
+
from dataclasses import replace
|
|
14
15
|
from typing import Any
|
|
15
16
|
from urllib.parse import parse_qs, urlencode, urlsplit
|
|
16
17
|
|
|
17
18
|
from atsfill.core import browser, otp
|
|
18
19
|
from atsfill.core.adapter import Blocked, Gap, Unsupported
|
|
19
20
|
from atsfill.core.browser import HTTP_TIMEOUT_S, BrowserError, Page, Timeout
|
|
20
|
-
from atsfill.core.results import Answer, Field, FieldType, SideEffect
|
|
21
|
+
from atsfill.core.results import Answer, Field, FieldType, Is, SideEffect
|
|
21
22
|
|
|
22
23
|
HOSTS = re.compile(r"^(job-boards|boards)(\.eu)?\.greenhouse\.io$")
|
|
23
24
|
FORM = "#application-form"
|
|
@@ -29,6 +30,7 @@ EDUCATION_API = "https://boards-api.greenhouse.io/v1/boards/{board}/education/{k
|
|
|
29
30
|
EMBED = "https://job-boards.greenhouse.io/embed/job_app"
|
|
30
31
|
EMBED_TIMEOUT_MS = 15_000
|
|
31
32
|
OPTIONS_TIMEOUT_MS = 3_000
|
|
33
|
+
RACE_TIMEOUT_MS = 3_000
|
|
32
34
|
HYDRATE_TIMEOUT_MS = 15_000
|
|
33
35
|
FORM_TIMEOUT_MS = 20_000
|
|
34
36
|
ANSWER_TIMEOUT_MS = 15_000 # an upload's file name, a suggestion: past it, a mismatch
|
|
@@ -52,6 +54,7 @@ OTP_ERROR = "#email-verification-error"
|
|
|
52
54
|
# Sections the page adds or names its own way, or shows a question of only on another answer
|
|
53
55
|
# (EEOC race after Hispanic/Latino): `request_read` declines a posting with any (ADR 0011).
|
|
54
56
|
UNMAPPED = ("education", "compliance", "demographic_questions")
|
|
57
|
+
ETHNICITY, NOT_HISPANIC, RACE = "hispanic_ethnicity", "No", "race"
|
|
55
58
|
|
|
56
59
|
# The fields in page order. A select's options are read by opening it, from Python.
|
|
57
60
|
_READ = """form => {
|
|
@@ -196,10 +199,11 @@ class Greenhouse:
|
|
|
196
199
|
fields = [self._field(page, raw) for raw in raws]
|
|
197
200
|
self._fields = {f.id: f for f in fields}
|
|
198
201
|
self._kinds = {raw["id"]: raw["kind"] for raw in raws}
|
|
199
|
-
return fields
|
|
202
|
+
return self._with_race(page, fields)
|
|
200
203
|
|
|
201
204
|
def fill(self, page: Page, answers: dict[str, Answer]) -> None:
|
|
202
|
-
|
|
205
|
+
# the page draws race only once the answer to Hispanic/Latino is in
|
|
206
|
+
for field_id, answer in sorted(answers.items(), key=lambda a: a[0] == RACE):
|
|
203
207
|
values = [answer] if isinstance(answer, str) else answer
|
|
204
208
|
match self._kinds[field_id]:
|
|
205
209
|
case "file":
|
|
@@ -235,6 +239,9 @@ class Greenhouse:
|
|
|
235
239
|
case _:
|
|
236
240
|
page.locator(_by_id(field_id)).fill(values[0])
|
|
237
241
|
|
|
242
|
+
def shown_fields(self, page: Page) -> list[str]:
|
|
243
|
+
return [raw["id"] for raw in page.locator(FORM).evaluate(_READ)]
|
|
244
|
+
|
|
238
245
|
def read_back(self, page: Page) -> dict[str, Answer]:
|
|
239
246
|
values = page.locator(FORM).evaluate(_READ_BACK, list(self._fields))
|
|
240
247
|
return {k: v for k, v in values.items() if v not in (None, "", [])}
|
|
@@ -295,6 +302,30 @@ class Greenhouse:
|
|
|
295
302
|
one_of=raw.get("oneOf"),
|
|
296
303
|
)
|
|
297
304
|
|
|
305
|
+
def _with_race(self, page: Page, fields: list[Field]) -> list[Field]:
|
|
306
|
+
"""`fields` with the EEOC race question, a follow-up of Hispanic/Latino: its page's own
|
|
307
|
+
label and options show only with the question, so the read answers No, reads it and
|
|
308
|
+
clears the answer. The API's options are not the page's."""
|
|
309
|
+
ethnicity = self._fields.get(ETHNICITY)
|
|
310
|
+
if (
|
|
311
|
+
RACE in self._fields
|
|
312
|
+
or ethnicity is None
|
|
313
|
+
or NOT_HISPANIC not in (ethnicity.options or [])
|
|
314
|
+
):
|
|
315
|
+
return fields
|
|
316
|
+
_select(page, ETHNICITY, NOT_HISPANIC, False)
|
|
317
|
+
with suppress(Timeout):
|
|
318
|
+
page.locator(_by_id(RACE)).wait_for(timeout=RACE_TIMEOUT_MS)
|
|
319
|
+
raws = page.locator(FORM).evaluate(_READ)
|
|
320
|
+
raw = next((r for r in raws if r["id"] == RACE), None)
|
|
321
|
+
if raw is not None:
|
|
322
|
+
race = replace(self._field(page, raw), shown_when=Is(ETHNICITY, [NOT_HISPANIC]))
|
|
323
|
+
self._fields[RACE], self._kinds[RACE] = race, raw["kind"]
|
|
324
|
+
fields = [*fields]
|
|
325
|
+
fields.insert(fields.index(ethnicity) + 1, race)
|
|
326
|
+
_clear(page, ETHNICITY)
|
|
327
|
+
return fields
|
|
328
|
+
|
|
298
329
|
def _education(self, page: Page, field_id: str) -> list[str] | None:
|
|
299
330
|
"""An education select's options, every page of them, read once per kind; None for
|
|
300
331
|
another field or when the endpoint does not answer."""
|
|
@@ -429,6 +460,14 @@ def _exact(value: str) -> re.Pattern[str]:
|
|
|
429
460
|
return re.compile(rf"^\s*{re.escape(value)}\s*$")
|
|
430
461
|
|
|
431
462
|
|
|
463
|
+
def _clear(page: Page, field_id: str) -> None:
|
|
464
|
+
"""Empties a single react-select."""
|
|
465
|
+
box = page.locator(_by_id(field_id))
|
|
466
|
+
box.click()
|
|
467
|
+
box.press("Backspace")
|
|
468
|
+
box.press("Escape")
|
|
469
|
+
|
|
470
|
+
|
|
432
471
|
def _select(page: Page, field_id: str, value: str, suggested: bool) -> None:
|
|
433
472
|
"""Types into a react-select and picks the option: focused with the arrow keys then Enter,
|
|
434
473
|
which every select takes (a hover does not move the focus once typed). A suggestion list
|