Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tests-only][full-ci] wait for transition to end before picking a date #11066

Merged
merged 1 commit into from
Jun 19, 2024
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
7 changes: 6 additions & 1 deletion tests/e2e/support/objects/app-files/share/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ import { clearCurrentPopup, createLinkArgs } from '../link/actions'
import { config } from '../../../../config.js'
import { createdLinkStore } from '../../../store'
import { User } from '../../../types'
import { locatorUtils } from '../../../utils'

const invitePanel = '//*[@id="oc-files-sharing-sidebar"]'
const quickShareButton =
'//*[@data-test-resource-name="%s"]/ancestor::tr//button[contains(@class, "files-quick-action-show-shares")]'
const noPermissionToShareLabel =
Expand Down Expand Up @@ -76,7 +78,10 @@ export const createShare = async (args: createShareArgs): Promise<void> => {

if (expirationDate) {
await page.locator(showMoreOptionsButton).click()
await page.getByTestId(calendarDatePickerId).click()
await Promise.all([
locatorUtils.waitForEvent(page.locator(invitePanel), 'transitionend'),
page.getByTestId(calendarDatePickerId).click()
])
await Collaborator.setExpirationDate(page, expirationDate)
}
await Collaborator.inviteCollaborators({ page, collaborators: recipients })
Expand Down
29 changes: 18 additions & 11 deletions tests/e2e/support/objects/app-files/share/collaborator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { startCase } from 'lodash'
import util from 'util'
import { Group, User } from '../../../types'
import { getActualExpiryDate } from '../../../utils/datePicker'
import { locatorUtils } from '../../../utils'

export interface ICollaborator {
collaborator: User | Group
Expand Down Expand Up @@ -77,7 +78,7 @@ export default class Collaborator {
private static readonly denyShareCollaboratorButton =
'%s//ul[contains(@class,"collaborator-edit-dropdown-options-list")]//span[contains(@class,"deny-share")]//button[contains(@aria-checked,"%s")]'
private static readonly setExpirationDateCollaboratorButton =
'%s//ul[contains(@class,"collaborator-edit-dropdown-options-list")]//button[contains(@class,"files-collaborators-expiration-button")]'
'%s//ul[contains(@class,"collaborator-edit-dropdown-options-list")]//button[@data-testid="recipient-datepicker-btn"]'
private static readonly removeExpirationDateCollaboratorButton =
'%s//ul[contains(@class,"collaborator-edit-dropdown-options-list")]//button[contains(@class,"remove-expiration-date")]'
private static readonly showAccessDetailsButton =
Expand Down Expand Up @@ -239,9 +240,14 @@ export default class Collaborator {
await page
.locator(util.format(Collaborator.collaboratorEditDropdownButton, collaboratorRow))
.click()
await page
.locator(util.format(Collaborator.setExpirationDateCollaboratorButton, collaboratorRow))
.click()

const panel = page.locator(Collaborator.invitePanel)
await Promise.all([
locatorUtils.waitForEvent(panel, 'transitionend'),
page
.locator(util.format(Collaborator.setExpirationDateCollaboratorButton, collaboratorRow))
.click()
])

await Collaborator.setExpirationDate(page, expirationDate)
}
Expand All @@ -258,14 +264,15 @@ export default class Collaborator {
{ newExpiryDate }
)

const date = page.locator(
util.format(
Collaborator.expirationDatepickerDaySelect,
newExpiryDate.toISOString().split('T')[0]
await page
.locator(
util.format(
Collaborator.expirationDatepickerDaySelect,
newExpiryDate.toISOString().split('T')[0]
)
)
)
await page.waitForTimeout(500)
await date.first().click()
.first()
.click()
}

static async removeExpirationDateFromCollaborator(
Expand Down