Skip to content

Commit

Permalink
#2 Extend 'Lock archive metadata' Feature by new Scenarios
Browse files Browse the repository at this point in the history
- Extend 'Lock archive metadata' Feature by new Scenarios:
-- 'Owner can edit locked archive metadata'
-- 'Owner can edit unlocked archive metadata'
  • Loading branch information
helkv committed Jan 20, 2020
1 parent 6ea8c63 commit 2ef4b4a
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 6 deletions.
4 changes: 3 additions & 1 deletion src/test/java/stepdefinitions/LibrariesSteps.java
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ public void uploadFileToLibrary(String fileName) {

@Then("Library contains file {word}")
public void libraryContainsFile(String fileName) {
// TODO: Return all files of the library and assert whether fileName is
// contained. Rework this for all assertions which only check true/false!
boolean elementContained = libraryPage.containsElements(fileName);

assertThat(elementContained).isTrue();
Expand All @@ -134,7 +136,7 @@ public void libraryContainsCertificate(String libraryName) {
}

// TODO: Add this @after to a CleanUpHooks class
@After("@createNewLibrary or @openArchiveMetadata or @FillOutArchiveMetadata or @LockArchiveMetadata or @uploadFile or @receiveCertificate")
@After("@createNewLibrary or @openArchiveMetadata or @FillOutArchiveMetadata or @LockArchiveMetadata or @EditLockedArchiveMetadata or @EditUnlockedArchiveMetadata or @uploadFile or @receiveCertificate")
public void deleteLibraries() {
for (String libraryName : librariesToDelete) {
homePage.navigateTo();
Expand Down
52 changes: 47 additions & 5 deletions src/test/resources/features/lockArchiveMetadata.feature
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Feature: Lock Archive Metadata

@KP-21
@LockArchiveMetadata
Scenario: Lock archive metadata
Scenario: Lock and unlock archive metadata
Given Logged in as User
And Create new Library "New UI Test Library 3"
And Open Library "New UI Test Library 3"
Expand All @@ -13,8 +13,50 @@ Feature: Lock Archive Metadata
Then Lock symbole not displayed for archive-metadata.md
# @After LibrariesSteps.deleteLibrary()

#TODO: Archive metadata can be edited (by owner) while locked and after the lock

#TODO: Further test case: Extract the unlock in an extra test case
@KP-21
@EditLockedArchiveMetadata
Scenario: Owner can edit locked archive metadata
Given Logged in as User
And Create new Library "New UI Test Library 3"
And Open Library "New UI Test Library 3"
When Lock archive-metadata.md file
And Open Markdown element archive-metadata.md
And Edit archive metadata:
| title | Title for a Test-Project |
| author | Author-Lastname, Author-Firstname |
| description | This is a Test-Description for a Test-Project. |
| year | 2020 |
| institute | Institute-Name; Department-Name; Director, Director-Lastname |
Then Archive metadata contains:
| title | Title for a Test-Project |
| author | Author-Lastname, Author-Firstname |
| description | This is a Test-Description for a Test-Project. |
| year | 2020 |
| institute | Institute-Name; Department-Name; Director, Director-Lastname |
# @After LibrariesSteps.deleteLibrary()

@KP-21
@EditUnlockedArchiveMetadata
Scenario: Owner can edit unlocked archive metadata
Given Logged in as User
And Create new Library "New UI Test Library 3"
And Open Library "New UI Test Library 3"
And Lock archive-metadata.md file
Then Unlock archive-metadata.md file
And Open Markdown element archive-metadata.md
And Edit archive metadata:
| title | Title for a Test-Project |
| author | Author-Lastname, Author-Firstname |
| description | This is a Test-Description for a Test-Project. |
| year | 2020 |
| institute | Institute-Name; Department-Name; Director, Director-Lastname |
Then Archive metadata contains:
| title | Title for a Test-Project |
| author | Author-Lastname, Author-Firstname |
| description | This is a Test-Description for a Test-Project. |
| year | 2020 |
| institute | Institute-Name; Department-Name; Director, Director-Lastname |
# @After LibrariesSteps.deleteLibrary()

#TODO: Further test case: other user (with edit rights) can not edit file while locked
#TODO: Further test case: other user (with edit rights) can not edit file while locked

0 comments on commit 2ef4b4a

Please sign in to comment.