[TASK] Acceptance Test to check if backend login is displayed 62/41262/9
authorGeorg Ringer <georg.ringer@gmail.com>
Wed, 15 Jul 2015 08:29:04 +0000 (10:29 +0200)
committerGeorg Ringer <georg.ringer@gmail.com>
Wed, 15 Jul 2015 13:58:31 +0000 (15:58 +0200)
A first acceptance test is added to check if the backend login form
is displayed.

To be able to run tests, you need to follow this steps:
* composer update
* Build the required tester:
  ./bin/codecept build -c typo3/sysext/core/Build/AcceptanceTests.yml
* Start a local web server:
  php -S localhost:8000 &
* Run the test suite
  ./bin/codecept run acceptance
    -c typo3/sysext/core/Build/AcceptanceTests.yml
    typo3/sysext/core/Tests/Acceptance

Change-Id: I06eae24f8356c05e083f268326ea8f9563df6b74
Resolves: #68114
Releases: master
Reviewed-on: http://review.typo3.org/41262
Reviewed-by: Susanne Moog <typo3@susannemoog.de>
Tested-by: Susanne Moog <typo3@susannemoog.de>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
.gitignore
typo3/sysext/core/Build/AcceptanceTests.yml [new file with mode: 0644]
typo3/sysext/core/Build/Configuration/Acceptance/Support/AcceptanceTester.php [new file with mode: 0644]
typo3/sysext/core/Build/Configuration/Acceptance/Support/Helper/Acceptance.php [new file with mode: 0644]
typo3/sysext/core/Build/Configuration/Acceptance/acceptance.suite.yml [new file with mode: 0644]
typo3/sysext/core/Tests/Acceptance/Backend/LoginCept.php [new file with mode: 0644]

index d3bfd5e..35c8651 100644 (file)
@@ -32,6 +32,8 @@ Build/node_modules/*
 .cache
 .sass-cache
 .session
+typo3/sysext/core/Build/Configuration/Acceptance/Support/_generated/*
+typo3/sysext/core/Build/Configuration/Acceptance/Support/AcceptanceTester.php
 #
 # Ignore composer stuff
 bin/*
diff --git a/typo3/sysext/core/Build/AcceptanceTests.yml b/typo3/sysext/core/Build/AcceptanceTests.yml
new file mode 100644 (file)
index 0000000..7c573cd
--- /dev/null
@@ -0,0 +1,12 @@
+actor: Tester
+paths:
+    tests: Configuration/Acceptance
+    log: ../../../../typo3temp/codeception
+    data: ''
+    support: Configuration/Acceptance/Support
+settings:
+    colors: true
+    memory_limit: 1024M
+extensions:
+    enabled:
+        - Codeception\Extension\RunFailed
\ No newline at end of file
diff --git a/typo3/sysext/core/Build/Configuration/Acceptance/Support/AcceptanceTester.php b/typo3/sysext/core/Build/Configuration/Acceptance/Support/AcceptanceTester.php
new file mode 100644 (file)
index 0000000..bfa59cb
--- /dev/null
@@ -0,0 +1,26 @@
+<?php
+
+
+/**
+ * Inherited Methods
+ * @method void wantToTest($text)
+ * @method void wantTo($text)
+ * @method void execute($callable)
+ * @method void expectTo($prediction)
+ * @method void expect($prediction)
+ * @method void amGoingTo($argumentation)
+ * @method void am($role)
+ * @method void lookForwardTo($achieveValue)
+ * @method void comment($description)
+ * @method \Codeception\Lib\Friend haveFriend($name, $actorClass = null)
+ *
+ * @SuppressWarnings(PHPMD)
+*/
+class AcceptanceTester extends \Codeception\Actor
+{
+    use _generated\AcceptanceTesterActions;
+
+   /**
+    * Define custom actions here
+    */
+}
diff --git a/typo3/sysext/core/Build/Configuration/Acceptance/Support/Helper/Acceptance.php b/typo3/sysext/core/Build/Configuration/Acceptance/Support/Helper/Acceptance.php
new file mode 100644 (file)
index 0000000..98c1c53
--- /dev/null
@@ -0,0 +1,6 @@
+<?php
+namespace Helper;
+
+class Acceptance extends \Codeception\Module {
+
+}
diff --git a/typo3/sysext/core/Build/Configuration/Acceptance/acceptance.suite.yml b/typo3/sysext/core/Build/Configuration/Acceptance/acceptance.suite.yml
new file mode 100644 (file)
index 0000000..cc8d082
--- /dev/null
@@ -0,0 +1,6 @@
+class_name: AcceptanceTester
+modules:
+    enabled:
+        - PhpBrowser:
+            url: http://localhost:8000
+        - \Helper\Acceptance
\ No newline at end of file
diff --git a/typo3/sysext/core/Tests/Acceptance/Backend/LoginCept.php b/typo3/sysext/core/Tests/Acceptance/Backend/LoginCept.php
new file mode 100644 (file)
index 0000000..a6df062
--- /dev/null
@@ -0,0 +1,7 @@
+<?php
+$I = new AcceptanceTester($scenario);
+$I->wantTo('I want to see the TYPO3 backend login form');
+$I->amOnPage('/typo3/index.php');
+$I->see('Login', '#t3-login-submit');
+$I->fillField('#t3-username', 'admin');
+$I->fillField('#t3-password', 'joh316');
\ No newline at end of file