Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 27 additions & 18 deletions tests/e2e-playwright/specs/app-provider/lock.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@ test.describe('lock', { tag: '@sse' }, () => {
// | Alice |
// | Brian |
// | Carol |
await api.userHasBeenCreated({ usersEnvironment, stepUser: 'Admin', userToBeCreated: 'Alice' })
await api.userHasBeenCreated({ usersEnvironment, stepUser: 'Admin', userToBeCreated: 'Brian' })
await api.userHasBeenCreated({ usersEnvironment, stepUser: 'Admin', userToBeCreated: 'Carol' })
await api.usersHasBeenCreated({
usersEnvironment,
stepUser: 'Admin',
users: ['Alice', 'Brian', 'Carol']
})
// And "Alice" logs in
await ui.logInUser({ usersEnvironment, actorsEnvironment, stepUser: 'Alice' })
})
Expand All @@ -46,23 +48,26 @@ test.describe('lock', { tag: '@sse' }, () => {
// When "Alice" creates the following resources
// | resource | type | content |
// | test.odt | OpenDocument | some content |
await api.userHasCreatedFile({
await api.userHasCreatedFiles({
usersEnvironment,
stepUser: 'Alice',
filename: 'test.odt',
content: 'some content'
files: [{ pathToFile: 'test.odt', content: 'some content' }]
})
// And "Alice" shares the following resource using API
// | resource | recipient | type | role | resourceType |
// | test.odt | Brian | user | Can edit with versions and trashbin | file |
await api.userHasSharedResource({
await api.userHasSharedResources({
usersEnvironment,
stepUser: 'Alice',
resource: 'test.odt',
recipient: 'Brian',
type: 'user',
role: 'Can edit with versions and trashbin',
resourceType: 'file'
shares: [
{
resource: 'test.odt',
recipient: 'Brian',
type: 'user',
role: 'Can edit with versions and trashbin',
resourceType: 'file'
}
]
})
// And "Brian" logs in
await ui.logInUser({ usersEnvironment, actorsEnvironment, stepUser: 'Brian' })
Expand Down Expand Up @@ -133,16 +138,20 @@ test.describe('lock', { tag: '@sse' }, () => {
// And "Alice" shares the following resource using the sidebar panel
// | resource | recipient | type | role | resourceType |
// | test.odt | Carol | user | Can view | file |
await ui.shareResource({
await ui.userSharesResources({
actorsEnvironment,
usersEnvironment,
stepUser: 'Alice',
resource: 'test.odt',
recipient: 'Carol',
type: 'user',
role: 'Can view',
actionType: 'SIDEBAR_PANEL',
resourceType: 'file'
shares: [
{
resource: 'test.odt',
recipient: 'Carol',
type: 'user',
role: 'Can view',
resourceType: 'file'
}
]
})

// file-unlocked
Expand Down
17 changes: 10 additions & 7 deletions tests/e2e-playwright/specs/app-provider/urlJourneys.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,27 +30,30 @@ test.describe('url stability for mobile and desktop client', { tag: '@predefined
// Given "Admin" creates following users using API
// | id |
// | Alice |
await api.userHasBeenCreated({ usersEnvironment, stepUser: 'Admin', userToBeCreated: 'Alice' })
await api.usersHasBeenCreated({
usersEnvironment,
stepUser: 'Admin',
users: ['Alice']
})
// And "Alice" logs in
await ui.logInUser({ usersEnvironment, actorsEnvironment, stepUser: 'Alice' })
// And "Alice" creates the following files into personal space using API
// | pathToFile | content |
// | OpenDocument.odt | OpenDocument Content |
await api.userHasCreatedFile({
await api.userHasCreatedFiles({
usersEnvironment,
stepUser: 'Alice',
filename: 'OpenDocument.odt',
content: 'OpenDocument Content'
files: [{ pathToFile: 'OpenDocument.odt', content: 'OpenDocument Content' }]
})
// And "Alice" creates the following resources
// | resource | type | content |
// | MicrosoftWord.docx | Microsoft Word | Microsoft Word Content |
await ui.userCreatesResources({
actorsEnvironment,
stepUser: 'Alice',
resource: 'MicrosoftWord.docx',
type: 'Microsoft Word',
content: 'Microsoft Word Content'
resources: [
{ name: 'MicrosoftWord.docx', type: 'Microsoft Word', content: 'Microsoft Word Content' }
]
})
// And for "Alice" file "MicrosoftWord.docx" should not be locked
await ui.resourceShouldNotBeLocked({
Expand Down
60 changes: 31 additions & 29 deletions tests/e2e-playwright/specs/file-action/download.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,11 @@ test.describe('Download', { tag: '@predefined-users' }, () => {
browser: browser
})
await setAccessAndRefreshToken(usersEnvironment)
await api.userHasBeenCreated({ usersEnvironment, stepUser: 'Admin', userToBeCreated: 'Alice' })
await api.userHasBeenCreated({ usersEnvironment, stepUser: 'Admin', userToBeCreated: 'Brian' })
await api.usersHasBeenCreated({
usersEnvironment,
stepUser: 'Admin',
users: ['Alice', 'Brian']
})
})

test.afterEach(async () => {
Expand All @@ -56,11 +59,10 @@ test.describe('Download', { tag: '@predefined-users' }, () => {
// And "Alice" creates the following files into personal space using API
// | pathToFile | content |
// | folderPublic/new file.txt | lorem ipsum |
await api.userHasCreatedFile({
await api.userHasCreatedFiles({
usersEnvironment,
stepUser: 'Alice',
filename: 'folderPublic/new file.txt',
content: 'lorem ipsum'
files: [{ pathToFile: 'folderPublic/new file.txt', content: 'lorem ipsum' }]
})

// And "Alice" uploads the following local file into personal space using API
Expand All @@ -78,32 +80,32 @@ test.describe('Download', { tag: '@predefined-users' }, () => {
// | folderPublic | Brian | user | Can edit with versions and trashbin | folder |
// | emptyFolder | Brian | user | Can edit with versions and trashbin | folder |
// | testavatar.jpg | Brian | user | Can edit with versions and trashbin | file |
await api.userHasSharedResource({
usersEnvironment,
stepUser: 'Alice',
resource: 'folderPublic',
recipient: 'Brian',
type: 'user',
role: 'Can edit with versions and trashbin',
resourceType: 'folder'
})
await api.userHasSharedResource({
await api.userHasSharedResources({
usersEnvironment,
stepUser: 'Alice',
resource: 'emptyFolder',
recipient: 'Brian',
type: 'user',
role: 'Can edit with versions and trashbin',
resourceType: 'folder'
})
await api.userHasSharedResource({
usersEnvironment,
stepUser: 'Alice',
resource: 'testavatar.jpg',
recipient: 'Brian',
type: 'user',
role: 'Can edit with versions and trashbin',
resourceType: 'file'
shares: [
{
resource: 'folderPublic',
recipient: 'Brian',
type: 'user',
role: 'Can edit with versions and trashbin',
resourceType: 'folder'
},
{
resource: 'emptyFolder',
recipient: 'Brian',
type: 'user',
role: 'Can edit with versions and trashbin',
resourceType: 'folder'
},
{
resource: 'testavatar.jpg',
recipient: 'Brian',
type: 'user',
role: 'Can edit with versions and trashbin',
resourceType: 'file'
}
]
})

// When "Alice" downloads the following resources using the batch action
Expand Down
20 changes: 9 additions & 11 deletions tests/e2e-playwright/specs/file-action/fileViewer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@ test.describe('Different file viewers', { tag: '@predefined-users' }, () => {
// Given "Admin" creates following user using API
// | id |
// | Alice |
await api.userHasBeenCreated({ usersEnvironment, stepUser: 'Admin', userToBeCreated: 'Alice' })
await api.usersHasBeenCreated({
usersEnvironment,
stepUser: 'Admin',
users: ['Alice']
})

// And "Alice" logs in
await ui.logInUser({ usersEnvironment, actorsEnvironment, stepUser: 'Alice' })
Expand All @@ -50,16 +54,10 @@ test.describe('Different file viewers', { tag: '@predefined-users' }, () => {
await ui.userCreatesResources({
actorsEnvironment,
stepUser: 'Alice',
resource: 'lorem.txt',
type: 'txtFile',
content: 'some text'
})
await ui.userCreatesResources({
actorsEnvironment,
stepUser: 'Alice',
resource: 'lorem.md',
type: 'mdFile',
content: 'readme'
resources: [
{ name: 'lorem.txt', type: 'txtFile', content: 'some text' },
{ name: 'lorem.md', type: 'mdFile', content: 'readme' }
]
})

// And "Alice" edits the following resources
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ test.describe('Application menu', { tag: '@predefined-users' }, () => {
})

await setAccessAndRefreshToken(usersEnvironment)
await api.userHasBeenCreated({ usersEnvironment, stepUser: 'Admin', userToBeCreated: 'Alice' })
await api.usersHasBeenCreated({
usersEnvironment,
stepUser: 'Admin',
users: ['Alice']
})
await ui.logInUser({ usersEnvironment, actorsEnvironment, stepUser: 'Alice' })
})

Expand Down
18 changes: 9 additions & 9 deletions tests/e2e-playwright/specs/navigation/breadcrumb.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ test.describe('Access breadcrumb', { tag: '@predefined-users' }, () => {
})

await setAccessAndRefreshToken(usersEnvironment)
await api.userHasBeenCreated({ usersEnvironment, stepUser: 'Admin', userToBeCreated: 'Alice' })
await api.usersHasBeenCreated({
usersEnvironment,
stepUser: 'Admin',
users: ['Alice']
})
await ui.logInUser({ usersEnvironment, actorsEnvironment, stepUser: 'Alice' })
})

Expand All @@ -37,8 +41,7 @@ test.describe('Access breadcrumb', { tag: '@predefined-users' }, () => {
await ui.userCreatesResources({
actorsEnvironment,
stepUser: 'Alice',
type: 'folder',
resource: 'parent/folder%2Fwith%2FSlashes'
resources: [{ name: 'parent/folder%2Fwith%2FSlashes', type: 'folder' }]
})
await ui.userOpensResources({
actorsEnvironment,
Expand All @@ -48,8 +51,7 @@ test.describe('Access breadcrumb', { tag: '@predefined-users' }, () => {
await ui.userCreatesResources({
actorsEnvironment,
stepUser: 'Alice',
type: 'folder',
resource: `'single-double quotes"`
resources: [{ name: `'single-double quotes"`, type: 'folder' }]
})
await ui.userOpensResources({
actorsEnvironment,
Expand All @@ -59,8 +61,7 @@ test.describe('Access breadcrumb', { tag: '@predefined-users' }, () => {
await ui.userCreatesResources({
actorsEnvironment,
stepUser: 'Alice',
type: 'folder',
resource: `"inner" double quote`
resources: [{ name: `"inner" double quote`, type: 'folder' }]
})
await ui.userOpensResources({
actorsEnvironment,
Expand All @@ -70,8 +71,7 @@ test.describe('Access breadcrumb', { tag: '@predefined-users' }, () => {
await ui.userCreatesResources({
actorsEnvironment,
stepUser: 'Alice',
type: 'folder',
resource: 'sub-folder'
resources: [{ name: 'sub-folder', type: 'folder' }]
})
await ui.userOpensResources({
actorsEnvironment,
Expand Down
6 changes: 5 additions & 1 deletion tests/e2e-playwright/specs/navigation/pageNotFound.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ test.describe('Page not found', { tag: '@predefined-users' }, () => {
// Given "Admin" creates following user using API
// | id |
// | Alice |
await api.userHasBeenCreated({ usersEnvironment, stepUser: 'Admin', userToBeCreated: 'Alice' })
await api.usersHasBeenCreated({
usersEnvironment,
stepUser: 'Admin',
users: ['Alice']
})

// And "Alice" logs in
await ui.logInUser({ usersEnvironment, actorsEnvironment, stepUser: 'Alice' })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,36 +34,37 @@ test.describe('Personal space pagination', { tag: '@predefined-users' }, () => {
// Given "Admin" creates following user using API
// | id |
// | Alice |
await api.userHasBeenCreated({ usersEnvironment, stepUser: 'Admin', userToBeCreated: 'Alice' })
await api.usersHasBeenCreated({
usersEnvironment,
stepUser: 'Admin',
users: ['Alice']
})

// And "Alice" logs in
await ui.logInUser({ usersEnvironment, actorsEnvironment, stepUser: 'Alice' })

// And "Alice" creates 15 folders in personal space using API
for (let i = 1; i <= 15; i++) {
await api.userHasCreatedFolder({
usersEnvironment,
stepUser: 'Alice',
folderName: `folder${i}`
})
}
await api.userHasCreatedFolders({
usersEnvironment,
stepUser: 'Alice',
folderNames: Array.from({ length: 15 }, (_, i) => `folder${i + 1}`)
})
// And "Alice" creates 10 files in personal space using API
for (let i = 1; i <= 10; i++) {
await api.userHasCreatedFile({
usersEnvironment,
stepUser: 'Alice',
filename: `file${i}`,
content: `This is a test file${i}`
})
}
await api.userHasCreatedFiles({
usersEnvironment,
stepUser: 'Alice',
files: Array.from({ length: 10 }, (_, i) => ({
pathToFile: `file${i + 1}`,
content: `This is a test file${i + 1}`
}))
})
// And "Alice" creates the following files into personal space using API
// | pathToFile | content |
// | .hidden-testFile.txt | This is a hidden file. |
await api.userHasCreatedFile({
await api.userHasCreatedFiles({
usersEnvironment,
stepUser: 'Alice',
filename: '.hidden-testFile.txt',
content: 'This is a hidden file.'
files: [{ pathToFile: '.hidden-testFile.txt', content: 'This is a hidden file.' }]
})
// When "Alice" opens the "files" app
await ui.userOpensApplication({ actorsEnvironment, stepUser: 'Alice', name: 'files' })
Expand Down
Loading