mirror of
https://github.com/enso-org/enso.git
synced 2024-12-22 23:51:31 +03:00
b83c5a15eb
- Close https://github.com/enso-org/cloud-v2/issues/1604 - Add ability to track backend calls - Remove inconsistent integration test code - Add skeleton classes for settings pages # Important Notes None
43 lines
1.4 KiB
TypeScript
43 lines
1.4 KiB
TypeScript
/** @file Actions for the "account" form in settings. */
|
|
import { TEXT } from '.'
|
|
import type { LocatorCallback } from './BaseActions'
|
|
import type PageActions from './PageActions'
|
|
import SettingsAccountTabActions from './SettingsAccountTabActions'
|
|
import SettingsFormActions from './SettingsFormActions'
|
|
|
|
/** Actions for the "account" form in settings. */
|
|
export default class SettingsAccountFormActions<Context> extends SettingsFormActions<
|
|
Context,
|
|
typeof SettingsAccountTabActions<Context>
|
|
> {
|
|
/** Create a {@link SettingsAccountFormActions}. */
|
|
constructor(...args: ConstructorParameters<typeof PageActions<Context>>) {
|
|
super(
|
|
SettingsAccountTabActions<Context>,
|
|
(page) =>
|
|
page
|
|
.getByRole('heading')
|
|
.and(page.getByText(TEXT.userAccountSettingsSection))
|
|
.locator('..'),
|
|
...args,
|
|
)
|
|
}
|
|
|
|
/** Fill the "name" input of this form. */
|
|
fillName(name: string) {
|
|
return this.step("Fill 'name' input of 'account' form", (page) =>
|
|
this.locate(page).getByLabel(TEXT.userNameSettingsInput).getByRole('textbox').fill(name),
|
|
)
|
|
}
|
|
|
|
/** Interact with the "name" input of this form. */
|
|
withName(callback: LocatorCallback<Context>) {
|
|
return this.step("Interact with 'name' input of 'organization' form", (page, context) =>
|
|
callback(
|
|
this.locate(page).getByLabel(TEXT.organizationNameSettingsInput).getByRole('textbox'),
|
|
context,
|
|
),
|
|
)
|
|
}
|
|
}
|