X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fselenium%2Finstaller%2FMediaWikiErrorsNamepageTestCase.php;h=3b2f012647f1c2dc6df45e12036c29abca988e67;hb=beb1c4a0eced04ce2098433c383f1fbe469569c9;hp=c2b35054d2b47cf96f1d837a903e78b7e91e736f;hpb=3fe42d7504412ebe15912133b0e34e15637f3eeb;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/selenium/installer/MediaWikiErrorsNamepageTestCase.php b/tests/selenium/installer/MediaWikiErrorsNamepageTestCase.php index c2b35054d2..3b2f012647 100644 --- a/tests/selenium/installer/MediaWikiErrorsNamepageTestCase.php +++ b/tests/selenium/installer/MediaWikiErrorsNamepageTestCase.php @@ -1,5 +1,4 @@ assertEquals( "Enter a site name.", - $this->getText( LINK_DIV."div[2]/div[2]" )); - $this->assertEquals( "Enter an administrator username.", - $this->getText( LINK_DIV."div[3]/div[2]" )); - $this->assertEquals( "Enter a password for the administrator account.", - $this->getText( LINK_DIV."div[4]/div[2]" )); - - // Verify warning message for the blank 'Site name' - $this->type( "config__AdminName", VALID_YOUR_NAME ); - $this->type( "config__AdminPassword", VALID_PASSWORD ); - $this->type( "config__AdminPassword2", VALID_PASSWORD_AGAIN ); - parent::clickContinueButton(); - $this->assertEquals( "Enter a site name.", - $this->getText( LINK_DIV."div[2]/div[2]" )); - - // Input valid 'Site name' - $this->type( "config_wgSitename", VALID_WIKI_NAME ); - - - // Verify warning message for the invalid "Project namespace' - $this->click( "config__NamespaceType_other" ); - $this->type( "config_wgMetaNamespace", INVALID_NAMESPACE ); - parent::clickContinueButton(); - $this->assertEquals( "The specified namespace \"\" is invalid. Specify a different project namespace.", - $this->getText( LINK_DIV."div[2]/div[2]" )); - - - // Verify warning message for the blank 'Project namespace' - $this->type( "config_wgSitename", VALID_WIKI_NAME ); - $this->click( "config__NamespaceType_other" ); - $this->type( "config_wgMetaNamespace" , "" ); - parent::clickContinueButton(); - $this->assertEquals( "The specified namespace \"\" is invalid. Specify a different project namespace.", - $this->getText( LINK_DIV."div[2]/div[2]" )); - - - // Valid 'Project namespace' - $this->click( "config__NamespaceType_other" ); - $this->type( "config_wgMetaNamespace", VALID_NAMESPACE ); - parent::clickContinueButton(); - - - // Valid 'Site name' - $this->click( "config__NamespaceType_site-name" ); - $this->type( "config_wgSitename", VALID_WIKI_NAME ); - - - // Verify warning message for blank 'Your name' - $this->type( "config__AdminName", " " ); - parent::clickContinueButton(); - $this->assertEquals( "Enter an administrator username.", - $this->getText( LINK_DIV."div[2]/div[2]" )); - - $this->type( "config_wgSitename", VALID_WIKI_NAME ); - // Verify warning message for blank 'Password' - $this->type( "config__AdminName", VALID_YOUR_NAME ); - $this->type( "config__AdminPassword", " " ); - parent::clickContinueButton(); - $this->assertEquals( "Enter a password for the administrator account.", - $this->getText( LINK_DIV."div[2]/div[2]" )); - - - // Verify warning message for the blank 'Password again' - $this->type( "config_wgSitename", VALID_WIKI_NAME ); - $this->type( "config__AdminPassword", VALID_PASSWORD ); - $this->type( "config__AdminPassword2", " " ); - parent::clickContinueButton(); - $this->assertEquals( "The two passwords you entered do not match.", - $this->getText( LINK_DIV."div[2]/div[2]" )); - - - // Verify warning message for the different'Password' and 'Password again' - $this->type( "config_wgSitename", VALID_WIKI_NAME ); - $this->type( "config__AdminPassword", VALID_PASSWORD ); - $this->type( "config__AdminPassword2", INVALID_PASSWORD_AGAIN ); - parent::clickContinueButton(); - $this->assertEquals( "The two passwords you entered do not match.", - $this->getText( LINK_DIV."div[2]/div[2]" )); - } + function setUp() { + parent::setUp(); + } + + // Verify warning message for the 'Name' page + public function testErrorsNamePage() { + + $databaseName = DB_NAME_PREFIX . "_error_name"; + + parent::navigateNamePage( $databaseName ); + + // Verify warning message for all blank fields + parent::clickContinueButton(); + $this->assertEquals( "Enter a site name.", + $this->getText( LINK_DIV . "div[2]/div[2]" ) ); + $this->assertEquals( "Enter an administrator username.", + $this->getText( LINK_DIV . "div[3]/div[2]" ) ); + $this->assertEquals( "Enter a password for the administrator account.", + $this->getText( LINK_DIV . "div[4]/div[2]" ) ); + + // Verify warning message for the blank 'Site name' + $this->type( "config__AdminName", VALID_YOUR_NAME ); + $this->type( "config__AdminPassword", VALID_PASSWORD ); + $this->type( "config__AdminPassword2", VALID_PASSWORD_AGAIN ); + parent::clickContinueButton(); + $this->assertEquals( "Enter a site name.", + $this->getText( LINK_DIV . "div[2]/div[2]" ) ); + + // Input valid 'Site name' + $this->type( "config_wgSitename", VALID_WIKI_NAME ); + + // Verify warning message for the invalid "Project namespace' + $this->click( "config__NamespaceType_other" ); + $this->type( "config_wgMetaNamespace", INVALID_NAMESPACE ); + parent::clickContinueButton(); + $this->assertEquals( "The specified namespace \"\" is invalid. Specify a different project namespace.", + $this->getText( LINK_DIV . "div[2]/div[2]" ) ); + + // Verify warning message for the blank 'Project namespace' + $this->type( "config_wgSitename", VALID_WIKI_NAME ); + $this->click( "config__NamespaceType_other" ); + $this->type( "config_wgMetaNamespace", "" ); + parent::clickContinueButton(); + $this->assertEquals( "The specified namespace \"\" is invalid. Specify a different project namespace.", + $this->getText( LINK_DIV . "div[2]/div[2]" ) ); + + // Valid 'Project namespace' + $this->click( "config__NamespaceType_other" ); + $this->type( "config_wgMetaNamespace", VALID_NAMESPACE ); + parent::clickContinueButton(); + + // Valid 'Site name' + $this->click( "config__NamespaceType_site-name" ); + $this->type( "config_wgSitename", VALID_WIKI_NAME ); + + // Verify warning message for blank 'Your name' + $this->type( "config__AdminName", " " ); + parent::clickContinueButton(); + $this->assertEquals( "Enter an administrator username.", + $this->getText( LINK_DIV . "div[2]/div[2]" ) ); + + $this->type( "config_wgSitename", VALID_WIKI_NAME ); + // Verify warning message for blank 'Password' + $this->type( "config__AdminName", VALID_YOUR_NAME ); + $this->type( "config__AdminPassword", " " ); + parent::clickContinueButton(); + $this->assertEquals( "Enter a password for the administrator account.", + $this->getText( LINK_DIV . "div[2]/div[2]" ) ); + + // Verify warning message for the blank 'Password again' + $this->type( "config_wgSitename", VALID_WIKI_NAME ); + $this->type( "config__AdminPassword", VALID_PASSWORD ); + $this->type( "config__AdminPassword2", " " ); + parent::clickContinueButton(); + $this->assertEquals( "The two passwords you entered do not match.", + $this->getText( LINK_DIV . "div[2]/div[2]" ) ); + + // Verify warning message for the different'Password' and 'Password again' + $this->type( "config_wgSitename", VALID_WIKI_NAME ); + $this->type( "config__AdminPassword", VALID_PASSWORD ); + $this->type( "config__AdminPassword2", INVALID_PASSWORD_AGAIN ); + parent::clickContinueButton(); + $this->assertEquals( "The two passwords you entered do not match.", + $this->getText( LINK_DIV . "div[2]/div[2]" ) ); + } }