Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kyoshino committed Oct 2, 2024
1 parent e3bdc29 commit 9905b9c
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 26 deletions.
23 changes: 14 additions & 9 deletions qa/t/1_test_create_user_accounts.t
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ my ($sel, $config) = get_selenium();
my $valid_account = 'selenium-' . random_string(10) . '@bugzilla.test';

$sel->get_ok('/home', 'Go to the home page');
$sel->is_text_present_ok("New Account");
$sel->click_ok("link=New Account");
$sel->click_ok("link=Log In");
$sel->click_ok("link=Create an Account");
$sel->wait_for_page_to_load_ok(WAIT_TIME);
$sel->title_is("Create a new Bugzilla account");
$sel->type_ok("login", $valid_account);
Expand All @@ -35,8 +35,8 @@ $sel->is_text_present_ok("A confirmation email has been sent");
$sel->click_ok('//*[@id="header-title"]//a');
$sel->wait_for_page_to_load_ok(WAIT_TIME);
$sel->title_is("Bugzilla Main Page");
$sel->is_text_present_ok("New Account");
$sel->click_ok("link=New Account");
$sel->click_ok("link=Log In");
$sel->click_ok("link=Create an Account");
$sel->wait_for_page_to_load_ok(WAIT_TIME);
$sel->title_is("Create a new Bugzilla account");
$sel->type_ok("login", $valid_account);
Expand All @@ -60,7 +60,8 @@ my @accounts = qw(
);

foreach my $account (@accounts) {
$sel->click_ok("link=New Account");
$sel->click_ok("link=Log In");
$sel->click_ok("link=Create an Account");
$sel->wait_for_page_to_load_ok(WAIT_TIME);
$sel->title_is("Create a new Bugzilla account");
$sel->type_ok("login", $account);
Expand All @@ -78,7 +79,8 @@ foreach my $account (@accounts) {
# Logins larger than 127 characters must be rejected, for security reasons.
push @accounts, 'selenium-' . random_string(110) . '@bugzilla.test';
foreach my $account (@accounts) {
$sel->click_ok("link=New Account");
$sel->click_ok("link=Log In");
$sel->click_ok("link=Create an Account");
$sel->wait_for_page_to_load_ok(WAIT_TIME);
$sel->title_is("Create a new Bugzilla account");
$sel->type_ok("login", $account);
Expand All @@ -95,7 +97,8 @@ foreach my $account (@accounts) {
}

# This account already exists.
$sel->click_ok("link=New Account");
$sel->click_ok("link=Log In");
$sel->click_ok("link=Create an Account");
$sel->wait_for_page_to_load_ok(WAIT_TIME);
$sel->title_is("Create a new Bugzilla account");
$sel->type_ok("login", $config->{admin_user_login});
Expand All @@ -117,13 +120,15 @@ set_parameters($sel,
logout($sel);

# Make sure that links pointing to createaccount.cgi are all deactivated.
ok(!$sel->is_text_present("New Account"), "No link named 'New Account'");
$sel->click_ok("link=Log In");
ok(!$sel->is_text_present("Create an Account"), "No link named 'Create an Account'");
$sel->click_ok('//*[@id="header-title"]//a');
$sel->wait_for_page_to_load_ok(WAIT_TIME);
$sel->refresh;
$sel->wait_for_page_to_load_ok(WAIT_TIME);
$sel->title_is("Bugzilla Main Page");
ok(!$sel->is_text_present("New Account"), "No link named 'New Account'");
$sel->click_ok("link=Log In");
ok(!$sel->is_text_present("Create an Account"), "No link named 'Create an Account'");
$sel->open_ok("/createaccount.cgi");
$sel->title_is("Account Creation Disabled");
$error_msg = trim($sel->get_text("error_msg"));
Expand Down
2 changes: 1 addition & 1 deletion template/en/default/account/auth/login-small.html.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
[% END %]

[% additional_methods = Hook.process('additional_methods') %]
[% additional_methods %]
[% additional_methods FILTER none %]

[% IF Param('oauth2_client_enabled') || additional_methods %]
<div class="method-separator">or</div>
Expand Down
2 changes: 1 addition & 1 deletion template/en/default/account/auth/login.html.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

<div id="login-wrapper">

<h1>Log in to [% "$terms.Bugzilla" %]</h1>
<h1>Log in to [% "$terms.Bugzilla" FILTER html %]</h1>

<div id="login-primary">
[% IF Param('oauth2_client_enabled') %]
Expand Down
30 changes: 15 additions & 15 deletions template/en/default/global/header.html.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -252,21 +252,6 @@
<div id="wrapper">

<header id="header" role="banner" aria-label="Global Header">
<dialog id="menu-drawer" inert aria-label="Site Menu">
<div class="drawer-inner" role="none">
<div class="header" role="none">
<button type="button" class="iconic ghost" id="close-menu-drawer"
aria-label="Close Site Menu">
<span class="icon" aria-hidden="true">close</span>
</button>
</div>
<ul role="menu" aria-label="Site Links">
[% INCLUDE primary_links %]
[% Hook.process('action-links') %]
[% INCLUDE secondary_links %]
</ul>
</div>
</dialog>
<div class="inner" role="none">
<button type="button" class="iconic ghost" id="open-menu-drawer" aria-label="Open Site Menu">
<span class="icon" aria-hidden="true">menu</span>
Expand Down Expand Up @@ -376,6 +361,21 @@
</ul>
[% END %]
</div>
<dialog id="menu-drawer" inert aria-label="Site Menu">
<div class="drawer-inner" role="none">
<div class="header" role="none">
<button type="button" class="iconic ghost" id="close-menu-drawer"
aria-label="Close Site Menu">
<span class="icon" aria-hidden="true">close</span>
</button>
</div>
<ul role="menu" aria-label="Site Links">
[% INCLUDE primary_links %]
[% Hook.process('action-links') %]
[% INCLUDE secondary_links %]
</ul>
</div>
</dialog>
</header> [%# header %]

[%
Expand Down

0 comments on commit 9905b9c

Please sign in to comment.