diff --git a/content/mentoring/_index.md b/content/mentoring/_index.md
index 6c798b5e..0c39f8de 100644
--- a/content/mentoring/_index.md
+++ b/content/mentoring/_index.md
@@ -12,14 +12,13 @@ aliases = ["pro", "mentorship"]
and Ship Better Rust
-For experienced engineers moving from Python, Go, or another language into serious Rust work. Bring your project or codebase and learn how to make sound design, architecture, and code-review decisions yourself.
+For experienced engineers moving from Python, Go, C++, or another language into serious Rust work. Bring your project or codebase and learn how to make sound design, architecture, and code-review decisions yourself.
-We'll talk about your Rust work and decide whether I can help. No obligation or sales pressure.
+Start with a short inquiry. If I think I can help, I'll invite you to a free 30-minute intro call.
@@ -44,7 +43,37 @@ For experienced engineers moving from Python, Go, or another language into serio
+
+
+
+
+
+
Your Mentoring Journey
+
+
+Tell Me About Your Goals
+Share your background, what you'd like to achieve, and the time you have available in the form below. I'll review your answers and, if I think I can help, invite you to a free 30-minute intro call. We'll use that time to discuss your goals and decide whether working together makes sense.
+
+
+Make a Plan
+We turn your goals into a plan around your project and experience. Together, we choose what to tackle first and set a regular session schedule that gives you time to apply what you learn. We agree on the scope and pricing before you commit.
+
+
+Work Through Real Problems
+We typically meet every two or three weeks to discuss your Rust work.
+ Bring a pull request, architecture questions, or a piece of code you'd like feedback on. We'll discuss your questions and pair-program together. You leave with a clearer understanding and concrete next steps.
+
+
+Achieve Your Goals
+
+ Whether your goal is to find a Rust job, ship an ambitious project, or become better at reviewing Rust code, you'll leave with the mental models and a process for putting your knowledge into practice. What you learn will stay with you throughout your career.
+
+
+
+
@@ -90,14 +119,14 @@ I host the Rust in Production Podcast , where I've had mor
-
We'll Work on what matters to you
+
We'll Work on What Matters to You
Recognize Good Rust
@@ -123,110 +152,7 @@ I host the Rust in Production Podcast , where I've had mor
-
-
-
Why Work With a Mentor?
-
You can read documentation to learn the syntax, but mentoring helps you build the judgment to make decisions with confidence.
-
-
-
-Comparison of self-directed learning and personal mentoring
-
-
-Capability
-Self-Directed
-Personal Mentoring
-
-
-
-
-
-Resolve difficult implementation decisions
-Trial and error
-✓
-
-
-Compare architecture trade-offs
-✗
-✓
-
-
-Get direct feedback on code and design
-✗
-✓
-
-
-Build a repeatable review process
-✗
-✓
-
-
-Recognize your knowledge gaps
-✗
-✓
-
-
-
-
-
-
-
-
-
-
Start Making Real Progress With Rust
-
Pick the session package that fits your project and goals. All sessions are live and 1-on-1. We work directly on your code and decisions.
-
-
-
-Once::new()
-€200 /session
-1 session · 60 minutes
-
-Pick one design, review, or implementation problem
-Work directly in the context of your code and goals
-Clear next steps you can continue independently
-
-Book a Single Session
-Not sure yet? Book a free call .
-
-
-
-Recommended
-[Session; 5]
-€900 / 5 sessions
-€180/session · save €100 · valid 3 months
-
-Five live 1-on-1 sessions around your concrete goal
-A clear direction for your project and learning priorities
-Repeated design, implementation, and review cycles
-Brief questions by chat or email between sessions
-
-Buy the 5-Session Package
-Not sure yet? Book a free call .
-
-
-
-Vec::with_capacity(10)
-€1700 / 10 sessions
-€170/session · save €300 · valid 6 months
-
-Ten live 1-on-1 sessions for a larger system or transition
-Deeper architecture and code-review continuity
-Room for testing, async, performance, or operations work
-Brief questions by chat or email between sessions
-A long-term plan for owning the codebase confidently
-
-Buy the 10-Session Package
-Not sure yet? Book a free call .
-
-
-
-
-
-
+{{ }}
@@ -235,69 +161,38 @@ I host the
Rust in Production Podcast , where I've had mor
{%
%}
[
{
- "q": "Is this for me?",
- "a": "This mentoring is designed for experienced engineers who already know how to build software and now have a real Rust project, codebase, or review responsibility. It is especially useful when your experience comes from Python, Go, Java, C++, or another language whose familiar patterns do not translate directly to Rust. If you need organization-wide adoption support, team consulting and training are a better fit."
- },
- {
- "q": "What happens on the free call?",
- "a": "We'll talk about your background, your current Rust work, and the decisions or skills you want to improve. I'll explain how I work and tell you honestly whether mentoring, a single session, a free resource, or a different kind of help makes the most sense. There is no obligation and no sales pressure."
+ "q": "Is this right for my experience level?",
+ "a": "This is for experienced software engineers who want to get better at working with Rust. You might be moving from Python, Go, C++, or another language, or already using Rust and looking for feedback on your design and code-review decisions. For organization-wide support, see my team consulting and training ."
},
{
"q": "Do I need an existing Rust project?",
- "a": "A real project or codebase is ideal because it gives our work context, but it is not mandatory. We can choose a realistic project or use a design and review exercise based on the kind of Rust work you expect to do."
- },
- {
- "q": "Can I use AI during mentoring?",
- "a": "Yes. AI can generate Rust quickly, but the difficult part is deciding whether the types, boundaries, dependencies, async behavior, and failure modes belong in a production system. We'll use tools where they help while strengthening the mental models you need to direct and review them. The goal is for you to remain responsible for the design."
- },
- {
- "q": "What outcomes should I expect?",
- "a": "You should leave sessions with clearer mental models, concrete next steps, and a stronger process for making and reviewing Rust decisions. The goal is not dependence on a mentor; it is becoming able to explain the architecture, review the diff, and handle the next implementation with less help."
+ "a": "No. Your own project gives us useful context, but we can also choose a realistic project or work through design and review exercises based on the kind of Rust work you want to do."
},
{
- "q": "What does a session look like?",
- "a": "You set the agenda with my help. We might pair in your repository, review a pull request, compare architecture options, read library or standard-library source, or draw a design. I ask questions and explain trade-offs so that you leave understanding the decision rather than merely copying a fix."
+ "q": "What can I expect from a session?",
+ "a": "We work on a concrete problem that matters to you: pairing in your repository, reviewing a pull request, or comparing architecture options. I ask questions and explain trade-offs rather than just fixing the code for you. You leave with concrete next steps and an understanding you can apply to the next problem."
},
{
- "q": "Which option should I start with?",
- "a": "Choose a single session for one problem or to try the working style. Five sessions are the recommended path when you have a concrete project goal and want repeated implementation and review cycles. Ten sessions make sense for a larger system or a longer transition into serious Rust work."
+ "q": "How often do we meet, and will it fit my schedule?",
+ "a": "We typically meet every two or three weeks, with time between sessions to apply what you learn. I'm based in Germany and usually work during European business hours, but we can discuss other time zones on the intro call. If you need to reschedule a session, just let me know."
},
{
- "q": "What if I can't make a scheduled session?",
- "a": "Life happens. Just let me know and we'll move your session to another slot. The 5-session block is valid for 3 months, and the 10-session block for 6 months, so there's plenty of flexibility."
+ "q": "How much does mentoring cost?",
+ "a": "The intro call is free. We'll discuss your goals and agree on the scope, session schedule, and pricing before you commit to paid mentoring. You don't need to choose or buy a package before we talk."
},
{
- "q": "How do I know you're the right mentor?",
- "a": "That's what the intro call is for. We'll talk, you'll get a feel for my style, and we'll both know if it's a good fit. You can also watch this video beforehand to see if you like the way I work. And if after the first paid session it doesn't feel right, I'll refund you."
+ "q": "Can my employer pay for mentoring?",
+ "a": "Yes. I provide business invoices and can describe the learning goals for your manager. If you have a professional development budget, mention it on the intro call."
},
{
- "q": "What timezone do you work in?",
- "a": "I'm based in D\u00fcsseldorf, Germany (CET/UTC+1). I prefer to schedule sessions during European business hours, but I'm flexible to accommodate other timezones when possible. Some people prefer code reviews via Loom videos, which allows for more asynchronous communication. Please reach out to clarify the details."
+ "q": "What if mentoring isn't a good fit?",
+ "a": "The intro call gives us both a chance to find out whether working together makes sense, with no obligation to continue. If after your first paid session you don't feel it's a good fit, I'll refund you."
},
{
- "q": "Do you offer refunds?",
- "a": "My goal is your success, not trapping you in a contract. If after your first session you don't feel it's a good fit, I'll refund you."
- },
- {
- "q": "How do I schedule the five sessions?",
- "a": "After purchasing the package, you'll receive a personal booking link by email. Use the same link whenever you're ready to schedule your next session. You can choose each date separately and use all five sessions at your own pace within three months."
- },
- {
- "q": "How does payment work?",
- "a": "You pay upfront for your session package via Stripe. After payment, I'll email you a personal link for booking the included sessions individually. You'll receive a receipt from Stripe; contact me if you also need an invoice for professional development expenses. Unused sessions are refunded if things don't work out."
+ "q": "How do I get started?",
+ "a": "Fill out the short inquiry form above with your background, goals, and availability. I'll review your answers and reply by email. If I think I can help, I'll invite you to a free 30-minute intro call to discuss fit, expectations, and next steps. There's no obligation to continue."
}
]
{% %}
-
-
-
-
A Clear Plan for Moving Forward With Rust
-
We'll use the free call to understand the problem and decide on the next steps.
-
-
-
-
diff --git a/sass/_mentorship.scss b/sass/_mentorship.scss
index 247d1d81..3f6b7b21 100644
--- a/sass/_mentorship.scss
+++ b/sass/_mentorship.scss
@@ -151,6 +151,63 @@
flex-wrap: wrap;
}
+.pro-timeline {
+ list-style: none;
+ max-width: 620px;
+ margin: 2.5rem auto;
+ padding: 0;
+ text-align: left;
+
+ li {
+ position: relative;
+ margin: 0;
+ padding: 0 0 2rem 2rem;
+ border-left: 2px solid rgba(255, 255, 255, 0.2);
+
+ &::before {
+ content: "";
+ position: absolute;
+ top: 0.35rem;
+ left: -7px;
+ width: 12px;
+ height: 12px;
+ border-radius: 50%;
+ background: $brightBgrd;
+ }
+
+ &:last-child {
+ padding-bottom: 0;
+ border-color: transparent;
+ }
+ }
+
+ h3 {
+ display: flex;
+ align-items: flex-start;
+ gap: 0.65rem;
+ margin: 0 0 0.5rem;
+ color: white;
+ font-size: clamp(1.5rem, 3vw, 2rem);
+ line-height: 1.3;
+ }
+
+ .pro-timeline-icon {
+ flex: 0 0 auto;
+ width: 1.5rem;
+ height: 1.5rem;
+ margin-top: 0.15em;
+ color: $brightBgrd;
+ }
+
+ p {
+ margin: 0;
+ // Align with the heading text after its icon and gap.
+ padding-inline-start: calc(1.5rem + 0.65rem);
+ color: rgba(255, 255, 255, 0.85);
+ line-height: 1.6;
+ }
+}
+
// Buttons
.pro-btn {
display: inline-block;
@@ -173,29 +230,6 @@
}
}
-.pro-btn-secondary {
- background: transparent;
- color: rgba(255, 255, 255, 0.85);
- border-color: rgba(255, 255, 255, 0.2);
- font-size: 1rem;
-
- &:hover {
- color: white;
- border-color: rgba(255, 255, 255, 0.4);
- background: rgba(255, 255, 255, 0.05);
- }
-}
-
-.pro-btn-full {
- display: flex;
- align-items: center;
- justify-content: center;
- width: 100%;
- height: 6.25rem;
- margin-top: 2rem;
- text-align: center;
-}
-
// Content Sections
.pro-section {
display: flex;
@@ -238,6 +272,8 @@
.pro-section-title {
color: white;
+ font-size: clamp(2rem, 4vw, 3rem);
+ line-height: 1.2;
text-align: center;
&::after {
@@ -253,6 +289,48 @@
margin: 0 auto 4rem;
}
+.pro-page .pro-mentoring-inquiry {
+ width: 100%;
+ box-sizing: border-box;
+ padding: clamp(1.5rem, 5vw, 3.5rem);
+ text-align: left;
+ color: rgba(255, 255, 255, 0.85);
+
+ .pro-section-title {
+ margin-top: 0;
+ }
+
+ .pro-section-subtitle {
+ margin-bottom: 0;
+ }
+
+
+ .pro-hero-note {
+ margin-bottom: 0;
+ }
+
+ form {
+ margin-top: 2rem;
+ }
+
+ input:not([type="hidden"]), textarea, select {
+ box-sizing: border-box;
+ background: $brightPrim;
+ color: white;
+ border-color: rgba(255, 255, 255, 0.4);
+ color-scheme: dark;
+ }
+
+ :focus-visible {
+ outline-color: $brightBgrd;
+ }
+
+ button {
+ max-width: 100%;
+ white-space: normal;
+ }
+}
+
.pro-subtitle-wide {
max-width: 800px;
margin: 0 auto 3rem;
@@ -331,125 +409,6 @@
}
}
-// Pricing Cards
-.pro-pricing {
- display: flex;
- gap: 1.5rem;
- margin-top: 2rem;
- justify-content: center;
- flex-wrap: wrap;
-}
-
-.pro-price-card {
- display: flex;
- flex-direction: column;
- background: rgba(255, 255, 255, 0.03);
- border: 1px solid rgba(255, 255, 255, 0.1);
- border-radius: 8px;
- padding: 4rem 3.5rem;
- position: relative;
- flex: 1;
- min-width: 360px;
- max-width: 480px;
- text-align: left;
- box-shadow:
- 0 4px 6px rgba(0, 0, 0, 0.3),
- 0 10px 20px rgba(0, 0, 0, 0.2);
-
- &.featured {
- background: linear-gradient(
- 135deg,
- rgba($brightBgrd, 0.1),
- rgba($brightScnd, 0.1)
- );
- border-color: rgba($brightBgrd, 0.3);
- box-shadow:
- 0 8px 16px rgba(0, 0, 0, 0.4),
- 0 20px 40px rgba(0, 0, 0, 0.3),
- 0 0 30px rgba($brightBgrd, 0.15);
- }
-}
-
-.pro-price-badge {
- position: absolute;
- top: -12px;
- left: 50%;
- transform: translateX(-50%);
- background: $brightBgrd;
- color: $heroDark;
- padding: 0.25rem 1rem;
- border-radius: 50px;
- font-size: 0.75rem;
- margin: 0;
- font-weight: 700;
- text-transform: uppercase;
- letter-spacing: 1px;
-}
-
-.pro-price-note {
- text-align: center;
- color: rgba(255, 255, 255, 0.72);
- font-size: 0.875rem;
- margin-top: 1rem;
-}
-
-.pro-price-name {
- font-family: "Bebas Neue", sans-serif;
- font-size: 1.75rem;
- font-weight: 600;
- margin-bottom: 0.5rem;
- color: white;
-
- code {
- font-family: monospace;
- word-break: break-all;
- overflow-wrap: break-word;
- font-size: 1.5rem;
- }
-}
-
-.pro-price-amount {
- font-size: 3rem;
- font-weight: 700;
- color: $brightBgrd;
- margin: 0 0 0.5rem;
-
- span {
- font-size: 1.25rem;
- color: rgba(255, 255, 255, 0.72);
- }
-}
-
-
-.pro-price-context {
- color: $brightBgrd;
- font-size: 0.85rem;
- margin-bottom: 1.5rem;
- font-weight: 500;
-}
-
-.pro-price-features {
- flex: 1;
- list-style: none;
- padding: 0;
- margin: 2rem 0;
-
- li {
- padding: 0.75rem 0;
- color: rgba(255, 255, 255, 0.9);
- display: flex;
- align-items: flex-start;
- gap: 0.75rem;
-
- &::before {
- content: "✓";
- color: $brightBgrd;
- font-weight: 700;
- flex-shrink: 0;
- }
- }
-}
-
.pro-value-content {
display: flex;
flex-direction: column;
@@ -494,15 +453,6 @@
.pro-testimonials + .pro-section-cta {
margin-top: 3rem;
}
-
-.pro-cta-buttons {
- display: flex;
- gap: 1rem;
- justify-content: center;
- margin-top: 3rem;
- flex-wrap: wrap;
-}
-
// Link styling for pro sections
.pro-section {
a:not(.pro-btn) {
@@ -534,92 +484,6 @@
}
-// Comparison table
-.pro-comparison-table {
- display: table;
- width: 100%;
- max-width: 700px;
- margin: 2rem auto 0;
- border-collapse: collapse;
-
- th,
- td {
- padding: 1rem;
- border-bottom: 0;
- }
-
- thead tr {
- border-bottom: 2px solid rgba($brightBgrd, 0.3);
- }
-
- thead th {
- color: $brightBgrd;
- font-size: 1rem;
- font-weight: 600;
- text-align: center;
-
- &:first-child {
- text-align: left;
- }
-
- &.muted {
- color: rgba(255, 255, 255, 0.72);
- }
- }
-
- tbody tr {
- border-bottom: 1px solid rgba(255, 255, 255, 0.1);
-
- &:last-child {
- border-bottom: none;
- }
- }
-
- tbody th,
- td {
- color: rgba(255, 255, 255, 0.95);
- }
-
- tbody th {
- font-weight: 600;
- text-align: left;
- }
-
- td {
- text-align: center;
-
- &.highlight {
- display: table-cell;
- margin: 0;
- padding: 1rem;
- background: transparent;
- clip-path: none;
- color: $brightBgrd;
- transform: none;
- }
-
- &.muted {
- color: rgba(255, 255, 255, 0.6);
- }
- }
-}
-
-// Pricing section note
-.pro-pricing-footer {
- margin-top: 3rem;
- color: rgba(255, 255, 255, 0.85);
- font-size: 1.125rem;
- text-align: center;
-
- p {
- margin: 0;
- }
-
- p + p {
- margin-top: 1rem;
- }
-}
-
// Footer - apply dark styling on pro page
.pro-page .footer {
background-color: $brightPrim;
@@ -731,77 +595,6 @@
font-size: 1rem;
}
- // Comparison table
- .pro-comparison-wrapper {
- overflow-x: auto;
- -webkit-overflow-scrolling: touch;
- }
-
- .pro-comparison-table {
- th,
- td {
- padding: 0.5rem 0.4rem;
- font-size: 0.75rem;
- white-space: normal;
- word-break: normal;
- overflow-wrap: break-word;
- }
-
- tbody th {
- width: 45%;
- }
- }
-
- // Pricing
- .pro-pricing {
- flex-direction: column;
- align-items: stretch;
- margin-top: 3rem;
- gap: 1.25rem;
- }
-
- .pro-price-card {
- min-width: 0;
- max-width: 100%;
- padding: 2rem 1.5rem;
- margin: 0;
- }
-
- .pro-price-amount {
- font-size: 2.25rem;
-
- span {
- font-size: 1rem;
- }
- }
-
- .pro-price-name {
- font-size: 1.4rem;
-
- code {
- font-size: 1.1rem;
- word-break: normal;
- overflow-wrap: normal;
- }
- }
-
- .pro-pricing-footer {
- font-size: 0.95rem;
- margin-top: 2rem;
- text-align: left;
- }
-
- // CTA section
- .pro-cta-buttons {
- flex-direction: column;
- gap: 0.75rem;
-
- .pro-btn {
- width: 100%;
- text-align: center;
- }
- }
-
// Buttons general
.pro-btn {
padding: 0.875rem 1.5rem;
diff --git a/scripts/test-inquiry.py b/scripts/test-inquiry.py
index 7c4227f0..f720a570 100644
--- a/scripts/test-inquiry.py
+++ b/scripts/test-inquiry.py
@@ -10,7 +10,7 @@
import argparse
from pathlib import Path
-from urllib.parse import urlparse
+from urllib.parse import parse_qs, urlparse
from playwright.sync_api import sync_playwright, expect
@@ -41,6 +41,123 @@ def fill(page):
field.fill(value)
+mentoring_payload = {
+ "inquiryType": "mentoring",
+ "name": "Test Person",
+ "email": "test@example.com",
+ "background": "Python engineer building my first Rust service.",
+ "goals": "Learn to review ownership and API design decisions.",
+ "support": "Ongoing mentoring",
+ "availability": "Europe/Berlin, Tuesday afternoons.",
+}
+
+
+def fill_mentoring(page):
+ for name, value in mentoring_payload.items():
+ field = page.locator(f'#inquiry-form [name="{name}"]')
+ if name == "inquiryType":
+ expect(field).to_have_attribute("type", "hidden")
+ expect(field).to_have_value(value)
+ elif name == "support":
+ field.select_option(label=value)
+ else:
+ field.fill(value)
+
+
+def test_mentoring(page, width, theme, submissions, mode, held):
+ page.goto("http://inquiry.test/mentoring/", wait_until="load")
+ links = page.locator("main a.pro-btn")
+ assert links.count() > 0
+ for link in links.all():
+ expect(link).to_have_text("Get Rust Mentoring")
+ expect(link).to_have_attribute("href", "#contact")
+ fits(page, "main a.pro-btn", width)
+ links.first.click()
+ assert page.url.endswith("/mentoring/#contact")
+ assert page.locator('script[src="/services/inquiry.js"]').count() == 1
+ form = page.locator("#inquiry-form")
+ expect(form).to_be_visible()
+ expect(form).to_have_attribute("action", endpoint)
+ assert form.get_attribute("method").lower() == "post"
+ assert form.locator("input, textarea, select").count() == 7
+ button = form.get_by_role("button", name="Send mentoring inquiry", exact=True)
+ before = len(submissions)
+ submit_form(button)
+ assert len(submissions) == before
+ fill_mentoring(page)
+ for name in ["name", "email", "background", "goals", "support", "availability"]:
+ field = form.locator(f'[name="{name}"]')
+ expect(field).to_have_attribute("required", "")
+ if name == "support":
+ assert field.evaluate("el => el.tagName") == "SELECT"
+ options = field.locator("option").evaluate_all(
+ "options => options.filter(o => o.value).map(o => o.textContent.trim())"
+ )
+ assert options == ["Ongoing mentoring", "Help with a specific problem", "Not sure yet"]
+ for option in options:
+ field.select_option(label=option)
+ expect(field).to_have_value(option)
+ field.select_option("")
+ else:
+ if name in ["background", "goals", "availability"]:
+ assert field.evaluate("el => el.tagName") == "TEXTAREA"
+ field.fill("")
+ submit_form(button)
+ assert len(submissions) == before
+ assert not field.evaluate("el => el.checkValidity()")
+ fill_mentoring(page)
+ form.locator('[name="email"]').fill("invalid-email")
+ submit_form(button)
+ assert len(submissions) == before
+ fill_mentoring(page)
+ fits(page, "#contact input, #contact textarea, #contact select, #contact button", width)
+ assert page.evaluate("document.documentElement.scrollWidth <= window.innerWidth")
+ assert form.locator('[name="email"]').evaluate("el => parseFloat(getComputedStyle(el).fontSize)") >= 16
+ if width in [390, 1280]:
+ page.locator("#contact").screenshot(path=str(root / f"mentoring-inquiry-{width}-{theme}.png"))
+
+ for failure in ["failure", "offline"]:
+ mode["value"] = failure
+ submit_form(button)
+ expect(page.locator("#inquiry-status")).to_contain_text("couldn't confirm")
+ expect(form).to_be_visible()
+ expect(page.locator("#inquiry-success")).to_be_hidden()
+ expect(button).to_be_enabled()
+ assert page.evaluate("document.activeElement.id") == "inquiry-status"
+ assert submissions[-1] == mentoring_payload
+ for name, value in mentoring_payload.items():
+ expect(form.locator(f'[name="{name}"]')).to_have_value(value)
+
+ mode["value"] = "pending"
+ before = len(submissions)
+ submit_form(button)
+ expect(button).to_be_disabled()
+ expect(form).to_have_attribute("aria-busy", "true")
+ expect(page.locator("#inquiry-success")).to_be_hidden()
+ expect(page.locator("#inquiry-status")).to_contain_text("Sending")
+ page.evaluate("document.getElementById('inquiry-form').requestSubmit()")
+ # Flush browser work while the first response remains held by the mock.
+ page.wait_for_timeout(100)
+ assert len(submissions) == before + 1
+ assert len(held) == 1
+ assert submissions[-1] == mentoring_payload
+ held.pop().fulfill(status=200, content_type="application/json", body="{}")
+ expect(form).to_be_hidden()
+ expect(page.locator("#inquiry-success")).to_be_visible()
+ assert page.evaluate("document.activeElement.id") == "inquiry-success"
+ assert page.evaluate("history.state") is None
+ print(f"PASS: mentoring {width}px {theme}: CTAs, required fields, validation, failure/retry, pending/double-submit, success/focus, layout")
+
+
+def submit_form(button):
+ # Keyboard activation avoids Playwright's frame-based click stability wait,
+ # which can stall in the cached headless Chromium build.
+ # Unlike form.submit(), Enter still runs native constraint validation.
+ expect(button).to_be_visible()
+ expect(button).to_be_enabled()
+ button.press("Enter")
+
+
def fits(page, selector, width):
for box in page.locator(selector).all():
if box.is_visible():
@@ -98,11 +215,11 @@ def serve(route):
form = page.locator("#inquiry-form")
button = form.get_by_role("button", name="Send inquiry", exact=True)
- button.click()
+ submit_form(button)
assert not submissions
fill(page)
form.locator('[name="email"]').fill("invalid-email")
- button.click()
+ submit_form(button)
assert not submissions
form.locator('[name="email"]').fill(payload["email"])
assert form.locator("input, textarea, select").count() == 6
@@ -113,7 +230,7 @@ def serve(route):
for failure in ["failure", "offline"]:
mode["value"] = failure
- button.click()
+ submit_form(button)
expect(page.locator("#inquiry-status")).to_contain_text("couldn't confirm")
expect(form).to_be_visible()
expect(page.locator("#inquiry-success")).to_be_hidden()
@@ -124,7 +241,7 @@ def serve(route):
mode["value"] = "pending"
before = len(submissions)
- button.click()
+ submit_form(button)
expect(button).to_be_disabled()
expect(page.locator("#inquiry-success")).to_be_hidden()
page.evaluate("document.getElementById('inquiry-form').requestSubmit()")
@@ -152,10 +269,49 @@ def native_submit(route):
route.fulfill(content_type="text/html", body="Provider confirmation (test) ")
context.route(endpoint, native_submit)
- page.locator('#inquiry-form button').click()
+ submit_form(page.locator('#inquiry-form button'))
expect(page.get_by_role("heading", name="Provider confirmation (test)")).to_be_visible()
assert captured and "email=test%40example.com" in captured[0]
print("PASS: no-JavaScript native POST; provider response mocked, not live delivery")
context.close()
+
+ for width in [320, 390, 768, 1280]:
+ for theme in ["light", "dark"]:
+ context = browser.new_context(viewport={"width": width, "height": 844}, color_scheme=theme, service_workers="block")
+ submissions = []
+ mode = {"value": "success"}
+ held = []
+ context.route("**/*", serve)
+ page = context.new_page()
+ errors = []
+ page.on("pageerror", lambda error: errors.append(str(error)))
+ test_mentoring(page, width, theme, submissions, mode, held)
+ assert not errors, errors
+ context.close()
+
+ context = browser.new_context(java_script_enabled=False, service_workers="block")
+ context.route("**/*", serve)
+ captured = []
+
+ def native_mentoring_submit(route):
+ assert route.request.method == "POST"
+ captured.append(parse_qs(route.request.post_data))
+ route.fulfill(content_type="text/html", body="Provider confirmation (test) ")
+
+ context.route(endpoint, native_mentoring_submit)
+ page = context.new_page()
+ page.goto("http://inquiry.test/mentoring/#contact")
+ form = page.locator("#inquiry-form")
+ expect(form).to_be_visible()
+ expect(page.locator("#inquiry-success")).to_be_hidden()
+ button = form.get_by_role("button", name="Send mentoring inquiry", exact=True)
+ submit_form(button)
+ assert not captured
+ fill_mentoring(page)
+ submit_form(button)
+ expect(page.get_by_role("heading", name="Provider confirmation (test)")).to_be_visible()
+ assert captured == [{name: [value] for name, value in mentoring_payload.items()}]
+ print("PASS: mentoring no-JavaScript validation and native POST; provider response mocked, not live delivery")
+ context.close()
finally:
browser.close()
diff --git a/templates/components/mentoring_inquiry.html b/templates/components/mentoring_inquiry.html
new file mode 100644
index 00000000..ab9ca7d9
--- /dev/null
+++ b/templates/components/mentoring_inquiry.html
@@ -0,0 +1,43 @@
+{% component mentoring_inquiry() %}
+
+
+{% endcomponent mentoring_inquiry %}
diff --git a/templates/mentorship.html b/templates/mentorship.html
index 7a39bbdb..6d7e85c8 100644
--- a/templates/mentorship.html
+++ b/templates/mentorship.html
@@ -88,36 +88,8 @@
{{ section.content | safe }}
+ {% set hide_newsletter = true %}
{% include "snippets/footer.html" %}
-