Skip to content

Commit

Permalink
adding test for refresh button
Browse files Browse the repository at this point in the history
  • Loading branch information
nirajacharya2 committed Apr 23, 2024
1 parent a956484 commit 821990a
Showing 1 changed file with 24 additions and 4 deletions.
28 changes: 24 additions & 4 deletions tests/behat/uploadFileToMoodle.feature
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ Feature: upload the resource in oCIS to moodle
So that the resource content can be integrated into moodle course content

Background:
Given I log in as "admin"
Given "admin" has created the project space "ProjectMoodle"
And I log in as "admin"
And I follow "Profile" in the user menu
And I click on "Blog entries" "link"
And I click on "Add a new entry" "link"
Expand All @@ -16,15 +17,14 @@ Feature: upload the resource in oCIS to moodle
And I log in to ocis as "admin"

Scenario: upload a file from the personal drive of ocis to moodle
And user "admin" has uploaded a file inside space "Personal" with content "some content" to "/testfile.txt"
Given user "admin" has uploaded a file inside space "Personal" with content "some content" to "/testfile.txt"
When I click on "//*[@class='fp-filename-field']/p[text()='Personal']" "xpath_element"
And I click on "//*[@class='fp-filename-field']/p[text()='testfile.txt']" "xpath_element"
And I click on "Select this file" "button"
Then I should see "testfile.txt"

Scenario: upload a file from project space of ocis to moodle
Given "admin" has created the project space "ProjectMoodle"
And user "admin" has uploaded a file inside space "ProjectMoodle" with content "some content" to "/testfile.txt"
Given user "admin" has uploaded a file inside space "ProjectMoodle" with content "some content" to "/testfile.txt"
And I refresh the file-picker
When I click on "//*[@class='fp-filename-field']/p[text()='ProjectMoodle']" "xpath_element"
And I click on "//*[@class='fp-filename-field']/p[text()='testfile.txt']" "xpath_element"
Expand All @@ -43,3 +43,23 @@ Feature: upload the resource in oCIS to moodle
And I click on "//*[@class='fp-filename-field']/p[text()='testfile.txt']" "xpath_element"
And I click on "Select this file" "button"
Then I should see "testfile.txt"

Scenario Outline: click refresh button
Given I click on "<drive>" "link"
And user "admin" has uploaded a file inside space "Personal" with content "some content" to "testfile.txt"
And user "admin" has uploaded a file inside space "ProjectMoodle" with content "some content" to "/testfile.txt"
And user "Brian" has been created with default attributes
And user "Brian" has uploaded a file inside space "Personal" with content "some content" to "/testfile.txt"
And user "Brian" has sent the following share invitation:
| resource | testfile.txt |
| space | Personal |
| sharee | Admin |
| shareType | user |
And I should not see "testfile.txt"
When I refresh the file-picker
Then I should see "testfile.txt"
Examples:
| drive |
| ProjectMoodle |
| Personal |
| Shares |

0 comments on commit 821990a

Please sign in to comment.