Legoktm has submitted this change and it was merged.

Change subject: Remove system / selenium tests
......................................................................


Remove system / selenium tests

These were implemented as part of the initial
structured development this extensions went
through.
Now these will be removed until the extension
gets to a beta / stable state and could then
be re implemented if needed.

Change-Id: I2fac3c83c26381eb2de6c71b64714e221602035d
---
D composer.json
D tests/system/ApiTest.php
D tests/system/CreateAndSaveMassActionTest.php
D tests/system/MassActionTestCase.php
D tests/system/SpecialPageTest.php
D tests/system/bootstrap.php
D tests/system/phpunit.xml.dist
7 files changed, 0 insertions(+), 249 deletions(-)

Approvals:
  Legoktm: Verified; Looks good to me, approved
  Addshore: Checked



diff --git a/composer.json b/composer.json
deleted file mode 100644
index 4ff4be7..0000000
--- a/composer.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
-       "require-dev": {
-               "phpunit/phpunit-selenium": "1.4.2"
-       }
-}
\ No newline at end of file
diff --git a/tests/system/ApiTest.php b/tests/system/ApiTest.php
deleted file mode 100644
index 11d3f16..0000000
--- a/tests/system/ApiTest.php
+++ /dev/null
@@ -1,16 +0,0 @@
-<?php
-
-/**
- * @author Adam Shorland
- *
- * @group E2
- * @group T2
- */
-class ApiTest extends MassActionTestCase {
-
-       public function testSpecialPageRegisteredAndAccessible() {
-               $this->gotoApiEntryPoint();
-               $this->assertTrue($this->isElementPresent("link=massaction"));
-       }
-
-} 
\ No newline at end of file
diff --git a/tests/system/CreateAndSaveMassActionTest.php 
b/tests/system/CreateAndSaveMassActionTest.php
deleted file mode 100644
index 6af7fd3..0000000
--- a/tests/system/CreateAndSaveMassActionTest.php
+++ /dev/null
@@ -1,141 +0,0 @@
-<?php
-
-/**
- * @author Adam Shorland
- *
- * @group E1
- * @group E3
- * @group E4
- * @group E8
- * @group E9
- * @group E10
- * @group E11
- * @group E12
- * @group E13
- * @group I1
- * @group I2
- * @group I3
- * @group A1
- * @group A2
- * @group A3
- * @group T3
- */
-class CreateAndSaveMassActionTest extends MassActionTestCase {
-
-       public function testMassActionSequence() {
-               $time = strval( time() );
-               $this->createArticle( $time . '-A', 'Foo Content Bar' );
-               $this->createArticle( $time . '-B', 'Foo Content Bar' );
-               $this->createArticle( 'User:' . $time . '-X', 'Foo Content Bar' 
);
-               $this->createArticle( 'Project:' . $time . '-1', 'Foo Content 
Bar' );
-               $this->createArticle( 'Project:' . $time . '-2', 'Foo Content 
Bar' );
-               $this->createArticle( 'Project:' . $time . '-User', '#REDIRECT 
[[User:' . $time . '-X]]' );
-
-               $this->open("/w/index.php/Special:MassAction");
-               $this->waitForPageToLoad("30000");
-               $this->clickAndWait("link=New Task");
-               
$this->clickAndWait("css=a[title=\"Special:MassAction/New/Wikipage\"]");
-
-               $summary = "This is a test summary";
-               $this->type("id=mw-input-wpsummary", $summary);
-
-               $this->click("id=mw-input-wpPageMatcherNamespaceEnabled");
-               $this->click("id=mw-input-wpPageMatcherNamespaceOptions-ns-0");
-               $this->click("id=mw-input-wpPageMatcherNamespaceOptions-ns-4");
-               $this->click("id=mw-input-wpPageMatcherRedirectEnabled");
-
-               $titleRegex = "^" . $time;
-               $this->click("id=mw-input-wpPageMatcherTitleRegexEnabled");
-               $this->type("id=mw-input-wpPageMatcherTitleRegex", $titleRegex 
);
-
-               $append = "'new quoted text'";
-               $this->click("id=mw-input-wpPageActionAppendText--create");
-               
$this->type("id=mw-input-wpPageActionAppendText--clone1--PageActionAppendText", 
$append);
-
-               $regexReplace = "/content/i";
-               $regexReplaceWith = "Stuff";
-               $this->click("id=mw-input-wpPageActionRegexReplace--create");
-               
$this->type("id=mw-input-wpPageActionRegexReplace--clone2--PageActionRegexReplacePattern",
 $regexReplace);
-               
$this->type("id=mw-input-wpPageActionRegexReplace--clone2--PageActionRegexReplaceReplacement",
 $regexReplaceWith);
-
-               //Save button
-               echo "Saving task\n";
-               $this->clickAndWait("css=span.mw-htmlform-submit-buttons > 
input.mw-htmlform-submit");
-
-               $this->clickAndWait("link=View Task");
-               $taskLocation = $this->getLocation();
-
-               $this->runJobs();
-               $this->open( $taskLocation );
-               $this->waitForPageToLoad("30000");
-
-               $this->assertStringEndsWith( $summary, 
$this->getText("id=ma-summary") );
-               $this->assertStringEndsWith( 'Wikipage', 
$this->getText("id=ma-targettype") );
-               $this->assertEquals("State: Targets Found", 
$this->getText("id=ma-state"));
-
-               $this->assertRegExp( '/' . $append . '/', 
$this->getText("//ul[@id='ma-actions']/li[1]") );
-               $this->assertRegExp( '/' . preg_quote( $regexReplace, '/' ) . 
'/', $this->getText("//ul[@id='ma-actions']/li[2]") );
-               $this->assertRegExp( '/' . $regexReplaceWith . '/', 
$this->getText("//ul[@id='ma-actions']/li[2]") );
-
-               $this->assertEquals("Matches the following namespaces (0, 4)", 
$this->getText("//ul[@id='ma-matchers']/li[1]"));
-               $this->assertEquals("Matches Non Redirects", 
$this->getText("//ul[@id='ma-matchers']/li[2]"));
-               $this->assertEquals("Matches pages with titles matches regex '" 
. $titleRegex . "'", $this->getText("//ul[@id='ma-matchers']/li[3]"));
-
-               $this->assertEquals("Targets (4)", 
$this->getText("//div[@id='mw-content-text']/h2[3]"));
-               $this->assertEquals($time . "-A", 
$this->getTable("id=ma-targets.1.1"));
-               $this->assertEquals("Unprocessed", 
$this->getTable("id=ma-targets.1.2"));
-               $this->assertEquals($time . "-B", 
$this->getTable("id=ma-targets.2.1"));
-               $this->assertEquals("Unprocessed", 
$this->getTable("id=ma-targets.2.2"));
-               $this->assertEquals("Project:" . $time . "-1", 
$this->getTable("id=ma-targets.3.1"));
-               $this->assertEquals("Unprocessed", 
$this->getTable("id=ma-targets.3.2"));
-               $this->assertEquals("Project:" . $time . "-2", 
$this->getTable("id=ma-targets.4.1"));
-               $this->assertEquals("Unprocessed", 
$this->getTable("id=ma-targets.4.2"));
-
-               // Check the log!
-               $this->gotoSpecialPage( 'Log' );
-               $this->assertEquals("(This is a test summary)", 
$this->getText("//div[@id='mw-content-text']/ul/li[1]/span[2]"));
-               $this->goBackAndWait();
-
-               //Save 1
-               echo "Saving 1\n";
-               $this->clickAndWait("xpath=(//input[@value='Save'])[2]");
-               $this->assertEquals("Change Saving", 
$this->getTable("id=ma-targets.2.2"));
-               $this->runJobs();
-               $this->goBackAndWait();
-               sleep(1);//sleep to make sure db is updated
-               $this->refreshAndWait();
-               $this->assertEquals("Change Saved", 
$this->getTable("id=ma-targets.2.2"));
-               $this->clickAndWait("link=" . $time . "-B");
-               $this->assertEquals("Foo Stuff Bar" . $append, 
$this->getText("css=p"));
-
-               //Save all
-               echo "Saving all\n";
-               $this->open( $taskLocation );
-               $this->waitForPageToLoad("30000");
-               $this->clickAndWait("css=input.mw-htmlform-submit");
-
-               $this->assertEquals("State: Saving All Changes", 
$this->getText("id=ma-state"));
-
-               $this->runJobs();
-               $this->goBackAndWait();
-               sleep(1);//sleep to make sure db is updated
-               $this->refreshAndWait();
-
-               $this->assertEquals("State: Completed", 
$this->getText("id=ma-state"));
-               $this->assertEquals("Change Saved", 
$this->getTable("id=ma-targets.1.2"));
-               $this->assertEquals("Change Saved", 
$this->getTable("id=ma-targets.2.2"));
-               $this->assertEquals("Change Saved", 
$this->getTable("id=ma-targets.3.2"));
-               $this->assertEquals("Change Saved", 
$this->getTable("id=ma-targets.4.2"));
-               $this->clickAndWait("link=" . $time . "-A");
-               $this->assertEquals("Foo Stuff Bar" . $append, 
$this->getText("css=p"));
-               $this->open( $taskLocation );
-               $this->waitForPageToLoad("30000");
-               $this->clickAndWait("link=exact:Project:" . $time . "-1");
-               $this->assertEquals("Foo Stuff Bar" . $append, 
$this->getText("css=p"));
-               $this->open( $taskLocation );
-               $this->waitForPageToLoad("30000");
-               $this->clickAndWait("link=exact:Project:" . $time . "-2");
-               $this->assertEquals("Foo Stuff Bar" . $append, 
$this->getText("css=p"));
-       }
-
-} 
\ No newline at end of file
diff --git a/tests/system/MassActionTestCase.php 
b/tests/system/MassActionTestCase.php
deleted file mode 100644
index 6256f9a..0000000
--- a/tests/system/MassActionTestCase.php
+++ /dev/null
@@ -1,44 +0,0 @@
-<?php
-
-/**
- * @author Adam Shorland
- */
-abstract class MassActionTestCase extends PHPUnit_Extensions_SeleniumTestCase {
-
-       private $path = "http://localhost/w/index.php/";;
-       private $apiPath = "http://localhost/w/api.php";;
-
-       public function setUp() {
-               $this->setBrowser("*chrome");
-               $this->setBrowserUrl($this->path);
-       }
-
-       public function runJobs() {
-               echo "Running Mediawiki jobs.\n";
-               exec( 'php ' . dirname( dirname( dirname( dirname( __DIR__ ) ) 
) ) . '/maintenance/runJobs.php' );
-       }
-
-       public function gotoSpecialPage( $page = 'SpecialPages' ) {
-               echo "Browsing to special page.\n";
-               $this->open($this->path . "Special:" . $page);
-               $this->waitForPageToLoad("30000");
-       }
-
-       public function gotoApiEntryPoint() {
-               echo "Browsing to API entry point.\n";
-               $this->open($this->apiPath);
-               $this->waitForPageToLoad("30000");
-       }
-
-       public function createArticle( $title, $content ) {
-               echo "Creating article $title\n";
-               $this->open("/w/index.php/" . $title);
-               $this->click("link=Create");
-               $this->waitForPageToLoad("30000");
-               $this->type("id=wpTextbox1", $content);
-               $this->type("id=wpSummary", "Automaticaly creating page for 
system test " . __METHOD__);
-               $this->click("id=wpSave");
-               $this->waitForPageToLoad("30000");
-       }
-
-}
\ No newline at end of file
diff --git a/tests/system/SpecialPageTest.php b/tests/system/SpecialPageTest.php
deleted file mode 100644
index 56bbefe..0000000
--- a/tests/system/SpecialPageTest.php
+++ /dev/null
@@ -1,19 +0,0 @@
-<?php
-
-/**
- * @author Adam Shorland
- *
- * @group E1
- * @group T1
- */
-class SpecialPageExistsTest extends MassActionTestCase {
-
-       public function testSpecialPageRegisteredAndAccessible() {
-               $this->gotoSpecialPage();
-               $this->assertTrue($this->isElementPresent("link=Mass Action 
Interface"));
-               $this->click("link=Mass Action Interface");
-               $this->waitForPageToLoad("30000");
-               $this->assertEquals("Mass Action", $this->getText("css=span"));
-       }
-
-} 
\ No newline at end of file
diff --git a/tests/system/bootstrap.php b/tests/system/bootstrap.php
deleted file mode 100644
index 5f1a68d..0000000
--- a/tests/system/bootstrap.php
+++ /dev/null
@@ -1,11 +0,0 @@
-<?php
-
-//Bootstrap file for running tests
-
-require_once( __DIR__ . '/../../vendor/autoload.php' );
-
-require_once( __DIR__ . '/MassActionTestCase.php' );
-
-if ( php_sapi_name() !== 'cli' ) {
-       die( 'Not an entry point' );
-}
diff --git a/tests/system/phpunit.xml.dist b/tests/system/phpunit.xml.dist
deleted file mode 100644
index 58fd934..0000000
--- a/tests/system/phpunit.xml.dist
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<phpunit bootstrap="./bootstrap.php" colors="true">
-    <testsuites>
-        <testsuite name="mediawiki/extensions/MassAction-system">
-            <directory suffix="Test.php">.</directory>
-        </testsuite>
-    </testsuites>
-    <matcher>
-        <whitelist addUncoveredFilesFromWhitelist="true">
-            <directory suffix=".php">src</directory>
-        </whitelist>
-    </matcher>
-</phpunit>
\ No newline at end of file

-- 
To view, visit https://gerrit.wikimedia.org/r/205303
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I2fac3c83c26381eb2de6c71b64714e221602035d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MassAction
Gerrit-Branch: master
Gerrit-Owner: Addshore <[email protected]>
Gerrit-Reviewer: Addshore <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to