Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Browser/UserProfileTest.php
Show First 20 Lines • Show All 85 Lines • ▼ Show 20 Lines | public function testProfile(): void | ||||
->assertValue('div.row:nth-child(5) input[type=text]', $this->profile['phone']) | ->assertValue('div.row:nth-child(5) input[type=text]', $this->profile['phone']) | ||||
->assertSeeIn('div.row:nth-child(6) label', 'External Email') | ->assertSeeIn('div.row:nth-child(6) label', 'External Email') | ||||
->assertValue('div.row:nth-child(6) input[type=text]', $this->profile['external_email']) | ->assertValue('div.row:nth-child(6) input[type=text]', $this->profile['external_email']) | ||||
->assertSeeIn('div.row:nth-child(7) label', 'Address') | ->assertSeeIn('div.row:nth-child(7) label', 'Address') | ||||
->assertValue('div.row:nth-child(7) textarea', $this->profile['billing_address']) | ->assertValue('div.row:nth-child(7) textarea', $this->profile['billing_address']) | ||||
->assertSeeIn('div.row:nth-child(8) label', 'Country') | ->assertSeeIn('div.row:nth-child(8) label', 'Country') | ||||
->assertValue('div.row:nth-child(8) select', $this->profile['country']) | ->assertValue('div.row:nth-child(8) select', $this->profile['country']) | ||||
->assertSeeIn('div.row:nth-child(9) label', 'Password') | ->assertSeeIn('div.row:nth-child(9) label', 'Password') | ||||
->assertValue('div.row:nth-child(9) input[type=password]', '') | ->assertValue('div.row:nth-child(9) input#password', '') | ||||
->assertSeeIn('div.row:nth-child(10) label', 'Confirm Password') | ->assertValue('div.row:nth-child(9) input#password_confirmation', '') | ||||
->assertValue('div.row:nth-child(10) input[type=password]', '') | ->assertAttribute('#password', 'placeholder', 'Password') | ||||
->assertAttribute('#password_confirmation', 'placeholder', 'Confirm Password') | |||||
->assertSeeIn('button[type=submit]', 'Submit'); | ->assertSeeIn('button[type=submit]', 'Submit'); | ||||
// Test form error handling | // Test form error handling | ||||
$browser->type('#phone', 'aaaaaa') | $browser->type('#phone', 'aaaaaa') | ||||
->type('#external_email', 'bbbbb') | ->type('#external_email', 'bbbbb') | ||||
->click('button[type=submit]') | ->click('button[type=submit]') | ||||
->waitFor('#phone + .invalid-feedback') | ->waitFor('#phone + .invalid-feedback') | ||||
->assertSeeIn('#phone + .invalid-feedback', 'The phone format is invalid.') | ->assertSeeIn('#phone + .invalid-feedback', 'The phone format is invalid.') | ||||
▲ Show 20 Lines • Show All 89 Lines • Show Last 20 Lines |