[TASK] Acceptance test for TER search in ExtensionManager 99/50399/3
authorMarco Bresch <marco.bresch@starfinanz.de>
Thu, 27 Oct 2016 09:41:07 +0000 (11:41 +0200)
committerJan Helke <typo3@helke.de>
Thu, 27 Oct 2016 10:13:59 +0000 (12:13 +0200)
Add some tests for Get Extensions in ExtensionManager.

Resolves: #78453
Relates: #78437
Releases: master
Change-Id: I089c261636c50b589464673505c4e244abed1652
Reviewed-on: https://review.typo3.org/50399
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Jan Helke <typo3@helke.de>
Tested-by: Jan Helke <typo3@helke.de>
typo3/sysext/core/Tests/Acceptance/Backend/Extensionmanager/GetExtensionsCest.php [new file with mode: 0644]
typo3/sysext/core/Tests/Acceptance/Fixtures/tx_extensionmanager_domain_model_extension.xml [new file with mode: 0644]
typo3/sysext/core/Tests/Acceptance/Fixtures/tx_extensionmanager_domain_model_repository.xml [new file with mode: 0644]
typo3/sysext/core/Tests/AcceptanceCoreEnvironment.php

diff --git a/typo3/sysext/core/Tests/Acceptance/Backend/Extensionmanager/GetExtensionsCest.php b/typo3/sysext/core/Tests/Acceptance/Backend/Extensionmanager/GetExtensionsCest.php
new file mode 100644 (file)
index 0000000..54d938b
--- /dev/null
@@ -0,0 +1,97 @@
+<?php
+namespace TYPO3\CMS\Core\Tests\Acceptance\Backend\Extensionmanager;
+
+/*
+ * 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!
+ */
+
+use Facebook\WebDriver\WebDriverKeys;
+use TYPO3\CMS\Core\Tests\Acceptance\Step\Backend\Admin;
+
+/**
+ * Tests for the "Get Extensions view" of the extension manager
+ */
+class GetExtensionsCest
+{
+    /**
+     * @param Admin $I
+     */
+    public function _before(Admin $I)
+    {
+        $I->useExistingSession();
+        // Ensure main content frame is fully loaded, otherwise there are load-race-conditions
+        $I->switchToIFrame('list_frame');
+        $I->waitForText('Web Content Management System');
+        $I->switchToIFrame();
+
+        $I->click('Extensions', '#menu');
+        $I->switchToIFrame('list_frame');
+        $I->waitForElementVisible('#typo3-extension-list');
+
+        $I->selectOption('[name="ExtensionManagerModuleMenu"]', 'Get Extensions');
+        $I->waitForElementVisible('#terTable_wrapper');
+
+        // We expect exact two extensions created from the Fixtures
+        $I->canSeeNumberOfElements('#terTable tbody tr', 2);
+    }
+
+    /**
+     * @param Admin $I
+     */
+    public function checkRetrievedExtensionsFromTerAreDisplayed(Admin $I)
+    {
+        $I->see('superext');
+        $I->see('neededext');
+    }
+
+    /**
+     * @param Admin $I
+     */
+    public function checkPageBrowserDisplaysTwoRecords(Admin $I)
+    {
+        $I->canSeeElement('.pagination-wrap');
+        $I->canSee('Records 1 - 2');
+    }
+
+    /**
+     * @param Admin $I
+     */
+    public function checkSearchFilterListFindsExtensionKey(Admin $I)
+    {
+        $I->fillField('input[name="tx_extensionmanager_tools_extensionmanagerextensionmanager[search]"]', 'superext');
+        $I->click('Go');
+        $I->waitForElementVisible('#terSearchTable');
+        $I->canSeeNumberOfElements('#terSearchTable tbody tr', 1);
+        $I->canSee('Super Extension');
+
+        $I->amGoingTo('search extension neededext and submit with enter');
+
+        $I->fillField('input[name="tx_extensionmanager_tools_extensionmanagerextensionmanager[search]"]', 'neededext');
+        $I->pressKey('input[name="tx_extensionmanager_tools_extensionmanagerextensionmanager[search]"]', WebDriverKeys::ENTER);
+        $I->waitForElementVisible('#terSearchTable');
+        $I->canSeeNumberOfElements('#terSearchTable tbody tr', 1);
+        $I->canSee('Needed Extension');
+    }
+
+    /**
+     * @param Admin $I
+     */
+    public function checkSearchFilterListFindsPartOfExtensionKey(Admin $I)
+    {
+        $I->fillField('input[name="tx_extensionmanager_tools_extensionmanagerextensionmanager[search]"]', 'ext');
+        $I->click('Go');
+        $I->waitForElementVisible('#terSearchTable');
+        $I->canSeeNumberOfElements('#terSearchTable tbody tr', 2);
+        $I->canSee('Super Extension');
+        $I->canSee('Needed Extension');
+    }
+}
diff --git a/typo3/sysext/core/Tests/Acceptance/Fixtures/tx_extensionmanager_domain_model_extension.xml b/typo3/sysext/core/Tests/Acceptance/Fixtures/tx_extensionmanager_domain_model_extension.xml
new file mode 100644 (file)
index 0000000..fe10af6
--- /dev/null
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="utf-8"?>
+<dataset>
+    <tx_extensionmanager_domain_model_extension>
+        <uid>1</uid>
+        <pid>0</pid>
+        <extension_key>superext</extension_key>
+        <repository>1</repository>
+        <version>1.0.0</version>
+        <alldownloadcounter>1</alldownloadcounter>
+        <downloadcounter>0</downloadcounter>
+        <title>Super extension</title>
+        <description>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam</description>
+        <state>2</state>
+        <review_state>0</review_state>
+        <category>2</category>
+        <last_updated>1474625908</last_updated>
+        <serialized_dependencies>a:1:{s:7:&quot;depends&quot;;a:1:{s:5:&quot;typo3&quot;;s:12:&quot;7.6.0-8.9.99&quot;;}}</serialized_dependencies>
+        <author_name>John Doe</author_name>
+        <author_email>john@doe.com</author_email>
+        <ownerusername>jdoe</ownerusername>
+        <md5hash>fa061138fc220bdfe5c631ba019f9f84</md5hash>
+        <update_comment> Update comment</update_comment>
+        <authorcompany></authorcompany>
+        <integer_version>1000000</integer_version>
+        <current_version>1</current_version>
+        <lastreviewedversion>0</lastreviewedversion>
+    </tx_extensionmanager_domain_model_extension>
+    <tx_extensionmanager_domain_model_extension>
+        <uid>2</uid>
+        <pid>0</pid>
+        <extension_key>neededext</extension_key>
+        <repository>1</repository>
+        <version>2.0.0</version>
+        <alldownloadcounter>2</alldownloadcounter>
+        <downloadcounter>0</downloadcounter>
+        <title>Needed Extension</title>
+        <description>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut</description>
+        <state>2</state>
+        <review_state>0</review_state>
+        <category>5</category>
+        <last_updated>1474977787</last_updated>
+        <serialized_dependencies>a:1:{s:7:&quot;depends&quot;;a:3:{s:5:&quot;typo3&quot;;s:13:&quot;6.2.0-8.4.999&quot;;s:3:&quot;php&quot;;s:13:&quot;5.4.0-7.0.999&quot;;s:9:&quot;scheduler&quot;;s:13:&quot;6.2.0-8.4.999&quot;;}}</serialized_dependencies>
+        <author_name>Dmitry Dulepov</author_name>
+        <author_email>dmitry.dulepov@gmail.com</author_email>
+        <ownerusername>dmitry</ownerusername>
+        <md5hash>b28075aa867d17cc97c7acfe187a71d1</md5hash>
+        <update_comment>no comment</update_comment>
+        <authorcompany></authorcompany>
+        <integer_version>2000000</integer_version>
+        <current_version>1</current_version>
+        <lastreviewedversion>0</lastreviewedversion>
+    </tx_extensionmanager_domain_model_extension>
+
+</dataset>
diff --git a/typo3/sysext/core/Tests/Acceptance/Fixtures/tx_extensionmanager_domain_model_repository.xml b/typo3/sysext/core/Tests/Acceptance/Fixtures/tx_extensionmanager_domain_model_repository.xml
new file mode 100644 (file)
index 0000000..07e8491
--- /dev/null
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<dataset>
+    <tx_extensionmanager_domain_model_repository>
+        <pid>0</pid>
+        <title>TYPO3.org Main Repository</title>
+        <description>Main repository on typo3.org. This repository has some mirrors configured which are available with
+            the mirror url.
+        </description>
+        <wsdl_url>https://typo3.org/wsdl/tx_ter_wsdl.php</wsdl_url>
+        <mirror_list_url>https://repositories.typo3.org/mirrors.xml.gz</mirror_list_url>
+        <last_update>1477500928</last_update>
+        <extension_count>2</extension_count>
+    </tx_extensionmanager_domain_model_repository>
+</dataset>
index 543e8f0..481821b 100644 (file)
@@ -135,6 +135,8 @@ class AcceptanceCoreEnvironment extends Extension
         'typo3/sysext/core/Tests/Acceptance/Fixtures/be_sessions.xml',
         'typo3/sysext/core/Tests/Acceptance/Fixtures/be_groups.xml',
         'typo3/sysext/core/Tests/Acceptance/Fixtures/sys_category.xml',
+        'typo3/sysext/core/Tests/Acceptance/Fixtures/tx_extensionmanager_domain_model_extension.xml',
+        'typo3/sysext/core/Tests/Acceptance/Fixtures/tx_extensionmanager_domain_model_repository.xml',
     ];
 
     /**