From 39be67dc8ff1d2295c776a36ce6157191bd5d375 Mon Sep 17 00:00:00 2001 From: David Lawrence Date: Wed, 9 Sep 2015 22:11:19 +0000 Subject: Bug 1202461 - update test script for account creation --- qa/t/test_create_user_accounts.t | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'qa') diff --git a/qa/t/test_create_user_accounts.t b/qa/t/test_create_user_accounts.t index 92145f18c..d9c0c4404 100644 --- a/qa/t/test_create_user_accounts.t +++ b/qa/t/test_create_user_accounts.t @@ -63,8 +63,28 @@ foreach my $account (@accounts) { $sel->is_text_present_ok("User account creation has been restricted."); } -# These accounts are illegal. -@accounts = ('test\bugzilla@bugzilla.test', 'test@bugzilla.org@bugzilla.test', 'test@bugzilla..test'); +# These accounts are illegal and should cause a javascript alert. +@accounts = qw( + test\bugzilla@bugzilla.test + testbugzilla.test + test@bugzilla + test@bugzilla. + 'test'@bugzilla.test + test&test@bugzilla.test + [test]@bugzilla.test +); +foreach my $account (@accounts) { + $sel->click_ok("link=New Account"); + $sel->wait_for_page_to_load_ok(WAIT_TIME); + $sel->title_is("Create a new Bugzilla account"); + $sel->type_ok("login", $account); + $sel->click_ok('//input[@value="Create Account"]'); + ok($sel->get_alert() =~ /The e-mail address doesn't pass our syntax checking for a legal email address/, + 'Invalid email address detected'); +} + +# These accounts are illegal but do not cause a javascript alert +@accounts = ('test@bugzilla.org@bugzilla.test', 'test@bugzilla..test'); foreach my $account (@accounts) { $sel->click_ok("link=New Account"); $sel->wait_for_page_to_load_ok(WAIT_TIME); -- cgit v1.2.3-24-g4f1b