Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8533 from owncloud/ocis-notifications-e2e
[tests-only] Add notification e2e tests
- Loading branch information
Showing
5 changed files
with
163 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# The version of OCIS to use in pipelines that test against OCIS | ||
OCIS_COMMITID=964263489149108b3953828dccf2e91264ce5f25 | ||
OCIS_COMMITID=0f77acab45991f77ec24a863186026636b1b2818 | ||
OCIS_BRANCH=master |
29 changes: 29 additions & 0 deletions
29
tests/e2e/cucumber/features/smoke/notifications.oc10.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
Feature: Notifications | ||
As a user | ||
I want to be notified | ||
About new things that concern me | ||
|
||
Background: | ||
Given "Admin" creates following users | ||
| id | | ||
| Alice | | ||
| Brian | | ||
And "Admin" sets the default folder for received shares to "Shares" | ||
And "Admin" disables share auto accepting | ||
|
||
Scenario: User should be able to read and dismiss notifications | ||
Given "Alice" creates the following folder in personal space using API | ||
| name | | ||
| folder_to_shared | | ||
And "Alice" logs in | ||
And "Alice" opens the "files" app | ||
And "Alice" shares the following resource using the sidebar panel | ||
| resource | recipient | type | role | resourceType | | ||
| folder_to_shared | Brian | user | editor | folder | | ||
When "Brian" logs in | ||
Then "Brian" should see the following notifications | ||
| message | | ||
| "Alice Hansen" invited you to view "folder_to_shared" | | ||
And "Brian" marks all notifications as read | ||
Then "Brian" should see no notifications | ||
And "Alice" logs out |
68 changes: 68 additions & 0 deletions
68
tests/e2e/cucumber/features/smoke/notifications.ocis.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
Feature: Notifications | ||
As a user | ||
I want to be notified | ||
About new things that concern me | ||
|
||
Background: | ||
Given "Admin" creates following users | ||
| id | | ||
| Alice | | ||
| Brian | | ||
And "Admin" assigns following roles to the users using API | ||
| id | role | | ||
| Alice | Space Admin | | ||
|
||
Scenario: User should be able to read and dismiss notifications | ||
Given "Alice" creates the following folder in personal space using API | ||
| name | | ||
| folder_to_shared | | ||
And "Alice" creates the following project space using API | ||
| name | id | | ||
| team | team.1 | | ||
And "Alice" logs in | ||
And "Alice" opens the "files" app | ||
And "Alice" shares the following resource using the sidebar panel | ||
| resource | recipient | type | role | resourceType | | ||
| folder_to_shared | Brian | user | editor | folder | | ||
And "Alice" navigates to the projects space page | ||
And "Alice" navigates to the project space "team.1" | ||
And "Alice" adds following users to the project space | ||
| user | role | kind | | ||
| Brian | editor | user | | ||
When "Brian" logs in | ||
Then "Brian" should see the following notifications | ||
| message | | ||
| Alice Hansen shared folder_to_shared with you | | ||
| Alice Hansen added you to Space team | | ||
And "Brian" marks all notifications as read | ||
Then "Brian" should see no notifications | ||
When "Alice" opens the "files" app | ||
And "Alice" removes following sharee | ||
| resource | recipient | | ||
| folder_to_shared | Brian | | ||
And "Alice" navigates to the projects space page | ||
And "Alice" navigates to the project space "team.1" | ||
And "Alice" removes access to following users from the project space | ||
| user | role | kind | | ||
| Brian | editor | user | | ||
When "Brian" reloads the page | ||
Then "Brian" should see the following notifications | ||
| message | | ||
| Alice Hansen unshared folder_to_shared with you | | ||
| Alice Hansen removed you from Space team | | ||
And "Brian" marks all notifications as read | ||
Then "Brian" should see no notifications | ||
And "Brian" logs out | ||
When "Alice" opens the "admin-settings" app | ||
And "Alice" navigates to the project spaces management page | ||
And "Alice" disables the space "team.1" using the context-menu | ||
And "Alice" reloads the page | ||
Then "Alice" should see the following notifications | ||
| message | | ||
| Alice Hansen disabled Space team | | ||
And "Alice" deletes the space "team.1" using the context-menu | ||
And "Alice" reloads the page | ||
Then "Alice" should see the following notifications | ||
| message | | ||
| Alice Hansen deleted Space team | | ||
And "Alice" logs out |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { DataTable, Then, When } from '@cucumber/cucumber' | ||
import { World } from '../../environment' | ||
import { objects } from '../../../support' | ||
import { expect } from '@playwright/test' | ||
|
||
Then( | ||
'{string} should see the following notification(s)', | ||
async function (this: World, stepUser: string, stepTable: DataTable): Promise<void> { | ||
const { page } = this.actorsEnvironment.getActor({ key: stepUser }) | ||
const application = new objects.runtime.Application({ page }) | ||
const messages = await application.getNotificationMessages() | ||
for (const { message } of stepTable.hashes()) { | ||
expect(messages).toContain(message) | ||
} | ||
} | ||
) | ||
|
||
Then( | ||
'{string} should see no notification(s)', | ||
async function (this: World, stepUser: string): Promise<void> { | ||
const { page } = this.actorsEnvironment.getActor({ key: stepUser }) | ||
const application = new objects.runtime.Application({ page }) | ||
const messages = await application.getNotificationMessages() | ||
expect(messages.length).toBe(0) | ||
} | ||
) | ||
|
||
When( | ||
'{string} marks all notifications as read', | ||
async function (this: World, stepUser: string): Promise<void> { | ||
const { page } = this.actorsEnvironment.getActor({ key: stepUser }) | ||
const application = new objects.runtime.Application({ page }) | ||
await application.markNotificationsAsRead() | ||
} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters