Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add methods to toggle disable/enable sharing settings #32043

Merged
merged 1 commit into from
Jul 16, 2018

Conversation

paurakhsharma
Copy link
Member

Description

This PR adds toggle functions to disabling/enabling sharing settings.

Related Issue

#31983

How Has This Been Tested?

Locally

Types of changes

  • Tests

Checklist:

  • Acceptance tests added

@codecov
Copy link

codecov bot commented Jul 13, 2018

Codecov Report

Merging #32043 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master   #32043   +/-   ##
=========================================
  Coverage      63.6%    63.6%           
  Complexity    18562    18562           
=========================================
  Files          1169     1169           
  Lines         69703    69703           
  Branches       1264     1264           
=========================================
  Hits          44338    44338           
  Misses        24996    24996           
  Partials        369      369
Flag Coverage Δ Complexity Δ
#javascript 52.59% <ø> (ø) 0 <ø> (ø) ⬇️
#phpunit 64.86% <ø> (ø) 18562 <ø> (ø) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fb1880d...1bc0235. Read the comment docs.

@paurakhsharma paurakhsharma force-pushed the UI-test-more-adminSharingSettings branch from fbfe15f to 8ae60b0 Compare July 13, 2018 10:30
@paurakhsharma paurakhsharma changed the title Add methods to disable or enable sharing settings Add methods to toggle disable/enable sharing settings Jul 13, 2018
public function theAdminDisablesTheShareApiUsingTheWebUI() {
$this->adminSharingSettingsPage->disableShareApi();
public function adminTogglesShareApiUsingTheWebui($requiredState) {
$this->getSession()->reload();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need the reloads everywhere?

$this->adminSharingSettingsPage->waitForAjaxCallsToStartAndFinish(
$this->getSession()
);
}

/**
* @When the admin disables share via link using the webUI
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could use regular expression in the step to have the same line for enable/disable, then you could use the old steps and don't need to change existing scenarios

*
* @return void
*/
public function disableShareApi() {
public function toggleShareApi($requiredState) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A lot of duplicated in the toggle functions, maybe we can combine them?

@paurakhsharma paurakhsharma force-pushed the UI-test-more-adminSharingSettings branch 2 times, most recently from 232b9ec to b2a653e Compare July 16, 2018 09:43
$shareApiCheckbox->click();
public function toggleCheckbox($action, $checkboxXpath, $checkboxId) {
$checkbox = $this->find("xpath", $checkboxXpath);
$checkCheckbox = $this->findById($checkboxId);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please check if find*() returns null

* Disable users to share via link
* toggle the Share API
*
* @param string $action e.g "|enables|disables|"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not "e.g." only "enables" or "disables" can be used

| capability | path_to_element | value |
| files_sharing | public@@@password@@@enforced_for@@@upload_only | EMPTY |

Scenario: enable resharing
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wrong indent

@paurakhsharma paurakhsharma force-pushed the UI-test-more-adminSharingSettings branch from b2a653e to 1bc0235 Compare July 16, 2018 10:06
@paurakhsharma
Copy link
Member Author

@individual-it can you please review it again. Thank you 🙂

@individual-it
Copy link
Member

looks good lets see what 🤖 says
please backport

@paurakhsharma
Copy link
Member Author

@PVince81 Some problem with codecov. Can you please merge this PR.

@PVince81 PVince81 merged commit 70b57d8 into master Jul 16, 2018
@PVince81 PVince81 deleted the UI-test-more-adminSharingSettings branch July 16, 2018 10:44
@PVince81
Copy link
Contributor

please backport

@paurakhsharma
Copy link
Member Author

Ok, thank you

@paurakhsharma
Copy link
Member Author

Backport on #32054

@lock
Copy link

lock bot commented Jul 30, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jul 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants