[TASK] Acceptance test installing TYPO3 on mysql 94/52894/2
authorChristian Kuhn <lolli@schwarzbu.ch>
Sat, 20 May 2017 19:12:30 +0000 (21:12 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Mon, 22 May 2017 10:25:06 +0000 (12:25 +0200)
A basic acceptance tests clicking through installer
using a mysql db connection, checking backend login
and "blank" site frontend output works.

Change-Id: Ie14d9c6fd8280d382b4041f98fa04ed00ef8386c
Resolves: #81285
Releases: master, 8.7
Reviewed-on: https://review.typo3.org/52894
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/core/Tests/AcceptanceInstallMysql.suite.yml [new file with mode: 0644]
typo3/sysext/core/Tests/AcceptanceInstallMysql/InstallWithMysqlCest.php [new file with mode: 0644]

diff --git a/typo3/sysext/core/Tests/AcceptanceInstallMysql.suite.yml b/typo3/sysext/core/Tests/AcceptanceInstallMysql.suite.yml
new file mode 100644 (file)
index 0000000..9fca373
--- /dev/null
@@ -0,0 +1,24 @@
+class_name: AcceptanceTester
+modules:
+  enabled:
+    - WebDriver
+    - \Helper\Acceptance
+    - Asserts
+  config:
+    WebDriver:
+      url: http://localhost:8000/typo3temp/var/tests/acceptanceinstallmysql
+      browser: chrome
+      port: 4444
+      window_size: 1280x1024
+      wait: 1
+      restart: true
+      capabilities:
+        # Disable the "scroll to element before clicking" behavior as this breaks tests
+        # where for example a fixed docbar is used. Selenium scrolls to the element before
+        # clicking it and then complains that it can't click the element because another elemnt
+        # is overlaying it.
+        # You have to ensure that the element is in the viewport by your own before clicking it!
+        # You can simply do that by scrolling to it.
+        elementScrollBehavior: 1
+        chromeOptions:
+          args: [no-sandbox,disable-infobars,disable-notifications,disable-gpu,disable-software-rasterizer]
\ No newline at end of file
diff --git a/typo3/sysext/core/Tests/AcceptanceInstallMysql/InstallWithMysqlCest.php b/typo3/sysext/core/Tests/AcceptanceInstallMysql/InstallWithMysqlCest.php
new file mode 100644 (file)
index 0000000..fc33fbd
--- /dev/null
@@ -0,0 +1,72 @@
+<?php
+namespace TYPO3\CMS\Core\Tests\AcceptanceInstallMysql;
+
+/*
+ * This file is part of the TYPO3 CMS project.
+ *
+ * It is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License, either version 2
+ * of the License, or any later version.
+ *
+ * For the full copyright and license information, please read the
+ * LICENSE.txt file that was distributed with this source code.
+ *
+ * The TYPO3 project - inspiring people to share!
+ */
+
+/**
+ * Click through installer, go to backend, check blank site in FE works
+ */
+class InstallWithMysqlCest
+{
+    /**
+     * @param \AcceptanceTester $I
+     */
+    public function installTypo3OnMysql(\AcceptanceTester $I)
+    {
+        // Calling frontend redirects to installer
+        $I->amOnPage('/');
+
+        // EnvironmentAndFolders step
+        $I->waitForText('Installing TYPO3');
+        $I->see('System looks good. Continue!');
+        $I->click('System looks good. Continue!');
+
+        // DatabaseConnection step
+        $I->waitForText('Database connection');
+        $I->fillField('#t3-install-step-mysqliManualConfiguration-username', getenv('typo3DatabaseUsername'));
+        $I->fillField('#t3-install-step-mysqliManualConfiguration-password', getenv('typo3DatabasePassword'));
+        $I->click('Continue');
+
+        // DatabaseSelect step
+        $I->waitForText('Select database');
+        $I->click('#t3-install-form-db-select-type-new');
+        $I->fillField('#t3-install-step-database-new', getenv('typo3DatabaseName') . '_atimysql');
+        $I->click('Continue');
+
+        // DatabaseData step
+        $I->waitForText('Create user and import base data');
+        $I->fillField('#username', 'admin');
+        $I->fillField('#password', 'password');
+        $I->click('Continue');
+
+        // DefaultConfiguration step - Create empty page
+        $I->waitForText('Installation done!');
+        $I->click('#create-site');
+        $I->click('Open the TYPO3 Backend');
+
+        // Verify backend login successful
+        $I->waitForElement('#t3-username');
+        $I->fillField('#t3-username', 'admin');
+        $I->fillField('#t3-password', 'password');
+        $I->click('#t3-login-submit-section > button');
+        $I->waitForElement('.nav', 30);
+        $I->waitForElement('.scaffold-content iframe', 30);
+        $I->seeCookie('be_lastLoginProvider');
+        $I->seeCookie('be_typo_user');
+
+        // Verify default frontend is rendered
+        $I->amOnPage('/');
+        $I->waitForText('Welcome to a default website made with TYPO3');
+    }
+}