* @return Locator
*/
public static function fileNameInDetailsView() {
- return Locator::forThe()->css(".fileName")->
+ return Locator::forThe()->css(".app-sidebar-header__title")->
descendantOf(self::detailsView())->
describedAs("File name in details view in Files app");
}
* @return Locator
*/
public static function favoriteActionInFileDetailsInDetailsView() {
- return Locator::forThe()->css(".action-favorite")->
+ return Locator::forThe()->css(".app-sidebar-header__star")->
descendantOf(self::fileDetailsInDetailsView())->
describedAs("Favorite action in file details in details view in Files app");
}
* @return Locator
*/
private static function fileDetailsInDetailsView() {
- return Locator::forThe()->css(".file-details")->
+ return Locator::forThe()->css(".app-sidebar-header__desc")->
descendantOf(self::detailsView())->
describedAs("File details in details view in Files app");
}
* @return Locator
*/
private static function tabHeadersInDetailsView() {
- return Locator::forThe()->css(".tabHeaders")->
+ return Locator::forThe()->css(".app-sidebar-tabs__nav")->
descendantOf(self::detailsView())->
describedAs("Tab headers in details view in Files app");
}
* @return Locator
*/
public static function tabInDetailsViewNamed($tabName) {
- return Locator::forThe()->xpath("//div[@id=//*[contains(concat(' ', normalize-space(@class), ' '), ' tabHeader ') and normalize-space() = '$tabName']/@data-tabid]")->
+ return Locator::forThe()->xpath("//div[contains(concat(' ', normalize-space(@class), ' '), ' app-sidebar-tabs__content ')]/section[@aria-labelledby = '$tabName' and @role = 'tabpanel']")->
descendantOf(self::detailsView())->
describedAs("Tab named $tabName in details view in Files app");
}
* @return Locator
*/
public static function loadingIconForTabInDetailsViewNamed($tabName) {
- return Locator::forThe()->css(".loading")->
+ return Locator::forThe()->css(".icon-loading")->
descendantOf(self::tabInDetailsViewNamed($tabName))->
describedAs("Loading icon for tab named $tabName in details view in Files app");
}
* @return Locator
*/
public static function sharedByLabel() {
- return Locator::forThe()->css(".reshare")->
+ return Locator::forThe()->css(".sharing-entry__reshare")->
descendantOf(FilesAppContext::detailsView())->
describedAs("Shared by label in the details view in Files app");
}
* @return Locator
*/
public static function shareWithInput() {
- return Locator::forThe()->css(".shareWithField")->
+ return Locator::forThe()->css(".sharing-input .multiselect__input")->
descendantOf(FilesAppContext::detailsView())->
describedAs("Share with input in the details view in Files app");
}
+ /**
+ * @return Locator
+ */
+ public static function shareWithInputResults() {
+ return Locator::forThe()->css(".sharing-input .multiselect__content-wrapper")->
+ descendantOf(FilesAppContext::detailsView())->
+ describedAs("Share with input results list in the details view in Files app");
+ }
+
+ /**
+ * @return Locator
+ */
+ public static function shareWithInputResult($result) {
+ return Locator::forThe()->xpath("//li[contains(concat(' ', normalize-space(@class), ' '), ' multiselect__element ')]//span[normalize-space() = '$result']/ancestor::li")->
+ descendantOf(self::shareWithInputResults())->
+ describedAs("Share with input result from the results list in the details view in Files app");
+ }
+
/**
* @return Locator
*/
public static function shareeList() {
- return Locator::forThe()->css(".shareeListView")->
+ return Locator::forThe()->css(".sharing-sharee-list")->
descendantOf(FilesAppContext::detailsView())->
describedAs("Sharee list in the details view in Files app");
}
public static function sharedWithRow($sharedWithName) {
// "username" class is used for any type of share, not only for shares
// with users.
- return Locator::forThe()->xpath("//span[contains(concat(' ', normalize-space(@class), ' '), ' username ') and normalize-space() = '$sharedWithName']/ancestor::li")->
+ return Locator::forThe()->xpath("//li[contains(concat(' ', normalize-space(@class), ' '), ' sharing-entry ')]//h5[normalize-space() = '$sharedWithName']/ancestor::li")->
descendantOf(self::shareeList())->
describedAs("Shared with $sharedWithName row in the details view in Files app");
}
* @return Locator
*/
public static function shareWithMenuButton($sharedWithName) {
- return Locator::forThe()->css(".share-menu > .icon")->
+ return Locator::forThe()->css(".sharing-entry__actions > .action-item__menutoggle")->
descendantOf(self::sharedWithRow($sharedWithName))->
describedAs("Share with $sharedWithName menu button in the details view in Files app");
}
* @return Locator
*/
public static function shareWithMenu($sharedWithName) {
- return Locator::forThe()->css(".share-menu > .menu")->
+ return Locator::forThe()->css(".sharing-entry__actions > .action-item__menu")->
descendantOf(self::sharedWithRow($sharedWithName))->
describedAs("Share with $sharedWithName menu in the details view in Files app");
}
* @return Locator
*/
public static function shareLinkRow() {
- return Locator::forThe()->css(".linkShareView .shareWithList:first-child")->
+ return Locator::forThe()->css(".sharing-link-list .sharing-entry__link:first-child")->
descendantOf(FilesAppContext::detailsView())->
describedAs("Share link row in the details view in Files app");
}
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")->
+ return Locator::forThe()->css(".action-item.icon-add")->
descendantOf(self::shareLinkRow())->
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")->
+ return Locator::forThe()->css("a.sharing-entry__copy")->
descendantOf(self::shareLinkRow())->
describedAs("Copy link button in the details view in Files app");
}
* @return Locator
*/
public static function shareLinkMenuButton() {
- return Locator::forThe()->css(".share-menu > .icon")->
+ return Locator::forThe()->css(".sharing-entry__actions .action-item__menutoggle")->
descendantOf(self::shareLinkRow())->
describedAs("Share link menu button in the details view in Files app");
}
* @return Locator
*/
public static function shareLinkMenu() {
- return Locator::forThe()->css(".share-menu > .menu")->
+ return Locator::forThe()->css(".sharing-entry__actions .action-item__menu")->
descendantOf(self::shareLinkRow())->
describedAs("Share link menu in the details view in Files app");
}
* @return Locator
*/
public static function passwordProtectField() {
- return Locator::forThe()->css(".linkPassText")->descendantOf(self::shareLinkMenu())->
+ return Locator::forThe()->css(".share-link-password input.action-input__input")->descendantOf(self::shareLinkMenu())->
describedAs("Password protect field in the details view in Files app");
}
/**
* @return Locator
*/
- public static function passwordProtectWorkingIcon() {
- return Locator::forThe()->css(".linkPassMenu .icon-loading-small")->descendantOf(self::shareLinkMenu())->
- describedAs("Password protect working icon in the details view in Files app");
+ public static function disabledPasswordProtectField() {
+ return Locator::forThe()->css(".share-link-password input.action-input__input[disabled]")->descendantOf(self::shareLinkMenu())->
+ describedAs("Disabled password protect field in the details view in Files app");
}
/**
public function iShareWith($fileName, $shareWithName) {
$this->actor->find(FileListContext::shareActionForFile(FilesAppContext::currentSectionMainView(), $fileName), 10)->click();
- $this->actor->find(self::shareWithInput(), 5)->setValue($shareWithName . "\r");
+ $this->actor->find(self::shareWithInput(), 5)->setValue($shareWithName);
+ // "setValue()" ends sending a tab, which unfocuses the input and causes
+ // the results to be hidden, so the input needs to be clicked to show
+ // the results again.
+ $this->actor->find(self::shareWithInput())->click();
+ $this->actor->find(self::shareWithInputResult($shareWithName), 5)->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::copyLinkButton(), 2)->getWrappedElement()->getAttribute("data-clipboard-text");
+ $this->actor->getSharedNotebook()["shared link"] = $this->actor->find(self::copyLinkButton(), 2)->getWrappedElement()->getAttribute("href");
}
/**
}
/**
- * @Then I see that the working icon for password protect is shown
+ * @Then I see that the password protect is disabled while loading
*/
- public function iSeeThatTheWorkingIconForPasswordProtectIsShown() {
- PHPUnit_Framework_Assert::assertNotNull($this->actor->find(self::passwordProtectWorkingIcon(), 10));
- }
+ public function iSeeThatThePasswordProtectIsDisabledWhileLoading() {
+ PHPUnit_Framework_Assert::assertNotNull($this->actor->find(self::disabledPasswordProtectField(), 10));
- /**
- * @Then I see that the working icon for password protect is eventually not shown
- */
- public function iSeeThatTheWorkingIconForPasswordProtectIsEventuallyNotShown() {
if (!WaitFor::elementToBeEventuallyNotShown(
$this->actor,
- self::passwordProtectWorkingIcon(),
+ self::disabledPasswordProtectField(),
$timeout = 10 * $this->actor->getFindTimeoutMultiplier())) {
- PHPUnit_Framework_Assert::fail("The working icon for password protect is still shown after $timeout seconds");
+ PHPUnit_Framework_Assert::fail("The password protect field is still disabled after $timeout seconds");
}
}
public function iShareTheLinkForProtectedByThePassword($fileName, $password) {
$this->iShareTheLinkFor($fileName);
$this->iProtectTheSharedLinkWithThePassword($password);
- $this->iSeeThatTheWorkingIconForPasswordProtectIsShown();
- $this->iSeeThatTheWorkingIconForPasswordProtectIsEventuallyNotShown();
+ $this->iSeeThatThePasswordProtectIsDisabledWhileLoading();
}
private function showShareLinkMenuIfNeeded() {