Skip to content

Commit

Permalink
add tests step to create invitation
Browse files Browse the repository at this point in the history
  • Loading branch information
amrita-shrestha committed Oct 24, 2024
1 parent 415e0b1 commit a21395c
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/e2e/cucumber/features/ocm/ocm.feature
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,14 @@ Feature: federation management
| pathToFile | content |
| example1.txt | example text |
And "Alice" logs in
And "Alice" opens the "open-cloud-mesh" app
And "Alice" generates the federation share invitation token
And "Alice" logs out
Given using "FEDERATED" server
And "Admin" creates following user using API
| id |
| Brian |
And "Brian" logs in
And "Brian" opens the "open-cloud-mesh" app
When "Brian" accept federation share invitation
And "Brian" logs out
21 changes: 21 additions & 0 deletions tests/e2e/cucumber/steps/ui/federation.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { Given, When } from '@cucumber/cucumber'
import { World } from '../../environment'
import { objects } from '../../../support'

Given(
'{string} generates the federation share invitation token',
async function (this: World, stepUser: any): Promise<void> {
const { page } = this.actorsEnvironment.getActor({ key: stepUser })
const pageObject = new objects.scienceMesh.Federation({ page })
await pageObject.generateInvitation()
}
)

When(
'{string} accept federation share invitation',
async function (this: World, stepUser: any): Promise<void> {
const { page } = this.actorsEnvironment.getActor({ key: stepUser })
const pageObject = new objects.scienceMesh.Federation({ page })
await pageObject.generateInvitation()
}
)
17 changes: 17 additions & 0 deletions tests/e2e/support/objects/federation/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { Page } from '@playwright/test'
import * as po from './actions'

export class Federation {
#page: Page

constructor({ page }: { page: Page }) {
this.#page = page
}
async generateInvitation(): Promise<void> {
await po.generateInvitation({ page: this.#page })
}

async acceptInvitation(): Promise<void> {
await po.acceptInvitation({ page: this.#page })
}
}
1 change: 1 addition & 0 deletions tests/e2e/support/objects/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ export * as runtime from './runtime'
export * as account from './account'
export * as urlNavigation from './url-navigation'
export * as appStore from './app-store'
export * as scienceMesh from './federation'

0 comments on commit a21395c

Please sign in to comment.