Skip to content

Commit 4724e31

Browse files
adjust federated share step according to new changes (#12020)
1 parent 87394aa commit 4724e31

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

tests/e2e/support/objects/federation/actions.ts

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { expect, Page } from '@playwright/test'
22
import util from 'util'
33
import { federatedInvitationCode } from '../../store'
4+
import { config } from '../../../config'
45

56
const generateInvitationButton =
67
'//button[contains(@aria-label,"Generate invitation link that can be shared with one or more invitees")]'
@@ -9,8 +10,6 @@ const invitationToken = 'span:has-text("%s")'
910
const invitationInput = '//input[starts-with(@id, "oc-textinput-")]'
1011
const invitationConnectionRow =
1112
'//div[@id="sciencemesh-connections"]//td[text()="%s"]/parent::tr/td[text()="%s"]'
12-
const institutionOptionDropdown = '.vs__open-indicator'
13-
const inviterInstitutionOption = 'ul.vs__dropdown-menu > li'
1413
const acceptInvitationButton = 'button:has(span:has-text("Accept invitation"))'
1514

1615
export const generateInvitation = async (args: { page: Page; user: string }): Promise<void> => {
@@ -32,6 +31,11 @@ export const generateInvitation = async (args: { page: Page; user: string }): Pr
3231
}),
3332
page.locator(generateInvitationActionConfirmButton).click()
3433
])
34+
35+
const serverHostname = new URL(config.baseUrl).host
36+
37+
// Generate the invitation code by Base64 encoding "token@oCISUrl"
38+
inviteCode = btoa(inviteCode + '@' + serverHostname)
3539
await expect(page.locator(util.format(invitationToken, inviteCode))).toBeVisible()
3640
federatedInvitationCode.set(user, { code: inviteCode })
3741
}
@@ -40,8 +44,6 @@ export const acceptInvitation = async (args: { page: Page; sharer: string }): Pr
4044
const { page, sharer } = args
4145
const invitation = federatedInvitationCode.get(sharer.toLowerCase())
4246
await page.locator(invitationInput).fill(invitation.code)
43-
await page.locator(institutionOptionDropdown).click()
44-
await page.locator(inviterInstitutionOption).click()
4547
await Promise.all([
4648
page.waitForResponse(
4749
(resp) =>

0 commit comments

Comments
 (0)