Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2018-11-02 00:36:09 +0300
committerGitHub <noreply@github.com>2018-11-02 00:36:09 +0300
commitf28691c26edb5b6f01330946445316d25d175fcb (patch)
tree77bc0b87e611677611750cd668be7e106a8b84a5 /tests
parent35e3d40e803653e2fdfcd775eefc2d8a9a183d80 (diff)
parent876d6ec8e6b1e38215659fd606b7d7022bdb8460 (diff)
Merge pull request #11844 from nextcloud/multiple-link-shares
allow to create multiple link shares via share api
Diffstat (limited to 'tests')
-rw-r--r--tests/acceptance/features/bootstrap/FilesAppContext.php39
1 files changed, 18 insertions, 21 deletions
diff --git a/tests/acceptance/features/bootstrap/FilesAppContext.php b/tests/acceptance/features/bootstrap/FilesAppContext.php
index 4b648bfc544..459028813b5 100644
--- a/tests/acceptance/features/bootstrap/FilesAppContext.php
+++ b/tests/acceptance/features/bootstrap/FilesAppContext.php
@@ -188,7 +188,7 @@ class FilesAppContext implements Context, ActorAwareInterface {
* @return Locator
*/
public static function shareLinkRow() {
- return Locator::forThe()->id("shareLink")->
+ return Locator::forThe()->css(".linkShareView .shareWithList:first-child")->
descendantOf(self::detailsView())->
describedAs("Share link row in the details view in Files app");
}
@@ -196,13 +196,21 @@ class FilesAppContext implements Context, ActorAwareInterface {
/**
* @return Locator
*/
- public static function shareLinkCheckbox() {
- // forThe()->checkbox("Enable") can not be used here; that would return
- // the checkbox itself, but the element that the user interacts with is
- // the label.
- return Locator::forThe()->xpath("//label[normalize-space() = 'Enable']")->
+ public static function shareLinkAddNewButton() {
+ // When there is no link share the "Add new share" item is shown instead
+ // of the menu button as a direct child of ".share-menu".
+ return Locator::forThe()->css(".share-menu > .new-share")->
descendantOf(self::shareLinkRow())->
- describedAs("Share link checkbox in the details view in Files app");
+ describedAs("Add new share link button in the details view in Files app");
+ }
+
+ /**
+ * @return Locator
+ */
+ public static function copyLinkButton() {
+ return Locator::forThe()->css("a.clipboard-button")->
+ descendantOf(self::shareLinkRow())->
+ describedAs("Copy link button in the details view in Files app");
}
/**
@@ -226,15 +234,6 @@ class FilesAppContext implements Context, ActorAwareInterface {
/**
* @return Locator
*/
- public static function copyUrlMenuItem() {
- return Locator::forThe()->xpath("//a[normalize-space() = 'Copy link']")->
- descendantOf(self::shareLinkMenu())->
- describedAs("Copy link menu item in the share link menu in the details view in Files app");
- }
-
- /**
- * @return Locator
- */
public static function hideDownloadCheckbox() {
// forThe()->checkbox("Hide download") can not be used here; that would
// return the checkbox itself, but the element that the user interacts
@@ -320,21 +319,19 @@ class FilesAppContext implements Context, ActorAwareInterface {
public function iShareTheLinkFor($fileName) {
$this->actor->find(FileListContext::shareActionForFile(self::currentSectionMainView(), $fileName), 10)->click();
- $this->actor->find(self::shareLinkCheckbox(), 5)->click();
+ $this->actor->find(self::shareLinkAddNewButton(), 5)->click();
}
/**
* @Given I write down the shared link
*/
public function iWriteDownTheSharedLink() {
- $this->showShareLinkMenuIfNeeded();
-
- $this->actor->find(self::copyUrlMenuItem(), 2)->click();
+ $this->actor->find(self::copyLinkButton(), 10)->click();
// Clicking on the menu item copies the link to the clipboard, but it is
// not possible to access that value from the acceptance tests. Due to
// this the value of the attribute that holds the URL is used instead.
- $this->actor->getSharedNotebook()["shared link"] = $this->actor->find(self::copyUrlMenuItem(), 2)->getWrappedElement()->getAttribute("data-clipboard-text");
+ $this->actor->getSharedNotebook()["shared link"] = $this->actor->find(self::copyLinkButton(), 2)->getWrappedElement()->getAttribute("data-clipboard-text");
}
/**