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 0299821
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion tests/behat/uploadFileToMoodle.feature
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ 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"
Expand All @@ -43,3 +43,31 @@ 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 in the file-picker to get the latest file
Given "admin" has created the project space "ProjectMoodle"
And I should not see "ProjectMoodle"
When I refresh the file-picker
Then I should see "ProjectMoodle"
And I click on "<drive>" "link"
And user "admin" has uploaded a file inside space "<drive>" with content "some content" to "testfile.txt"
And I should not see "testfile.txt"
When I refresh the file-picker
Then I should see "testfile.txt"
Examples:
| drive |
| ProjectMoodle |
| Personal |

Scenario: click refresh button in the file-picker to get the latest shared file
Given I click on "Shares" "link"
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 |
Then I should not see "testfile.txt"
When I refresh the file-picker
Then I should see "testfile.txt"

0 comments on commit 0299821

Please sign in to comment.