2024-06-20 19:19:01 +03:00
|
|
|
/** @file Actions for the "home" page. */
|
2024-10-11 21:23:02 +03:00
|
|
|
import * as actions from '.'
|
2024-06-20 19:19:01 +03:00
|
|
|
import BaseActions from './BaseActions'
|
|
|
|
import DrivePageActions from './DrivePageActions'
|
|
|
|
import EditorPageActions from './EditorPageActions'
|
|
|
|
|
|
|
|
// =========================
|
|
|
|
// === StartModalActions ===
|
|
|
|
// =========================
|
|
|
|
|
|
|
|
/** Actions for the "start" modal. */
|
|
|
|
export default class StartModalActions extends BaseActions {
|
|
|
|
/** Close this modal and go back to the Drive page. */
|
|
|
|
close() {
|
2024-07-26 09:34:51 +03:00
|
|
|
return this.step('Close "start" modal', (page) => page.getByLabel('Close').click()).into(
|
|
|
|
DrivePageActions,
|
2024-06-20 19:19:01 +03:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
/** Create a project from the template at the given index. */
|
|
|
|
createProjectFromTemplate(index: number) {
|
2024-07-26 09:34:51 +03:00
|
|
|
return this.step(`Create project from template #${index}`, (page) =>
|
2024-06-20 19:19:01 +03:00
|
|
|
actions
|
|
|
|
.locateSamples(page)
|
|
|
|
.nth(index + 1)
|
2024-07-26 09:34:51 +03:00
|
|
|
.click(),
|
2024-06-20 19:19:01 +03:00
|
|
|
).into(EditorPageActions)
|
|
|
|
}
|
|
|
|
}
|