<commit_before>#!perl

use v5.24.0;
use warnings;

=head1 NAME

login.t - Test the login form

=head1 SEE ALSO

L<< Test::GADSDriver >>

=cut

use lib 'webdriver/t/lib';

use Test::GADSDriver ();
use Test::More 'no_plan';

my $gads = Test::GADSDriver->new;

$gads->go_to_url('/');
$gads->assert_on_login_page;
$gads->assert_error_absent;

$gads->submit_login_form_ok( 'Submit the login form with a bad password',
    { password => '<PASSWORD>' } );
$gads->assert_on_login_page('The login page is visible after a bad login');
$gads->assert_error_present;

$gads->submit_login_form_ok;
$gads->assert_error_absent('No error message is visible after logging in');
$gads->assert_success_absent('No success message is visible after logging in');
$gads->assert_navigation_present(
    'The site navigation is visible after logging in' );

done_testing();<commit_msg>Improve assertion logic<commit_after>#!perl

use v5.24.0;
use warnings;

=head1 NAME

login.t - Test the login form

=head1 SEE ALSO

L<< Test::GADSDriver >>

=cut

use lib 'webdriver/t/lib';

use Test::GADSDriver ();
use Test::More 'no_plan';

my $gads = Test::GADSDriver->new;

$gads->go_to_url('/');
$gads->assert_on_login_page;
$gads->assert_error_absent;

$gads->submit_login_form_ok( 'Submit the login form with a bad password',
    { password => '<PASSWORD>' } );
$gads->assert_on_login_page('The login page is visible after a bad login');
$gads->assert_error_present;

$gads->submit_login_form_ok;
$gads->assert_navigation_present(
    'The site navigation is visible after logging in' );
$gads->assert_error_absent('No error message is visible after logging in');
$gads->assert_success_absent('No success message is visible after logging in');

done_testing();
{'fraction_non_alphanumeric': 0.13773148148148148, 'fraction_numerical': 0.006944444444444444, 'mean_word_length': 5.727626459143969, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '192278', 'n_tokens_mistral': 624, 'n_tokens_neox': 613, 'n_words': 161}