Skip to content

Add acceptance test for checking changing sharing permissions#35166

Merged
individual-it merged 1 commit into
masterfrom
test-issue-35155
May 17, 2019
Merged

Add acceptance test for checking changing sharing permissions#35166
individual-it merged 1 commit into
masterfrom
test-issue-35155

Conversation

@dpakach

@dpakach dpakach commented May 7, 2019

Copy link
Copy Markdown
Contributor

Description

Add acceptance test for checking changing sharing permissions from

  1. read-write to upload-write-without-modify
  2. upload-write-without-modify to read-write

Related Issue

Motivation and Context

How Has This Been Tested?

🤖

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Database schema changes (next release will require increase of minor version instead of patch)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests only (no source changes)

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:

Open tasks:

  • Backport (if applicable set "backport-request" label and remove when the backport was done)

$name = \trim($name, $name[0]);
try {
$this->deleteTheFileUsingTheWebUI($name, false);
$retries = $expect ? 1 : null;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is this used anywhere?

* @throws \Exception
*/
public function itShouldNotBePossibleToDeleteFileFolderUsingTheWebUI($name) {
public function itShouldNotBePossibleToDeleteFileFolderUsingTheWebUI($shouldOrNot, $name) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can you split this function? It was too difficult for me to think about this.

@dpakach dpakach force-pushed the test-issue-35155 branch from 01bfa53 to 903d8b4 Compare May 12, 2019 17:51
@codecov

codecov Bot commented May 12, 2019

Copy link
Copy Markdown

Codecov Report

Merging #35166 into master will decrease coverage by 0.04%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #35166      +/-   ##
============================================
- Coverage     65.53%   65.49%   -0.05%     
+ Complexity    18645    18636       -9     
============================================
  Files          1218     1217       -1     
  Lines         70540    70536       -4     
  Branches       1288     1296       +8     
============================================
- Hits          46231    46195      -36     
- Misses        23932    23964      +32     
  Partials        377      377
Flag Coverage Δ Complexity Δ
#javascript 53.5% <ø> (-0.2%) 0 <ø> (ø)
#phpunit 66.87% <ø> (-0.03%) 18636 <ø> (-9)
Impacted Files Coverage Δ Complexity Δ
apps/files_sharing/lib/AppInfo/Application.php 50.48% <0%> (-7.21%) 17% <0%> (ø)
core/js/share.js 32.56% <0%> (-4.42%) 0% <0%> (ø)
apps/files_sharing/lib/Activity.php 5.34% <0%> (-2.95%) 97% <0%> (-3%)
apps/files_sharing/lib/Hooks.php 100% <0%> (ø) 34% <0%> (-1%) ⬇️
...es_sharing/lib/Controller/Share20OcsController.php 87.58% <0%> (ø) 203% <0%> (-1%) ⬇️
lib/private/Files/Mount/PreviewsMountProvider.php
lib/private/Server.php 86.68% <0%> (+0.1%) 253% <0%> (ø) ⬇️

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 4557dde...903d8b4. Read the comment docs.

@codecov

codecov Bot commented May 12, 2019

Copy link
Copy Markdown

Codecov Report

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

Impacted file tree graph

@@            Coverage Diff            @@
##             master   #35166   +/-   ##
=========================================
  Coverage     65.54%   65.54%           
  Complexity    18647    18647           
=========================================
  Files          1218     1218           
  Lines         70546    70546           
  Branches       1288     1288           
=========================================
  Hits          46236    46236           
  Misses        23933    23933           
  Partials        377      377
Flag Coverage Δ Complexity Δ
#javascript 53.69% <ø> (ø) 0 <ø> (ø) ⬇️
#phpunit 66.9% <ø> (ø) 18647 <ø> (ø) ⬇️

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 2873da5...32b9882. Read the comment docs.

* @throws \Exception
*/
public function optionShouldNotBeAvailable($action, $name, $shouldOrNot) {
$possible = $shouldOrNot !== "not";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🤦🏼

@dpakach dpakach force-pushed the test-issue-35155 branch 3 times, most recently from ddbcd3b to da02f0c Compare May 15, 2019 07:25
$btn = $this->find("xpath", $this->newFileFolderButtonXpath);
if ($btn === null) {
return false;
} else {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

else not required here

);
if (!$button) {
return false;
} else {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

else is not essential

@dpakach dpakach force-pushed the test-issue-35155 branch 2 times, most recently from 5be814d to 73e39cd Compare May 17, 2019 05:05

@individual-it individual-it left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

looks generally good to me, just a small request

work for additional PRs:

  • test with single files
  • test through API

And file "lorem.txt" should be listed on the webUI
And file "lorem (2).txt" should not be listed on the webUI

Scenario: User tries to upload existing file in public link share with permissions upload-write-without-modify

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

upload-write-without-modify ? copy-paste problem?

@individual-it individual-it requested a review from sharidas May 17, 2019 06:47
@dpakach dpakach force-pushed the test-issue-35155 branch from 73e39cd to 32b9882 Compare May 17, 2019 07:07

@sharidas sharidas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM 👍

@dpakach

dpakach commented May 20, 2019

Copy link
Copy Markdown
Contributor Author

Backport on #35267

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.

5 participants