Skip to content

Commit

Permalink
feat(TestCase): Update test cases for project, package, moderation
Browse files Browse the repository at this point in the history
Signed-off-by: hoangnt2 <[email protected]>
  • Loading branch information
hoangnt2 committed Nov 14, 2024
1 parent 6289d48 commit 504f154
Show file tree
Hide file tree
Showing 3 changed files with 184 additions and 89 deletions.
65 changes: 34 additions & 31 deletions content/en/docs/Development/TestCases/Test-Cases-Moderations.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,52 +4,55 @@ linkTitle: "Moderation"
weight: 10
---

## Accept moderation request, for visible projects by other users
## TC01: Accept moderation request, for visible projects by other users

Step | Action | Result
---:|:-----|:----
1 | Open first browser instance ((e.g. "firefox.exe -p "profile1" -no-remote") and sign in with a known _First_ user | User successfully signed in and _Home_ page is displayed
2 | Open a second browser instance ((e.g. "firefox.exe -p "profile2" -no-remote") and sign in with a known _Second_ user | User successfully signed in and _Home_ page is displayed
1 | Open a first browser instance (Eg: "firefox.exe -p "profile1" -no-remote") and sign in with a known _First_ user | User successfully signed in and _Home_ page is displayed
2 | Open a second browser instance (Eg: "firefox.exe -p "profile2" -no-remote") and sign in with a known _Second_ user | User successfully signed in and _Home_ page is displayed
3 | Activate _First_ browser instance | Instance is active
4 | Create a new project visible for _Second_ user (e.g. _Me and Moderators_, _Group and Moderators_, _Everyone_) | Project is created successfully
4 | Create a new project visible for _Second_ user <br> Eg: <br> - Name: Project is created by First user <br> - Project visibility: Everyone | Project is created successfully
5 | Activate _Second_ browser instance | Instance is active
6 | Search for the above created project and click _Edit_ | _You will create a moderation request if you update._ message is displayed
7 | Edit Description field or other fields and click _Update Project_ | _Moderation request was sent to update the Project name!_ message is displayed.
8 | Activate _First_ browser instance | Instance is active
9 | Check _My Task Assignments_ on _Home_ page | The above project that needs moderation is displayed with status _PENDING_
10 | Click on _Moderation_ page | The moderation request of _Second_ user is displayed with state _Pending_
11 | Click on moderation request | _Moderation Change Project_ page is displayed, with proposed changes from step 7 listed
12 | Click on _Accept Request_ | _You have accepted the previous moderation request._ message is displayed, and State changes to _Approved_
13 | Check _My Task Assignments_ on _Home_ page | Status is _APPROVED_
14 | Activate _Second_ browser instance | Instance is active
15 | Check _My Task Submissions on _Home_ page | Status is _APPROVED_
16 | Open the _Projects_ tab and click on previously modified project on step 7 | Project _Summary_ page displayed successfully
17 | Check the moderation requested changes | Changes are visible in the corresponding fields
6 | Search for the above created project and click _Edit_ button | _"Success: You will create a moderation request if you update"_ message is displayed
7 | Edit _Description_ field or other fields <br> Eg: <br> Description: "Update description to create a moderation request!!" <br> Click _Update Project_ button| Create moderation request dialog is displayed
8 | Fill in _Please comment your changes_ field <br> Eg: I want to update this project. Please accept for me. Thanks @@. <br> Click _Send moderation request_ button | Show message: _"Success: Moderation request was sent to update the Project {nameProject} {(version)}!"_
9 | Activate _First_ browser instance | Instance is active
10 | Check status of project in the _MY TASK ASSIGNMENTS_ table on _Home_ page | The above project that needs moderation is displayed with status _Pending_
11 | Click _Requests_ page | The moderation request of _Second_ user is displayed with state _Pending_
12 | Click the project name in the _Document Name_ column | - _"Success: You have assigned yourself to this moderation request."_ message is displayed <br> - _Moderation Request Information_ page is displayed, with proposed changes from step 7 listed
13 | Input a comment in the _Comment on Moderation Decision_ box. Eg: _The request is approved_ <br> Click _Accept Request_ button | Request page display and show message: _"Success: You have accepted the moderation request"_
14 | Click _Closed Moderation Requests_ tab <br> Check state of _Project is created by First user_ project | State changed to _Approved_
15 | Check status of project in the _MY TASK ASSIGNMENTS_ table on _Home_ page | The request is removed from the table
16 | Activate _Second_ browser instance | Instance is active
17 | Check status of project in the _MY TASK SUBMISSIONS_ table on _Home_ page | Status is _Approved_
18 | Open the _Projects_ page and click on previously modified project on step 7 | Project _Summary_ page displayed successfully
19 | Check the moderation requested changes | Changes are visible in the corresponding fields: _Description_ field was changed to _"Update description to create a moderation request!!"_

## Decline moderation request, for visible projects by other users
## TC02: Decline moderation request, for visible projects by other users

Step | Action | Result
---:|:-----|:----
1-11 | Same as in TC01
12 | Click on _Decline Request_ | _You have declined the previous moderation request_ message is displayed, and State changes to _Rejected_
13 | Check _My Task Assignments_ on _Home_ page | Status is _REJECTED_
14 | Activate _Second_ browser instance | Instance is active
15 | Check _My Task Submissions on _Home_ page | Status is _REJECTED_
16 | Open the _Projects_ tab and click on previously modified project on step 7 | Project _Summary_ page displayed successfully
17 | Check the moderation requested changes | Changes are not visible in the corresponding fields
12 | Input a comment in the _Comment on Moderation Decision_ box. Eg: _The request is declined_ <br> Click _Decline Request_ button| Requests page display and show message: _"Success: You have rejected the moderation request"_
13 | Click _Closed Moderation Requests_ tab <br> Check state of the above rejected project | State changed to _Rejected_
14 | Check status of project in the _MY TASK ASSIGNMENTS_ table on _Home_ page | The request is removed from the table
15 | Activate _Second_ browser instance | Instance is active
16 | Check status of project in the _MY TASK SUBMISSIONS_ table on _Home_ page | Status is _Rejected_
17 | Open the _Projects_ page and click on previously modified project on step 7 | Project _Summary_ page displayed successfully
18 | Check the moderation requested changes | Changes are not visible in the corresponding fields: data of the project is not changed.

## Remove Me from Moderators for moderation request, for visible projects by other users
## TC03: Remove Me from Moderators for moderation request, for visible projects by other users

Step | Action | Result
---:|:-----|:----
1-11 | Same as in TC01
12 | Click on _Remove Me from Moderators_ | _You are the last moderator for this request - you are not allowed to unsubscribe._ message is displayed (assuming only _First_ user was listed under _Moderators_ column in step 10)
13 | Click on _Decline Request_ | _You have declined the previous moderation request_ message is displayed, and State changes to _Rejected_
14 | Edit the project and add a new moderator (e.g. _Third_ user) under _Moderators_ field | Project updated successfully.
12 | Click _Remove Me from Moderators_ button | - _"Warning: You are the last moderator for this request, you are not allowed to unsubscribe !"_ message is displayed (assuming only _First_ user was listed under _Moderators_ column in step 10) <br> - Can't remove from Moderators. Nothing to change
13 | Input a comment in the _Comment on Moderation Decision_ box. Eg: _Decline the request._ <br> Click _Decline Request_ button| Requests page display and show message: _"Success: You have rejected the moderation request"_
14 | Edit the project and add a new moderator (Eg: _Third_ user) under _Moderators_ field | Project updated successfully
15 | Activate _Second_ browser instance | Instance is active
16 | Edit the project and create a new moderation request | Moderation request was sent
17 | Activate _First_ browser instance | Instance is active
18 | Click on _Moderation_ page | The moderation request of _Second_ user is displayed with state _Pending_
19 | Click on moderation request | _Moderation Change Project_ page is displayed, with proposed changes from step 7 listed
20 | Click on _Remove Me from Moderators_ | _You are removed from the list of moderators for the previous moderation request. You have no open Requests._ message is displayed. Also the document is deleted from moderation list.
21 | Login with the _Third_ user and check the _Moderation_ tab | The moderation request of _Second_ user is displayed with state _Pending_
18 | Click _Moderation_ page | The moderation request of _Second_ user is displayed with state _Pending_
19 | Click the project name which the moderation was created in step 16 | - _"Success: You have assigned yourself to this moderation request."_ is displayed <br> - _Moderation Request Information_ page is displayed, with proposed changes from step 16 listed
20 | Click _Remove Me from Moderators_ button| _"Success: You have unassigned yourself from the moderation request"_ message is displayed. Also the document is deleted from moderation list.
21 | Login with the _Third_ user and check the _Moderation request_ in _Request_ page | The moderation request of _Second_ user is displayed with state _Pending_
69 changes: 69 additions & 0 deletions content/en/docs/Development/TestCases/Test-Cases-Packages.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
---
title: "Packages"
linkTitle: "Packages"
weight: 10
---

## TC01: Create a package with required fields

Step | Action | Result
---:|:-----|:----
1 | Sign In with a known user | User successfully signed in and _Home_ page is displayed
2 | Click _Packages_ tab <br> Click _Add Package_ button| The _Create Package_ page is displayed
3 | Input valid data into required fields <br> _Eg:_ <br> - Name: package1 <br> - Version: 1.0.0 <br> - Package Type: Framework <br> - PURL (Package URL): pkg:npm/[email protected] | Values are entered in the fields
4 | Click _Create Package_ button | - The message: _"Success: Package created successfully"_ is displayed at the left corner <br> - Redirect to the _Package list_ page <br> - The new package is added to the package list
5 | Search for the new project then click the hyperlink of the newly created package name | Redirect to view page of the created package
6 | Check data of all fields | Data in all fields match with input values

## TC02: Create a package with all fields

Step | Action | Result
---:|:-----|:----
1 | Sign In with a known user <br> Click _Packages_ tab <br> Click _Add Package_ button | The _Create Package_ page is displayed
2 | Input valid data into all editable fields | Values are entered in the fields
3 | Click _Create Package_ button | - The message: _"Success: Package created successfully"_ is displayed at the left corner <br> - Redirect to the _Package list_ page <br> - The new package is added to the package list
4 | Search for the new package then click the hyperlink of the newly created package name | Redirect to view page of the created package
5 | Check data of all fields | Data in all fields match with input values

## TC03: Update some fields for package

Step | Action | Result
---:|:-----|:----
1 | Sign In with a known user <br> Click _Component_ tab <br> Create a component with name is _ComponentA_ <br> Create a release with name is _ComponentA (1.0.1)_ | Release _ComponentA (1.0.1)_ is created successfully
2 | Click _Packages_ tab <br> Create a new package with name and version are _Package1 (1.0.1)_ | Package _Package1 (1.0.1)_ is created successfully
3 | At advanced Search, search for newly created package <br> _Eg:_ Package1 (1.0.1) <br> Click _Edit Package_ icon at _Actions_ column | _Update Package_ page is displayed
4 | Update data of some fields <br> _Eg:_ <br> - Version: 1.0.2 <br> - Homepage URL: pkg:npm/@microsoft/applicationinsights-web@2.5.11 <br> - Release: ComponentA (1.0.1) | Data is filled in fields match with input values
5 | Click _Update Package_ button | - The message: _"Success: Package updated successfully"_ is displayed at the left corner <br> - Redirect to the package list page
6 | Search for the updated project then click the hyperlink of the package name | Redirect to view page of the updated package
7 | Check data of all fields | Data in all fields match with data at update page

## TC04: Link package to project with release of the package has not linked to the project yet

Step | Action | Result
---:|:-----|:----
1 | Create Component with name is _ComponentA_ <br> Create a release with name is _ComponentA (1.0.1)_| Release is created successfully
2 | Click _Packages_ tab <br> Click _Add Package_ button <br>Create a new package with: <br> - Name: _PackageA_ <br> - Version: _(1.0.1)_ <br> - Release: _ComponentA (1.0.1)_| Package is created successfully
3 | Click _Project_ tab <br> Create project with name is _ProjectA_ | Project is created successfully
4 | In _Edit ProjectA project_ page then click _Linked Packages_ tab <br> Click _Add Packages_ button | Dialog _Link Packages_ is displayed
5 | Input _PackageA_ in textbox then click _Search_ button <br> Choose _PackageA_ package then click _Link Packages_ button | Information of the _PackageA_ package is displayed correctly in the table
6 | Click _Update Project_ button | - Redirect to the _ProjectA_ project view screen <br> - Information of _Linked Package_ tab is correct with input data
7 | Click _License Clearing_ tab, check information of the table | Display data of _ComponentA (1.0.1)_ release with correctly information

## TC05: Unlink package from the project

Step | Action | Result
---:|:-----|:----
1 | Sign In with a known user <br> Click _Packages_ tab <br> Create a new package with name and version are _PackageA (1.0.1)_| Package is created successfully
2 | Click _Project_ tab <br> Create a project with name is _ProjectA_ and then add _PackageA_ newly created as linked package of _ProjectA_ project | Project is created successfully
3 | In edit project page, click _Linked Packages_ tab <br> Click _Delete_ icon of PackageA (1.0.1) package <br> Click _Delete Link_ button | Data of _PackageA (1.0.1)_ package is removed from package table
4 | Click _Update Project_ button | - Redirect to view _ProjectA_ page <br> - Project _ProjectA_ is updated successfully <br> - Data in the _Linked Packages_ tab: _PackageA (1.0.1)_ package information is removed

## TC06: Delete a package that is first linked to a project and then not

Step | Action | Result
---:|:-----|:----
1 | Sign In with a known user <br> Click _Packages_ tab <br> Create a new package with name and version are _PackageA (1.0.1)_| Package is created successfully
2 | Click _Projects_ tab <br> Create a project with name is _ProjectA_ and then add _PackageA_ newly created as linked package of _ProjectA_ project | Project is created successfully
3 | Click _Packages_ tab <br> At advanced Search, search for newly created package <br> _Eg:_ PackageA(1.0.1) <br> Click _Delete Package_ icon in _Actions_ column of this package | Dialog _"Delete Package?"_ display with message: _"Do you really want to delete the package {packageName} ({package version})?"_
4 | Click _Delete Package_ button | Error message is displayed: _"Package cannot be deleted!"_
5 | Unlink _PackageA_ package from _ProjectA_ project<br> Re-delete _PackageA(1.0.1)_ package follow steps from 3-4| - Delete _PackageA_ package successfully with message "Deleted successfully!" in the dialog <br> - Package _PackageA(1.0.1)_ is not display in the package list table
Loading

0 comments on commit 504f154

Please sign in to comment.