enso/app/ide-desktop/lib/dashboard/e2e/createAsset.spec.ts
somebody1234 e59b422612
"Keyboard shortcuts" settings page (#9071)
- Close https://github.com/enso-org/cloud-v2/issues/896
- Add new settings page for viewing and editing keyboard shortcuts
- Refactor shortcut manager to resemble GUI2's shortcuts module
- Minor refactor moving `dashboard/layouts/dashboard` to `dashboard/layouts`; and moving all moals to `dashboard/modals`

# Important Notes
- The modal for capturing keyboard shortcuts has not been tested on macOS.
2024-02-27 12:52:21 +00:00

55 lines
1.9 KiB
TypeScript

/** @file Test copying, moving, cutting and pasting. */
import * as test from '@playwright/test'
import * as actions from './actions'
test.test.beforeEach(actions.mockAllAndLogin)
test.test('create folder', async ({ page }) => {
const assetRows = actions.locateAssetRows(page)
await actions.locateNewFolderIcon(page).click()
// Assets: [0: Folder 1]
await test.expect(assetRows).toHaveCount(1)
await test.expect(assetRows.nth(0)).toBeVisible()
await test.expect(assetRows.nth(0)).toHaveText(/^New Folder 1/)
})
test.test('create project', async ({ page }) => {
const assetRows = actions.locateAssetRows(page)
await actions.locateNewProjectButton(page).click()
// Assets: [0: Project 1]
await test.expect(assetRows).toHaveCount(1)
await test.expect(actions.locateEditor(page)).toBeVisible()
})
test.test('upload file', async ({ page }) => {
const assetRows = actions.locateAssetRows(page)
const fileChooserPromise = page.waitForEvent('filechooser')
await actions.locateUploadFilesIcon(page).click()
const fileChooser = await fileChooserPromise
const name = 'foo.txt'
const content = 'hello world'
await fileChooser.setFiles([{ name, buffer: Buffer.from(content), mimeType: 'text/plain' }])
await test.expect(assetRows).toHaveCount(1)
await test.expect(assetRows.nth(0)).toBeVisible()
await test.expect(assetRows.nth(0)).toHaveText(new RegExp('^' + name))
})
test.test('create secret', async ({ page }) => {
const assetRows = actions.locateAssetRows(page)
await actions.locateNewSecretIcon(page).click()
const name = 'a secret name'
const value = 'a secret value'
await actions.locateSecretNameInput(page).fill(name)
await actions.locateSecretValueInput(page).fill(value)
await actions.locateCreateButton(page).click()
await test.expect(assetRows).toHaveCount(1)
await test.expect(assetRows.nth(0)).toBeVisible()
await test.expect(assetRows.nth(0)).toHaveText(new RegExp('^' + name))
})