summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.drone.yml9
-rw-r--r--lib/private/Repair/Collation.php5
-rw-r--r--tests/acceptance/features/app-comments.feature2
-rw-r--r--tests/acceptance/features/bootstrap/CommentsAppContext.php64
4 files changed, 44 insertions, 36 deletions
diff --git a/.drone.yml b/.drone.yml
index 614c0dc40c2..1c7eba5f0f2 100644
--- a/.drone.yml
+++ b/.drone.yml
@@ -549,6 +549,13 @@ pipeline:
when:
matrix:
TESTS-ACCEPTANCE: access-levels
+ acceptance-app-comments:
+ image: nextcloudci/integration-php7.0:integration-php7.0-6
+ commands:
+ - tests/acceptance/run-local.sh --timeout-multiplier 10 --nextcloud-server-domain acceptance-app-comments --selenium-server selenium:4444 allow-git-repository-modifications features/app-comments.feature
+ when:
+ matrix:
+ TESTS-ACCEPTANCE: app-comments
acceptance-app-files:
image: nextcloudci/integration-php7.0:integration-php7.0-6
commands:
@@ -727,6 +734,8 @@ matrix:
- TESTS: acceptance
TESTS-ACCEPTANCE: access-levels
- TESTS: acceptance
+ TESTS-ACCEPTANCE: app-comments
+ - TESTS: acceptance
TESTS-ACCEPTANCE: app-files
- TESTS: acceptance
TESTS-ACCEPTANCE: app-theming
diff --git a/lib/private/Repair/Collation.php b/lib/private/Repair/Collation.php
index 2642985371b..f2cc9373176 100644
--- a/lib/private/Repair/Collation.php
+++ b/lib/private/Repair/Collation.php
@@ -6,6 +6,7 @@
* @author Morris Jobke <hey@morrisjobke.de>
* @author Robin Appelman <robin@icewind.nl>
* @author Thomas Müller <thomas.mueller@tmit.eu>
+ * @author Robin Müller <robin.mueller@1und1.de>
*
* @license AGPL-3.0
*
@@ -124,7 +125,7 @@ class Collation implements IRepairStep {
" FROM INFORMATION_SCHEMA . COLUMNS" .
" WHERE TABLE_SCHEMA = ?" .
" AND (COLLATION_NAME <> '" . $characterSet . "_bin' OR CHARACTER_SET_NAME <> '" . $characterSet . "')" .
- " AND TABLE_NAME LIKE \"*PREFIX*%\"",
+ " AND TABLE_NAME LIKE '*PREFIX*%'",
array($dbName)
);
$rows = $statement->fetchAll();
@@ -139,7 +140,7 @@ class Collation implements IRepairStep {
" FROM INFORMATION_SCHEMA . TABLES" .
" WHERE TABLE_SCHEMA = ?" .
" AND TABLE_COLLATION <> '" . $characterSet . "_bin'" .
- " AND TABLE_NAME LIKE \"*PREFIX*%\"",
+ " AND TABLE_NAME LIKE '*PREFIX*%'",
[$dbName]
);
$rows = $statement->fetchAll();
diff --git a/tests/acceptance/features/app-comments.feature b/tests/acceptance/features/app-comments.feature
index 81fc6f89ad1..a5bdb0aa745 100644
--- a/tests/acceptance/features/app-comments.feature
+++ b/tests/acceptance/features/app-comments.feature
@@ -5,4 +5,4 @@ Feature: app-comments
And I open the details view for "welcome.txt"
And I open the "Comments" tab in the details view
When I create a new comment with "Hello world" as message
- Then I see that a comment was added
+ Then I see a comment with "Hello world" as message
diff --git a/tests/acceptance/features/bootstrap/CommentsAppContext.php b/tests/acceptance/features/bootstrap/CommentsAppContext.php
index 64d1dc69bc4..7e804cfac23 100644
--- a/tests/acceptance/features/bootstrap/CommentsAppContext.php
+++ b/tests/acceptance/features/bootstrap/CommentsAppContext.php
@@ -26,57 +26,55 @@ use Behat\Behat\Context\Context;
class CommentsAppContext implements Context, ActorAwareInterface {
use ActorAware;
-
/**
- * @When /^I create a new comment with "([^"]*)" as message$/
+ * @return Locator
*/
- public function iCreateANewCommentWithAsMessage($commentText) {
- $this->actor->find(self::newCommentField(), 2)->setValue($commentText);
- $this->actor->find(self::submitNewCommentButton(), 2)->click();
+ public static function newCommentField() {
+ return Locator::forThe()->css("div.newCommentRow .message")->
+ descendantOf(FilesAppContext::currentSectionDetailsView())->
+ describedAs("New comment field in current section details view in Files app");
}
/**
- * @Then /^I see that a comment was added$/
+ * @return Locator
*/
- public function iSeeThatACommentWasAdded() {
- $self = $this;
-
- $result = Utils::waitFor(function () use ($self) {
- return $self->isCommentAdded();
- }, 5, 0.5);
-
- PHPUnit_Framework_Assert::assertTrue($result);
+ public static function submitNewCommentButton() {
+ return Locator::forThe()->css("div.newCommentRow .submit")->
+ descendantOf(FilesAppContext::currentSectionDetailsView())->
+ describedAs("Submit new comment button in current section details view in Files app");
}
- public function isCommentAdded() {
- try {
- $locator = self::commentFields();
- $comments = $this->actor->getSession()->getPage()->findAll($locator->getSelector(), $locator->getLocator());
- PHPUnit_Framework_Assert::assertSame(1, count($comments));
- } catch (PHPUnit_Framework_ExpectationFailedException $e) {
- return false;
- }
- return true;
+ /**
+ * @return Locator
+ */
+ public static function commentList() {
+ return Locator::forThe()->css("ul.comments")->
+ descendantOf(FilesAppContext::currentSectionDetailsView())->
+ describedAs("Comment list in current section details view in Files app");
}
/**
* @return Locator
*/
- public static function newCommentField() {
- return Locator::forThe()->css("div.newCommentRow .message")->descendantOf(FilesAppContext::currentSectionDetailsView())->
- describedAs("New comment field in the details view in Files app");
+ public static function commentWithText($text) {
+ return Locator::forThe()->xpath("//div[normalize-space() = '$text']/ancestor::li")->
+ descendantOf(self::commentList())->
+ describedAs("Comment with text \"$text\" in current section details view in Files app");
}
- public static function commentFields() {
- return Locator::forThe()->css(".comments .comment .message")->descendantOf(FilesAppContext::currentSectionDetailsView())->
- describedAs("Comment fields in the details view in Files app");
+ /**
+ * @When /^I create a new comment with "([^"]*)" as message$/
+ */
+ public function iCreateANewCommentWithAsMessage($commentText) {
+ $this->actor->find(self::newCommentField(), 10)->setValue($commentText);
+ $this->actor->find(self::submitNewCommentButton())->click();
}
/**
- * @return Locator
+ * @Then /^I see a comment with "([^"]*)" as message$/
*/
- public static function submitNewCommentButton() {
- return Locator::forThe()->css("div.newCommentRow .submit")->descendantOf(FilesAppContext::currentSectionDetailsView())->
- describedAs("Submit new comment button in the details view in Files app");
+ public function iSeeACommentWithAsMessage($commentText) {
+ PHPUnit_Framework_Assert::assertTrue(
+ $this->actor->find(self::commentWithText($commentText), 10)->isVisible());
}
}