Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Browser/SignupTest.php
Show First 20 Lines • Show All 99 Lines • ▼ Show 20 Lines | public function testSignupStep0(): void | ||||
$browser->visit(new Signup()); | $browser->visit(new Signup()); | ||||
$browser->assertVisible('@step0') | $browser->assertVisible('@step0') | ||||
->assertMissing('@step1') | ->assertMissing('@step1') | ||||
->assertMissing('@step2') | ->assertMissing('@step2') | ||||
->assertMissing('@step3'); | ->assertMissing('@step3'); | ||||
$browser->within(new Menu(), function ($browser) { | $browser->within(new Menu(), function ($browser) { | ||||
$browser->assertMenuItems(['signup', 'explore', 'blog', 'support', 'login'], 'signup'); | $browser->assertMenuItems(['signup', 'explore', 'blog', 'support', 'login', 'lang'], 'signup'); | ||||
}); | }); | ||||
$browser->waitFor('@step0 .plan-selector > .card'); | $browser->waitFor('@step0 .plan-selector > .card'); | ||||
// Assert first plan box and press the button | // Assert first plan box and press the button | ||||
$browser->with('@step0 .plan-selector > .plan-individual', function ($step) { | $browser->with('@step0 .plan-selector > .plan-individual', function ($step) { | ||||
$step->assertVisible('button') | $step->assertVisible('button') | ||||
->assertSeeIn('button', 'Individual Account') | ->assertSeeIn('button', 'Individual Account') | ||||
▲ Show 20 Lines • Show All 52 Lines • ▼ Show 20 Lines | public function testSignupStep1(): void | ||||
// Email is required, so after pressing Submit | // Email is required, so after pressing Submit | ||||
// we expect focus to be moved to the email input | // we expect focus to be moved to the email input | ||||
$browser->with('@step1', function ($step) { | $browser->with('@step1', function ($step) { | ||||
$step->click('[type=submit]'); | $step->click('[type=submit]'); | ||||
$step->assertFocused('#signup_email'); | $step->assertFocused('#signup_email'); | ||||
}); | }); | ||||
$browser->within(new Menu(), function ($browser) { | $browser->within(new Menu(), function ($browser) { | ||||
$browser->assertMenuItems(['signup', 'explore', 'blog', 'support', 'login'], 'signup'); | $browser->assertMenuItems(['signup', 'explore', 'blog', 'support', 'login', 'lang'], 'signup'); | ||||
}); | }); | ||||
// Submit invalid email, and first_name | // Submit invalid email, and first_name | ||||
// We expect both inputs to have is-invalid class added, with .invalid-feedback element | // We expect both inputs to have is-invalid class added, with .invalid-feedback element | ||||
$browser->with('@step1', function ($step) { | $browser->with('@step1', function ($step) { | ||||
$step->type('#signup_first_name', str_repeat('a', 250)) | $step->type('#signup_first_name', str_repeat('a', 250)) | ||||
->type('#signup_email', '@test') | ->type('#signup_email', '@test') | ||||
->click('[type=submit]') | ->click('[type=submit]') | ||||
▲ Show 20 Lines • Show All 358 Lines • Show Last 20 Lines |